pydantic-ai-slim 1.8.0__py3-none-any.whl → 1.9.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pydantic-ai-slim might be problematic. Click here for more details.

Files changed (33) hide show
  1. pydantic_ai/__init__.py +2 -0
  2. pydantic_ai/_agent_graph.py +3 -0
  3. pydantic_ai/ag_ui.py +50 -696
  4. pydantic_ai/agent/abstract.py +13 -3
  5. pydantic_ai/direct.py +12 -0
  6. pydantic_ai/durable_exec/dbos/_agent.py +3 -0
  7. pydantic_ai/durable_exec/prefect/_agent.py +3 -0
  8. pydantic_ai/durable_exec/temporal/_agent.py +3 -0
  9. pydantic_ai/messages.py +39 -7
  10. pydantic_ai/models/__init__.py +42 -1
  11. pydantic_ai/models/google.py +5 -12
  12. pydantic_ai/models/groq.py +9 -1
  13. pydantic_ai/providers/anthropic.py +2 -2
  14. pydantic_ai/result.py +19 -7
  15. pydantic_ai/ui/__init__.py +16 -0
  16. pydantic_ai/ui/_adapter.py +386 -0
  17. pydantic_ai/ui/_event_stream.py +591 -0
  18. pydantic_ai/ui/_messages_builder.py +28 -0
  19. pydantic_ai/ui/ag_ui/__init__.py +9 -0
  20. pydantic_ai/ui/ag_ui/_adapter.py +187 -0
  21. pydantic_ai/ui/ag_ui/_event_stream.py +227 -0
  22. pydantic_ai/ui/ag_ui/app.py +148 -0
  23. pydantic_ai/ui/vercel_ai/__init__.py +16 -0
  24. pydantic_ai/ui/vercel_ai/_adapter.py +199 -0
  25. pydantic_ai/ui/vercel_ai/_event_stream.py +187 -0
  26. pydantic_ai/ui/vercel_ai/_utils.py +16 -0
  27. pydantic_ai/ui/vercel_ai/request_types.py +275 -0
  28. pydantic_ai/ui/vercel_ai/response_types.py +230 -0
  29. {pydantic_ai_slim-1.8.0.dist-info → pydantic_ai_slim-1.9.1.dist-info}/METADATA +5 -3
  30. {pydantic_ai_slim-1.8.0.dist-info → pydantic_ai_slim-1.9.1.dist-info}/RECORD +33 -19
  31. {pydantic_ai_slim-1.8.0.dist-info → pydantic_ai_slim-1.9.1.dist-info}/WHEEL +0 -0
  32. {pydantic_ai_slim-1.8.0.dist-info → pydantic_ai_slim-1.9.1.dist-info}/entry_points.txt +0 -0
  33. {pydantic_ai_slim-1.8.0.dist-info → pydantic_ai_slim-1.9.1.dist-info}/licenses/LICENSE +0 -0
pydantic_ai/__init__.py CHANGED
@@ -65,6 +65,7 @@ from .messages import (
65
65
  ModelResponseStreamEvent,
66
66
  MultiModalContent,
67
67
  PartDeltaEvent,
68
+ PartEndEvent,
68
69
  PartStartEvent,
69
70
  RetryPromptPart,
70
71
  SystemPromptPart,
@@ -164,6 +165,7 @@ __all__ = (
164
165
  'ModelResponseStreamEvent',
165
166
  'MultiModalContent',
166
167
  'PartDeltaEvent',
168
+ 'PartEndEvent',
167
169
  'PartStartEvent',
168
170
  'RetryPromptPart',
169
171
  'SystemPromptPart',
@@ -267,6 +267,9 @@ class UserPromptNode(AgentNode[DepsT, NodeRunEndT]):
267
267
 
268
268
  next_message.instructions = await ctx.deps.get_instructions(run_context)
269
269
 
270
+ if not messages and not next_message.parts and not next_message.instructions:
271
+ raise exceptions.UserError('No message history, user prompt, or instructions provided')
272
+
270
273
  return ModelRequestNode[DepsT, NodeRunEndT](request=next_message)
271
274
 
272
275
  async def _handle_deferred_tool_results( # noqa: C901