Repository navigation
Commit 0d2dcf0
authored
test(pydantic_ai): Fix instructions test for pydantic-ai >=2.36.0 (#7321)
Build the agent with public `instructions`/`system_prompt` kwargs
instead of poking internal `_instructions`/`_system_prompts` attributes,
and account for the joiner between multiple instructions changing from a
single newline to a blank line in pydantic-ai 2.36.0.
[There's normalization of instructions occurring under the hood as of
2.36.0](https://github.com/pydantic/pydantic-ai/blame/6246795faf941937e1759f51b0dfc65d82a4667b/pydantic_ai_slim/pydantic_ai/agent/__init__.py#L673-L676)
that we don't have a reason to interfere with within the tests, so
moving the configuration of instructions and the system prompt to using
the public `Agent` API.
Fixes PY-2755
Fixes #73061 parent 9f9d17a commit 0d2dcf0
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2228 | 2228 | | |
2229 | 2229 | | |
2230 | 2230 | | |
2231 | | - | |
2232 | 2231 | | |
2233 | 2232 | | |
2234 | 2233 | | |
| 2234 | + | |
| 2235 | + | |
2235 | 2236 | | |
2236 | 2237 | | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
| 2238 | + | |
| 2239 | + | |
2240 | 2240 | | |
2241 | 2241 | | |
2242 | 2242 | | |
| |||
2268 | 2268 | | |
2269 | 2269 | | |
2270 | 2270 | | |
2271 | | - | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
2272 | 2275 | | |
2273 | 2276 | | |
2274 | 2277 | | |
| |||
2291 | 2294 | | |
2292 | 2295 | | |
2293 | 2296 | | |
2294 | | - | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
2295 | 2301 | | |
2296 | 2302 | | |
2297 | 2303 | | |
| |||
0 commit comments