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
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,15 @@ That's it! You'll start seeing production traces in your dashboard for this spec
27
27
28
28
<Note>
29
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
+
31
+
To explicitly use the hardcoded content and bypass auto-optimization, use `from_="explicit"`:
32
+
```python
33
+
prompt = ze.prompt(
34
+
name="assistant",
35
+
from_="explicit",
36
+
content="You are a helpful assistant"
37
+
)
38
+
```
30
39
</Note>
31
40
32
41
## Pushing models to production
@@ -96,7 +105,7 @@ prompt = ze.prompt(
96
105
97
106
### Explicit version control
98
107
99
-
If you need more control over which version to use, you can explicitly specify versions:
108
+
If you need more control over which version to use:
100
109
101
110
```python
102
111
# Always use the latest optimized version (fails if none exists)
@@ -105,15 +114,31 @@ prompt = ze.prompt(
105
114
from_="latest"
106
115
)
107
116
117
+
# Always use the hardcoded content (bypass auto-optimization)
118
+
prompt = ze.prompt(
119
+
name="customer-support",
120
+
from_="explicit",
121
+
content="You are a helpful assistant."
122
+
)
123
+
108
124
# Use a specific version by its content hash
109
125
prompt = ze.prompt(
110
126
name="customer-support",
111
127
from_="a1b2c3d4..."# 64-character SHA-256 hash
112
128
)
113
129
```
114
130
131
+
### When to use each mode
132
+
133
+
| Mode | Use Case | Behavior |
134
+
|------|----------|----------|
135
+
|`content` only |**Recommended for most cases**| Auto-optimization with fallback |
136
+
|`from_="explicit"`| Testing, debugging, or A/B testing specific prompts | Always use hardcoded content |
137
+
|`from_="latest"`| Production where optimization is required | Fail if no optimized version exists |
138
+
|`from_="<hash>"`| Pinning to specific tested versions | Use exact version by hash |
139
+
115
140
<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.
141
+
**Best practice**: Use `content` parameter alone for local development and production. ZeroEval will automatically use optimized versions when available. Only use `from_="explicit"`when you specifically need to test or debug the hardcoded content.
Copy file name to clipboardExpand all lines: autotune/tuning/prompts.mdx
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,16 @@ ze.send_feedback(
93
93
94
94
<Note>
95
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
+
97
+
If you need to test the hardcoded content specifically (e.g., for debugging or A/B testing), use `from_="explicit"`:
98
+
```python
99
+
# Bypass auto-optimization and always use this exact content
100
+
prompt = ze.prompt(
101
+
name="support-bot",
102
+
from_="explicit",
103
+
content="You are a helpful customer support agent."
0 commit comments