pydantic-ai-examples 1.3.0__py3-none-any.whl → 1.5.0__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-examples might be problematic. Click here for more details.

@@ -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(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai-examples
3
- Version: 1.3.0
3
+ Version: 1.5.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.3.0
38
- Requires-Dist: pydantic-evals==1.3.0
37
+ Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,groq,openai,vertexai]==1.5.0
38
+ Requires-Dist: pydantic-evals==1.5.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
@@ -8,7 +8,7 @@ pydantic_ai_examples/flight_booking.py,sha256=dPzbP386m85IzEpIPu_oh7kBi-zfdsgFzz
8
8
  pydantic_ai_examples/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  pydantic_ai_examples/pydantic_model.py,sha256=EQsHBig2bvb0PG_2XDgP9Le5xJ4n8eZJzQDGQYhDykg,775
10
10
  pydantic_ai_examples/question_graph.py,sha256=lVh48-vu0zRqx6Tw1Z5nh-L0fXsUqfOs5Ir_zG8128g,5075
11
- pydantic_ai_examples/rag.py,sha256=lWIusQc1_CQ4GrXRJgteXfDpTfl2AZrd4qZcOXPBC5o,7976
11
+ pydantic_ai_examples/rag.py,sha256=Jbd1fo8LIXp34qCz9tPXPNqYjQUGtUmfK86iWMThR0Q,8011
12
12
  pydantic_ai_examples/roulette_wheel.py,sha256=2YHKbGzYOkLsd98hO3ntjM6pChR1UpmsRrLD36Qh5f0,1654
13
13
  pydantic_ai_examples/sql_gen.py,sha256=rRp_C0ZvfLu6rkR5wrVvgah6wd92nh1vT4UYurx5pmU,5159
14
14
  pydantic_ai_examples/stream_markdown.py,sha256=rdhrR6XkqoeOpfv_xFbRpKDV4drEAd8ZrsFBXVrdvHs,2454
@@ -22,7 +22,7 @@ pydantic_ai_examples/ag_ui/api/agentic_chat.py,sha256=Vrz7TVLHRs28gEdVXQ44R8jJtR
22
22
  pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py,sha256=z2MVonvUKw-9vA4RC8Z8Jz0qYYcmzkxY-1CLotXzDDo,3489
23
23
  pydantic_ai_examples/ag_ui/api/human_in_the_loop.py,sha256=130SDox5HoYjusPr2ubliI8udhxtNxUS3kD9RPb0zYc,765
24
24
  pydantic_ai_examples/ag_ui/api/predictive_state_updates.py,sha256=w98JrwWJfu0fIMdgWbcFcmLz8wZT4bMdfWsCbV9k8Co,2124
25
- pydantic_ai_examples/ag_ui/api/shared_state.py,sha256=1ok84aE4H0J5pWRhcoftf26Y9BAKqfV20ppisRfH52c,3799
25
+ pydantic_ai_examples/ag_ui/api/shared_state.py,sha256=W3Q5EOUgNuhgJ6ncb_JlvQXf9JjMy-SeMBDTKnofr54,3802
26
26
  pydantic_ai_examples/ag_ui/api/tool_based_generative_ui.py,sha256=eT--lWjTzL0S3aIu9C14yeoixLjFXPWqwcdiuIlUAJk,219
27
27
  pydantic_ai_examples/evals/__init__.py,sha256=4f1v2o4F-gnUVtlkZU-dpwwwbLhqRxMcZv676atjNLg,115
28
28
  pydantic_ai_examples/evals/agent.py,sha256=KjCsUiL28RCNT6NwoQnQCwJ0xRw3EUGdIrYhlIjmVqI,2042
@@ -44,7 +44,7 @@ pydantic_ai_examples/slack_lead_qualifier/modal.py,sha256=f464AaeyP-n3UIfvEVVc4D
44
44
  pydantic_ai_examples/slack_lead_qualifier/models.py,sha256=WTp6D2WCASXqrjPVT3vGgTSYATLPBM3_cjq9wvXMRao,1586
45
45
  pydantic_ai_examples/slack_lead_qualifier/slack.py,sha256=VJVfMeUXYClWUJBLHNuaW8PB2sxjNzpTC-O_AJwcxQ4,833
46
46
  pydantic_ai_examples/slack_lead_qualifier/store.py,sha256=04vB4eZWKk_Tx0b9K4QuVI1U24JEyJyBS4X76cui7OI,896
47
- pydantic_ai_examples-1.3.0.dist-info/METADATA,sha256=9rh2NL4w-tyrMPZ2Gc71zRSdzq91_YMsubccGjYnEcg,2760
48
- pydantic_ai_examples-1.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
49
- pydantic_ai_examples-1.3.0.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
50
- pydantic_ai_examples-1.3.0.dist-info/RECORD,,
47
+ pydantic_ai_examples-1.5.0.dist-info/METADATA,sha256=VXu1zKnx4HIj4sBYV_AOBdfUycrW1y8IinDc6e2atwA,2760
48
+ pydantic_ai_examples-1.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
49
+ pydantic_ai_examples-1.5.0.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
50
+ pydantic_ai_examples-1.5.0.dist-info/RECORD,,