pydantic-ai-examples 0.4.4__tar.gz → 0.4.6__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 (50) hide show
  1. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/.gitignore +0 -1
  2. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/PKG-INFO +3 -3
  3. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py +2 -2
  4. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/predictive_state_updates.py +2 -2
  5. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/shared_state.py +3 -2
  6. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/LICENSE +0 -0
  7. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/README.md +0 -0
  8. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/__main__.py +0 -0
  9. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/__init__.py +0 -0
  10. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/__main__.py +0 -0
  11. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/__init__.py +0 -0
  12. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/agentic_chat.py +0 -0
  13. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/human_in_the_loop.py +0 -0
  14. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/ag_ui/api/tool_based_generative_ui.py +0 -0
  15. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/bank_support.py +0 -0
  16. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/chat_app.html +0 -0
  17. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/chat_app.py +0 -0
  18. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/chat_app.ts +0 -0
  19. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/__init__.py +0 -0
  20. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/agent.py +0 -0
  21. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/custom_evaluators.py +0 -0
  22. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/datasets/time_range_v1.yaml +0 -0
  23. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/datasets/time_range_v1_schema.json +0 -0
  24. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/datasets/time_range_v2.yaml +0 -0
  25. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/datasets/time_range_v2_schema.json +0 -0
  26. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/example_01_generate_dataset.py +0 -0
  27. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/example_02_add_custom_evaluators.py +0 -0
  28. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/example_03_unit_testing.py +0 -0
  29. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/example_04_compare_models.py +0 -0
  30. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/evals/models.py +0 -0
  31. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/flight_booking.py +0 -0
  32. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/py.typed +0 -0
  33. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/pydantic_model.py +0 -0
  34. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/question_graph.py +0 -0
  35. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/rag.py +0 -0
  36. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/roulette_wheel.py +0 -0
  37. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/__init__.py +0 -0
  38. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/agent.py +0 -0
  39. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/app.py +0 -0
  40. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/functions.py +0 -0
  41. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/modal.py +0 -0
  42. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/models.py +0 -0
  43. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/slack.py +0 -0
  44. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/slack_lead_qualifier/store.py +0 -0
  45. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/sql_gen.py +0 -0
  46. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/stream_markdown.py +0 -0
  47. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/stream_whales.py +0 -0
  48. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/weather_agent.py +0 -0
  49. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pydantic_ai_examples/weather_agent_gradio.py +0 -0
  50. {pydantic_ai_examples-0.4.4 → pydantic_ai_examples-0.4.6}/pyproject.toml +0 -0
@@ -15,7 +15,6 @@ examples/pydantic_ai_examples/.chat_app_messages.sqlite
15
15
  .vscode/
16
16
  /question_graph_history.json
17
17
  /docs-site/.wrangler/
18
- /CLAUDE.md
19
18
  node_modules/
20
19
  **.idea/
21
20
  .coverage*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai-examples
3
- Version: 0.4.4
3
+ Version: 0.4.6
4
4
  Summary: Examples of how to use Pydantic AI and what it can do.
5
5
  Author-email: Samuel Colvin <samuel@pydantic.dev>, Marcelo Trylesinski <marcelotryle@gmail.com>, David Montague <david@pydantic.dev>, Alex Hall <alex@pydantic.dev>, Douwe Maan <douwe@pydantic.dev>
6
6
  License-Expression: MIT
@@ -32,8 +32,8 @@ 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
34
  Requires-Dist: modal>=1.0.4
35
- Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,groq,openai,vertexai]==0.4.4
36
- Requires-Dist: pydantic-evals==0.4.4
35
+ Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,groq,openai,vertexai]==0.4.6
36
+ Requires-Dist: pydantic-evals==0.4.6
37
37
  Requires-Dist: python-multipart>=0.0.17
38
38
  Requires-Dist: rich>=13.9.2
39
39
  Requires-Dist: uvicorn>=0.32.0
@@ -67,7 +67,7 @@ agent = Agent(
67
67
 
68
68
 
69
69
  @agent.tool_plain
70
- def create_plan(steps: list[str]) -> StateSnapshotEvent:
70
+ async def create_plan(steps: list[str]) -> StateSnapshotEvent:
71
71
  """Create a plan with multiple steps.
72
72
 
73
73
  Args:
@@ -86,7 +86,7 @@ def create_plan(steps: list[str]) -> StateSnapshotEvent:
86
86
 
87
87
 
88
88
  @agent.tool_plain
89
- def update_plan_step(
89
+ async def update_plan_step(
90
90
  index: int, description: str | None = None, status: StepStatus | None = None
91
91
  ) -> StateDeltaEvent:
92
92
  """Update the plan with new steps or changes.
@@ -23,7 +23,7 @@ agent = Agent('openai:gpt-4o-mini', deps_type=StateDeps[DocumentState])
23
23
  # Tools which return AG-UI events will be sent to the client as part of the
24
24
  # event stream, single events and iterables of events are supported.
25
25
  @agent.tool_plain
26
- def document_predict_state() -> list[CustomEvent]:
26
+ async def document_predict_state() -> list[CustomEvent]:
27
27
  """Enable document state prediction.
28
28
 
29
29
  Returns:
@@ -45,7 +45,7 @@ def document_predict_state() -> list[CustomEvent]:
45
45
 
46
46
 
47
47
  @agent.instructions()
48
- def story_instructions(ctx: RunContext[StateDeps[DocumentState]]) -> str:
48
+ async def story_instructions(ctx: RunContext[StateDeps[DocumentState]]) -> str:
49
49
  """Provide instructions for writing document if present.
50
50
 
51
51
  Args:
@@ -88,7 +88,7 @@ agent = Agent('openai:gpt-4o-mini', deps_type=StateDeps[RecipeSnapshot])
88
88
 
89
89
 
90
90
  @agent.tool_plain
91
- def display_recipe(recipe: Recipe) -> StateSnapshotEvent:
91
+ async def display_recipe(recipe: Recipe) -> StateSnapshotEvent:
92
92
  """Display the recipe to the user.
93
93
 
94
94
  Args:
@@ -104,7 +104,7 @@ def display_recipe(recipe: Recipe) -> StateSnapshotEvent:
104
104
 
105
105
 
106
106
  @agent.instructions
107
- def recipe_instructions(ctx: RunContext[StateDeps[RecipeSnapshot]]) -> str:
107
+ async def recipe_instructions(ctx: RunContext[StateDeps[RecipeSnapshot]]) -> str:
108
108
  """Instructions for the recipe generation agent.
109
109
 
110
110
  Args:
@@ -122,6 +122,7 @@ def recipe_instructions(ctx: RunContext[StateDeps[RecipeSnapshot]]) -> str:
122
122
  - Append new ingredients to the existing ones
123
123
  - Use the `display_recipe` tool to present the recipe to the user
124
124
  - Do NOT repeat the recipe in the message, use the tool instead
125
+ - Do NOT run the `display_recipe` tool multiple times in a row
125
126
 
126
127
  Once you have created the updated recipe and displayed it to the user,
127
128
  summarise the changes in one sentence, don't describe the recipe in