-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
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
Example Code
Minimal reproduce code:
import asyncio
from pydantic_ai import Agent
from pydantic_ai.messages import ModelMessage
from pydantic_ai.result import StreamedRunResult
async def main(model: str, prompt: str):
agent = Agent(model=model)
async with agent.run_stream(prompt) as result:
async for content in result.stream_text(delta=True):
print(content)
# break early will trigger error
break
if __name__ == "__main__":
asyncio.run(main("deepseek:deepseek-chat", "Hello, how are you?"))Python, Pydantic AI & LLM client version
Python 3.12.8
>>> pydantic_ai.__version__
'0.1.0'
>>> openai.__version__
'1.74.0'