You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: autotune/setup.mdx
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,10 @@ prompt = ze.prompt(
25
25
26
26
That's it! You'll start seeing production traces in your dashboard for this specific task at [`ZeroEval › Tuning › [task_name]`](https://app.zeroeval.com).
27
27
28
+
<Note>
29
+
**Auto-tune behavior:** When you provide `content`, ZeroEval automatically uses the latest optimized version from your dashboard if one exists. The `content` parameter serves as a fallback for when no optimized versions are available yet. This means you can hardcode a default prompt in your code, but ZeroEval will seamlessly swap in tuned versions without any code changes.
30
+
</Note>
31
+
28
32
## Pushing models to production
29
33
30
34
Once you see a model that performs well, you can send it to production with a single click, as seen below.
Every time you change your prompt content, a new version is created:
80
+
ZeroEval automatically manages prompt versions for you. When you use `ze.prompt()` with `content`, the SDK will:
81
+
82
+
1.**Check for optimized versions**: First, it tries to fetch the latest optimized version from your dashboard
83
+
2.**Fall back to your content**: If no optimized versions exist yet, it uses the `content` you provided
84
+
3.**Create a version**: Your provided content is stored as the initial version for this task
85
+
86
+
This means you get the best of both worlds: hardcoded fallback prompts in your code, with automatic optimization in production.
77
87
78
88
```python
79
-
# Version 1 - Initial prompt
80
-
prompt_v1 = ze.prompt(
89
+
# This will use the latest optimized version if one exists in your dashboard
90
+
# Otherwise, it uses the content you provide here
91
+
prompt = ze.prompt(
81
92
name="customer-support",
82
93
content="You are a helpful assistant."
83
94
)
95
+
```
84
96
85
-
# Version 2 - Updated prompt (automatically creates new version)
86
-
prompt_v2 = ze.prompt(
87
-
name="customer-support",
88
-
content="You are a helpful customer support assistant."# Changed!
89
-
)
97
+
### Explicit version control
90
98
91
-
# Fetch specific versions by hash
92
-
latest_prompt = ze.prompt(
99
+
If you need more control over which version to use, you can explicitly specify versions:
100
+
101
+
```python
102
+
# Always use the latest optimized version (fails if none exists)
103
+
prompt = ze.prompt(
93
104
name="customer-support",
94
-
from="latest"# Always get the latest tuned version
105
+
from_="latest"
95
106
)
96
107
97
-
#Or fetch a specific version by its content hash
98
-
specific_prompt= ze.prompt(
108
+
#Use a specific version by its content hash
109
+
prompt= ze.prompt(
99
110
name="customer-support",
100
-
from="a1b2c3d4..."# 64-character SHA-256 hash
111
+
from_="a1b2c3d4..."# 64-character SHA-256 hash
101
112
)
102
113
```
103
114
115
+
<Tip>
116
+
**Best practice**: Use `content` parameter for local development and testing. ZeroEval will automatically use optimized versions in production without any code changes. Only use `from_="latest"` if you want to explicitly require an optimized version to exist.
Copy file name to clipboardExpand all lines: autotune/tuning/prompts.mdx
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,8 @@ from openai import OpenAI
58
58
ze.init()
59
59
client = OpenAI()
60
60
61
-
# Define your prompt
61
+
# Define your prompt - ZeroEval will automatically use the latest optimized
62
+
# version from your dashboard if one exists, falling back to this content
62
63
system_prompt = ze.prompt(
63
64
name="support-bot",
64
65
content="You are a helpful customer support agent."
@@ -90,6 +91,10 @@ ze.send_feedback(
90
91
)
91
92
```
92
93
94
+
<Note>
95
+
**Auto-optimization**: When you use `ze.prompt()` with `content`, ZeroEval automatically fetches the latest optimized version from your dashboard if one exists. Your `content` serves as a fallback for initial setup. This means your prompts improve automatically as you tune them, without any code changes.
96
+
</Note>
97
+
93
98
### Feedback through the API
94
99
95
100
For integration with non-Python systems or direct API access, you can submit feedback using the public HTTP API.
0 commit comments