pydantic-ai-examples 0.2.10__tar.gz → 0.2.12__tar.gz

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-examples might be problematic. Click here for more details.

Files changed (32) hide show
  1. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/PKG-INFO +3 -3
  2. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/sql_gen.py +1 -1
  3. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/weather_agent_gradio.py +2 -6
  4. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/.gitignore +0 -0
  5. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/LICENSE +0 -0
  6. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/README.md +0 -0
  7. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/__main__.py +0 -0
  8. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/bank_support.py +0 -0
  9. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/chat_app.html +0 -0
  10. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/chat_app.py +0 -0
  11. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/chat_app.ts +0 -0
  12. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/__init__.py +0 -0
  13. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/agent.py +0 -0
  14. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/custom_evaluators.py +0 -0
  15. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/datasets/time_range_v1.yaml +0 -0
  16. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/datasets/time_range_v1_schema.json +0 -0
  17. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/datasets/time_range_v2.yaml +0 -0
  18. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/datasets/time_range_v2_schema.json +0 -0
  19. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/example_01_generate_dataset.py +0 -0
  20. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/example_02_add_custom_evaluators.py +0 -0
  21. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/example_03_unit_testing.py +0 -0
  22. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/example_04_compare_models.py +0 -0
  23. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/evals/models.py +0 -0
  24. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/flight_booking.py +0 -0
  25. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/pydantic_model.py +0 -0
  26. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/question_graph.py +0 -0
  27. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/rag.py +0 -0
  28. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/roulette_wheel.py +0 -0
  29. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/stream_markdown.py +0 -0
  30. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/stream_whales.py +0 -0
  31. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pydantic_ai_examples/weather_agent.py +0 -0
  32. {pydantic_ai_examples-0.2.10 → pydantic_ai_examples-0.2.12}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai-examples
3
- Version: 0.2.10
3
+ Version: 0.2.12
4
4
  Summary: Examples of how to use PydanticAI and what it can do.
5
5
  Author-email: Samuel Colvin <samuel@pydantic.dev>
6
6
  License-Expression: MIT
@@ -31,8 +31,8 @@ Requires-Dist: fastapi>=0.115.4
31
31
  Requires-Dist: gradio>=5.9.0; python_version > '3.9'
32
32
  Requires-Dist: logfire[asyncpg,fastapi,httpx,sqlite3]>=2.6
33
33
  Requires-Dist: mcp[cli]>=1.4.1; python_version >= '3.10'
34
- Requires-Dist: pydantic-ai-slim[anthropic,groq,openai,vertexai]==0.2.10
35
- Requires-Dist: pydantic-evals==0.2.10
34
+ Requires-Dist: pydantic-ai-slim[anthropic,groq,openai,vertexai]==0.2.12
35
+ Requires-Dist: pydantic-evals==0.2.12
36
36
  Requires-Dist: python-multipart>=0.0.17
37
37
  Requires-Dist: rich>=13.9.2
38
38
  Requires-Dist: uvicorn>=0.32.0
@@ -92,7 +92,7 @@ class InvalidRequest(BaseModel):
92
92
 
93
93
 
94
94
  Response: TypeAlias = Union[Success, InvalidRequest]
95
- agent: Agent[Deps, Response] = Agent(
95
+ agent = Agent[Deps, Response](
96
96
  'google-gla:gemini-1.5-flash',
97
97
  # Type ignore while we wait for PEP-0747, nonetheless unions will work fine everywhere else
98
98
  output_type=Response, # type: ignore
@@ -33,16 +33,12 @@ async def stream_from_agent(prompt: str, chatbot: list[dict], past_messages: lis
33
33
  for message in result.new_messages():
34
34
  for call in message.parts:
35
35
  if isinstance(call, ToolCallPart):
36
- call_args = (
37
- call.args.args_json
38
- if hasattr(call.args, 'args_json')
39
- else json.dumps(call.args.args_dict)
40
- )
36
+ call_args = call.args_as_json_str()
41
37
  metadata = {
42
38
  'title': f'🛠️ Using {TOOL_TO_DISPLAY_NAME[call.tool_name]}',
43
39
  }
44
40
  if call.tool_call_id is not None:
45
- metadata['id'] = {call.tool_call_id}
41
+ metadata['id'] = call.tool_call_id
46
42
 
47
43
  gr_message = {
48
44
  'role': 'assistant',