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
'What was his most famous equation?', message_history=result1.new_messages() # (1)!
110
+
'What was his most famous equation?',
111
+
message_history=result1.new_messages(), # (1)!
111
112
)
112
113
print(result2.data)
113
114
#> Albert Einstein's most famous equation is (E = mc^2).
114
115
```
115
-
1. Continue the conversation, without `message_history` the model would not know who "he" was referring to.
116
+
117
+
1. Continue the conversation, without `message_history` the model would not know who "his" was referring to.
116
118
117
119
_(This example is complete, it can be run "as is")_
118
120
@@ -158,7 +160,7 @@ print(result.data)
158
160
159
161
1. The agent expects a string dependency.
160
162
2. Static system prompt defined at agent creation time.
161
-
3. Dynamic system prompt defined via a decorator.
163
+
3. Dynamic system prompt defined via a decorator with [`CallContext`][pydantic_ai.dependencies.CallContext], this is called just after `run_sync`, not when the agent is created, so can benefit from runtime information like the dependencies used on that run.
162
164
4. Another dynamic system prompt, system prompts don't have to have the `CallContext` parameter.
163
165
164
166
_(This example is complete, it can be run "as is")_
0 commit comments