-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
A ModelResponse
produced by Agent.run
has the correct actual model_name
returned by the API, but not when streaming.
Example Code
import asyncio
from pydantic_ai import Agent
agent = Agent('gpt-4o')
async def main():
run = await agent.run('hi')
assert run.all_messages()[-1].model_name != 'gpt-4o'
print(run.all_messages()[-1].model_name) # gpt-4o-2024-08-06
async with agent.run_stream('hi') as run:
async for _ in run.stream_text():
...
assert run.all_messages()[-1].model_name == 'gpt-4o' # problem!
asyncio.run(main())
Python, Pydantic AI & LLM client version
Latest on GitHub.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working