pydantic-ai-examples 1.4.0__tar.gz → 1.6.0__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 (51) hide show
  1. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/PKG-INFO +3 -3
  2. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/shared_state.py +4 -4
  3. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/rag.py +3 -2
  4. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/.gitignore +0 -0
  5. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/LICENSE +0 -0
  6. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/README.md +0 -0
  7. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/__main__.py +0 -0
  8. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/__init__.py +0 -0
  9. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/__main__.py +0 -0
  10. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/__init__.py +0 -0
  11. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/agentic_chat.py +0 -0
  12. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py +0 -0
  13. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/human_in_the_loop.py +0 -0
  14. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/predictive_state_updates.py +0 -0
  15. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/tool_based_generative_ui.py +0 -0
  16. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/bank_support.py +0 -0
  17. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.html +0 -0
  18. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.py +0 -0
  19. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.ts +0 -0
  20. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/data_analyst.py +0 -0
  21. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/__init__.py +0 -0
  22. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/agent.py +0 -0
  23. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/custom_evaluators.py +0 -0
  24. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v1.yaml +0 -0
  25. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v1_schema.json +0 -0
  26. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v2.yaml +0 -0
  27. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v2_schema.json +0 -0
  28. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_01_generate_dataset.py +0 -0
  29. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_02_add_custom_evaluators.py +0 -0
  30. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_03_unit_testing.py +0 -0
  31. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_04_compare_models.py +0 -0
  32. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/models.py +0 -0
  33. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/flight_booking.py +0 -0
  34. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/py.typed +0 -0
  35. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/pydantic_model.py +0 -0
  36. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/question_graph.py +0 -0
  37. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/roulette_wheel.py +0 -0
  38. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/__init__.py +0 -0
  39. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/agent.py +0 -0
  40. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/app.py +0 -0
  41. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/functions.py +0 -0
  42. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/modal.py +0 -0
  43. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/models.py +0 -0
  44. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/slack.py +0 -0
  45. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/store.py +0 -0
  46. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/sql_gen.py +0 -0
  47. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/stream_markdown.py +0 -0
  48. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/stream_whales.py +0 -0
  49. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/weather_agent.py +0 -0
  50. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/weather_agent_gradio.py +0 -0
  51. {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai-examples
3
- Version: 1.4.0
3
+ Version: 1.6.0
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
@@ -34,8 +34,8 @@ Requires-Dist: logfire[asyncpg,fastapi,httpx,sqlite3]>=3.14.1
34
34
  Requires-Dist: mcp[cli]>=1.4.1
35
35
  Requires-Dist: modal>=1.0.4
36
36
  Requires-Dist: pandas>=2.2.3
37
- Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,groq,openai,vertexai]==1.4.0
38
- Requires-Dist: pydantic-evals==1.4.0
37
+ Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,groq,openai,vertexai]==1.6.0
38
+ Requires-Dist: pydantic-evals==1.6.0
39
39
  Requires-Dist: python-multipart>=0.0.17
40
40
  Requires-Dist: rich>=13.9.2
41
41
  Requires-Dist: uvicorn>=0.32.0
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from enum import StrEnum
5
+ from enum import Enum
6
6
  from textwrap import dedent
7
7
 
8
8
  from pydantic import BaseModel, Field
@@ -12,7 +12,7 @@ from pydantic_ai import Agent, RunContext
12
12
  from pydantic_ai.ag_ui import StateDeps
13
13
 
14
14
 
15
- class SkillLevel(StrEnum):
15
+ class SkillLevel(str, Enum):
16
16
  """The level of skill required for the recipe."""
17
17
 
18
18
  BEGINNER = 'Beginner'
@@ -20,7 +20,7 @@ class SkillLevel(StrEnum):
20
20
  ADVANCED = 'Advanced'
21
21
 
22
22
 
23
- class SpecialPreferences(StrEnum):
23
+ class SpecialPreferences(str, Enum):
24
24
  """Special preferences for the recipe."""
25
25
 
26
26
  HIGH_PROTEIN = 'High Protein'
@@ -32,7 +32,7 @@ class SpecialPreferences(StrEnum):
32
32
  VEGAN = 'Vegan'
33
33
 
34
34
 
35
- class CookingTime(StrEnum):
35
+ class CookingTime(str, Enum):
36
36
  """The cooking time of the recipe."""
37
37
 
38
38
  FIVE_MIN = '5 min'
@@ -30,6 +30,7 @@ import asyncpg
30
30
  import httpx
31
31
  import logfire
32
32
  import pydantic_core
33
+ from anyio import create_task_group
33
34
  from openai import AsyncOpenAI
34
35
  from pydantic import TypeAdapter
35
36
  from typing_extensions import AsyncGenerator
@@ -126,9 +127,9 @@ async def build_search_db():
126
127
  await conn.execute(DB_SCHEMA)
127
128
 
128
129
  sem = asyncio.Semaphore(10)
129
- async with asyncio.TaskGroup() as tg:
130
+ async with create_task_group() as tg:
130
131
  for section in sections:
131
- tg.create_task(insert_doc_section(sem, openai, pool, section))
132
+ tg.start_soon(insert_doc_section, sem, openai, pool, section)
132
133
 
133
134
 
134
135
  async def insert_doc_section(