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.
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/PKG-INFO +3 -3
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/shared_state.py +4 -4
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/rag.py +3 -2
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/.gitignore +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/LICENSE +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/README.md +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/__main__.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/__init__.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/__main__.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/__init__.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/agentic_chat.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py +0 -0
- {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
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/predictive_state_updates.py +0 -0
- {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
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/bank_support.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.html +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.ts +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/data_analyst.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/__init__.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/agent.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/custom_evaluators.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v1.yaml +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v1_schema.json +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v2.yaml +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/datasets/time_range_v2_schema.json +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_01_generate_dataset.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_02_add_custom_evaluators.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_03_unit_testing.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/example_04_compare_models.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/models.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/flight_booking.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/py.typed +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/pydantic_model.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/question_graph.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/roulette_wheel.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/__init__.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/agent.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/app.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/functions.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/modal.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/models.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/slack.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/slack_lead_qualifier/store.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/sql_gen.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/stream_markdown.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/stream_whales.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/weather_agent.py +0 -0
- {pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/weather_agent_gradio.py +0 -0
- {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.
|
|
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.
|
|
38
|
-
Requires-Dist: pydantic-evals==1.
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
130
|
+
async with create_task_group() as tg:
|
|
130
131
|
for section in sections:
|
|
131
|
-
tg.
|
|
132
|
+
tg.start_soon(insert_doc_section, sem, openai, pool, section)
|
|
132
133
|
|
|
133
134
|
|
|
134
135
|
async def insert_doc_section(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/__init__.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/__main__.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/ag_ui/api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/bank_support.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/chat_app.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/data_analyst.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/__init__.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/agent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/evals/models.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/flight_booking.py
RENAMED
|
File without changes
|
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/pydantic_model.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/question_graph.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/roulette_wheel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/stream_markdown.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/stream_whales.py
RENAMED
|
File without changes
|
{pydantic_ai_examples-1.4.0 → pydantic_ai_examples-1.6.0}/pydantic_ai_examples/weather_agent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|