pydantic-ai-examples 1.6.0__py3-none-any.whl → 1.8.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.
- pydantic_ai_examples/ag_ui/api/agentic_chat.py +1 -1
- pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py +1 -1
- pydantic_ai_examples/ag_ui/api/human_in_the_loop.py +1 -1
- pydantic_ai_examples/ag_ui/api/predictive_state_updates.py +1 -1
- pydantic_ai_examples/ag_ui/api/shared_state.py +1 -1
- pydantic_ai_examples/ag_ui/api/tool_based_generative_ui.py +1 -1
- pydantic_ai_examples/bank_support.py +1 -1
- pydantic_ai_examples/chat_app.py +1 -1
- pydantic_ai_examples/data_analyst.py +1 -1
- pydantic_ai_examples/evals/agent.py +1 -1
- pydantic_ai_examples/evals/example_04_compare_models.py +2 -2
- pydantic_ai_examples/flight_booking.py +3 -3
- pydantic_ai_examples/pydantic_model.py +1 -1
- pydantic_ai_examples/question_graph.py +2 -2
- pydantic_ai_examples/rag.py +1 -1
- pydantic_ai_examples/slack_lead_qualifier/agent.py +1 -1
- pydantic_ai_examples/sql_gen.py +1 -1
- pydantic_ai_examples/stream_markdown.py +2 -2
- pydantic_ai_examples/weather_agent.py +1 -1
- {pydantic_ai_examples-1.6.0.dist-info → pydantic_ai_examples-1.8.0.dist-info}/METADATA +3 -3
- {pydantic_ai_examples-1.6.0.dist-info → pydantic_ai_examples-1.8.0.dist-info}/RECORD +23 -23
- {pydantic_ai_examples-1.6.0.dist-info → pydantic_ai_examples-1.8.0.dist-info}/WHEEL +0 -0
- {pydantic_ai_examples-1.6.0.dist-info → pydantic_ai_examples-1.8.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -17,7 +17,7 @@ class DocumentState(BaseModel):
|
|
|
17
17
|
document: str = ''
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
agent = Agent('openai:gpt-
|
|
20
|
+
agent = Agent('openai:gpt-5-mini', deps_type=StateDeps[DocumentState])
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
# Tools which return AG-UI events will be sent to the client as part of the
|
pydantic_ai_examples/chat_app.py
CHANGED
|
@@ -21,7 +21,7 @@ class TimeRangeDeps:
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
time_range_agent = Agent[TimeRangeDeps, TimeRangeResponse](
|
|
24
|
-
'gpt-
|
|
24
|
+
'gpt-5',
|
|
25
25
|
output_type=TimeRangeResponse, # type: ignore # we can't yet annotate something as receiving a TypeForm
|
|
26
26
|
deps_type=TimeRangeDeps,
|
|
27
27
|
system_prompt="Convert the user's request into a structured time range.",
|
|
@@ -28,8 +28,8 @@ def compare_models():
|
|
|
28
28
|
dataset_path, custom_evaluator_types=CUSTOM_EVALUATOR_TYPES
|
|
29
29
|
)
|
|
30
30
|
with logfire.span('Comparing different models for time_range_agent'):
|
|
31
|
-
with time_range_agent.override(model='openai:gpt-
|
|
32
|
-
dataset.evaluate_sync(infer_time_range, name='openai:gpt-
|
|
31
|
+
with time_range_agent.override(model='openai:gpt-5'):
|
|
32
|
+
dataset.evaluate_sync(infer_time_range, name='openai:gpt-5')
|
|
33
33
|
with time_range_agent.override(model='openai:o1'):
|
|
34
34
|
dataset.evaluate_sync(infer_time_range, name='openai:o1')
|
|
35
35
|
|
|
@@ -49,7 +49,7 @@ class Deps:
|
|
|
49
49
|
|
|
50
50
|
# This agent is responsible for controlling the flow of the conversation.
|
|
51
51
|
search_agent = Agent[Deps, FlightDetails | NoFlightFound](
|
|
52
|
-
'openai:gpt-
|
|
52
|
+
'openai:gpt-5',
|
|
53
53
|
output_type=FlightDetails | NoFlightFound, # type: ignore
|
|
54
54
|
retries=4,
|
|
55
55
|
system_prompt=(
|
|
@@ -60,7 +60,7 @@ search_agent = Agent[Deps, FlightDetails | NoFlightFound](
|
|
|
60
60
|
|
|
61
61
|
# This agent is responsible for extracting flight details from web page text.
|
|
62
62
|
extraction_agent = Agent(
|
|
63
|
-
'openai:gpt-
|
|
63
|
+
'openai:gpt-5',
|
|
64
64
|
output_type=list[FlightDetails],
|
|
65
65
|
system_prompt='Extract all the flight details from the given text.',
|
|
66
66
|
)
|
|
@@ -112,7 +112,7 @@ class Failed(BaseModel):
|
|
|
112
112
|
|
|
113
113
|
# This agent is responsible for extracting the user's seat selection
|
|
114
114
|
seat_preference_agent = Agent[None, SeatPreference | Failed](
|
|
115
|
-
'openai:gpt-
|
|
115
|
+
'openai:gpt-5',
|
|
116
116
|
output_type=SeatPreference | Failed,
|
|
117
117
|
system_prompt=(
|
|
118
118
|
"Extract the user's seat preference. "
|
|
@@ -26,7 +26,7 @@ from pydantic_graph.persistence.file import FileStatePersistence
|
|
|
26
26
|
logfire.configure(send_to_logfire='if-token-present')
|
|
27
27
|
logfire.instrument_pydantic_ai()
|
|
28
28
|
|
|
29
|
-
ask_agent = Agent('openai:gpt-
|
|
29
|
+
ask_agent = Agent('openai:gpt-5', output_type=str)
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
@dataclass
|
|
@@ -65,7 +65,7 @@ class EvaluationOutput(BaseModel, use_attribute_docstrings=True):
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
evaluate_agent = Agent(
|
|
68
|
-
'openai:gpt-
|
|
68
|
+
'openai:gpt-5',
|
|
69
69
|
output_type=EvaluationOutput,
|
|
70
70
|
system_prompt='Given a question and answer, evaluate if the answer is correct.',
|
|
71
71
|
)
|
pydantic_ai_examples/rag.py
CHANGED
pydantic_ai_examples/sql_gen.py
CHANGED
|
@@ -92,7 +92,7 @@ class InvalidRequest(BaseModel):
|
|
|
92
92
|
|
|
93
93
|
Response: TypeAlias = Success | InvalidRequest
|
|
94
94
|
agent = Agent[Deps, Response](
|
|
95
|
-
'google-gla:gemini-
|
|
95
|
+
'google-gla:gemini-2.5-flash',
|
|
96
96
|
# Type ignore while we wait for PEP-0747, nonetheless unions will work fine everywhere else
|
|
97
97
|
output_type=Response, # type: ignore
|
|
98
98
|
deps_type=Deps,
|
|
@@ -26,8 +26,8 @@ agent = Agent()
|
|
|
26
26
|
|
|
27
27
|
# models to try, and the appropriate env var
|
|
28
28
|
models: list[tuple[KnownModelName, str]] = [
|
|
29
|
-
('google-gla:gemini-2.
|
|
30
|
-
('openai:gpt-
|
|
29
|
+
('google-gla:gemini-2.5-flash', 'GEMINI_API_KEY'),
|
|
30
|
+
('openai:gpt-5-mini', 'OPENAI_API_KEY'),
|
|
31
31
|
('groq:llama-3.3-70b-versatile', 'GROQ_API_KEY'),
|
|
32
32
|
]
|
|
33
33
|
|
|
@@ -32,7 +32,7 @@ class Deps:
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
weather_agent = Agent(
|
|
35
|
-
'openai:gpt-
|
|
35
|
+
'openai:gpt-5-mini',
|
|
36
36
|
# 'Be concise, reply with one sentence.' is enough for some models (like openai) to use
|
|
37
37
|
# the below tools appropriately, but others like anthropic and gemini require a bit more direction.
|
|
38
38
|
instructions='Be concise, reply with one sentence.',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-examples
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.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.8.0
|
|
38
|
+
Requires-Dist: pydantic-evals==1.8.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
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
pydantic_ai_examples/__main__.py,sha256=i0LEo2JBOZ-gnHED0ou5Bya43gi7KmOyQ_jKN7M5Ces,1647
|
|
2
|
-
pydantic_ai_examples/bank_support.py,sha256=
|
|
2
|
+
pydantic_ai_examples/bank_support.py,sha256=O9r6yQraDRPibWLOC1wyZu0n_Nr7Exg4u7wEHh25czk,2664
|
|
3
3
|
pydantic_ai_examples/chat_app.html,sha256=90XhxrpDAT09mPVTn9edEn8PqAD-tHxWkeeMz9r_okQ,2580
|
|
4
|
-
pydantic_ai_examples/chat_app.py,sha256=
|
|
4
|
+
pydantic_ai_examples/chat_app.py,sha256=AX28rI0TR9lTPLDOd0uEkmirvfIZCRyCGr_VdGiOkHM,7053
|
|
5
5
|
pydantic_ai_examples/chat_app.ts,sha256=2KfZ2rJU2o0iCPjelyqEi5sH6vfemzWaa5Evx_VcAE4,3307
|
|
6
|
-
pydantic_ai_examples/data_analyst.py,sha256=
|
|
7
|
-
pydantic_ai_examples/flight_booking.py,sha256=
|
|
6
|
+
pydantic_ai_examples/data_analyst.py,sha256=sC6mcgfeWzfj4STB7J_7oAWC7T8Y0NWvlIeQ8XND9zA,3752
|
|
7
|
+
pydantic_ai_examples/flight_booking.py,sha256=x8FbztbAiqNdDACzal1O5M80syjt8UuGm_wqHpybeQM,7415
|
|
8
8
|
pydantic_ai_examples/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
pydantic_ai_examples/pydantic_model.py,sha256=
|
|
10
|
-
pydantic_ai_examples/question_graph.py,sha256=
|
|
11
|
-
pydantic_ai_examples/rag.py,sha256=
|
|
9
|
+
pydantic_ai_examples/pydantic_model.py,sha256=4u_-sdpKSF_lRMLSI-WVYwsyIxgdOpq-8LSCJunoyvA,774
|
|
10
|
+
pydantic_ai_examples/question_graph.py,sha256=ERjlfHxKXswISed6TJtj60SFoTIYe-PyCTZoYR4OJkY,5073
|
|
11
|
+
pydantic_ai_examples/rag.py,sha256=7zilWBrVsag0iIgiJ_I5-_khDkZUYvfrzMJRhtv48hM,8010
|
|
12
12
|
pydantic_ai_examples/roulette_wheel.py,sha256=2YHKbGzYOkLsd98hO3ntjM6pChR1UpmsRrLD36Qh5f0,1654
|
|
13
|
-
pydantic_ai_examples/sql_gen.py,sha256=
|
|
14
|
-
pydantic_ai_examples/stream_markdown.py,sha256=
|
|
13
|
+
pydantic_ai_examples/sql_gen.py,sha256=akgJv4TSImw6O4NRgQZh92QITSmDeEyvoGQcU3oUNFQ,5159
|
|
14
|
+
pydantic_ai_examples/stream_markdown.py,sha256=4uEK6dzC9jVcQTRaYBEDzYfYAJPYHZWfLJ-ZMtmI8y4,2453
|
|
15
15
|
pydantic_ai_examples/stream_whales.py,sha256=Yoa7IuqN_6fowfYSINW39uPCthYu9FKChF-QBmQqWb8,2721
|
|
16
|
-
pydantic_ai_examples/weather_agent.py,sha256=
|
|
16
|
+
pydantic_ai_examples/weather_agent.py,sha256=FZF7pgL2U24m-ymFUw6MnqASVpXOfl49ilrYAtZXlOo,3185
|
|
17
17
|
pydantic_ai_examples/weather_agent_gradio.py,sha256=MCoNp5TgWj628ABoZpTUVJYIeSV_C-ig08WfcssDH7A,4719
|
|
18
18
|
pydantic_ai_examples/ag_ui/__init__.py,sha256=ZZs2V-5e9RaLl_7hJAq9-0Juk_f0mk2Vr7a4QT2QB-k,1174
|
|
19
19
|
pydantic_ai_examples/ag_ui/__main__.py,sha256=PMycatJt8Abb-Q8HXRGZoEY6vnOcvRebH7iI9MxLknA,225
|
|
20
20
|
pydantic_ai_examples/ag_ui/api/__init__.py,sha256=Pe307_ET_ERKBP-8Vs4L1yZRkK3ILPpajwxDpeW8YiI,673
|
|
21
|
-
pydantic_ai_examples/ag_ui/api/agentic_chat.py,sha256=
|
|
22
|
-
pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py,sha256=
|
|
23
|
-
pydantic_ai_examples/ag_ui/api/human_in_the_loop.py,sha256=
|
|
24
|
-
pydantic_ai_examples/ag_ui/api/predictive_state_updates.py,sha256=
|
|
25
|
-
pydantic_ai_examples/ag_ui/api/shared_state.py,sha256=
|
|
26
|
-
pydantic_ai_examples/ag_ui/api/tool_based_generative_ui.py,sha256=
|
|
21
|
+
pydantic_ai_examples/ag_ui/api/agentic_chat.py,sha256=PsKHQpL-sx2cgMKg9uW1qQlRAQpPOK6EAES7VBevJXQ,532
|
|
22
|
+
pydantic_ai_examples/ag_ui/api/agentic_generative_ui.py,sha256=dbP6MIw2GBdkgBqfAxXklFpHwxBH8trp7HR7He6QnMQ,3488
|
|
23
|
+
pydantic_ai_examples/ag_ui/api/human_in_the_loop.py,sha256=MmfUwxp9EEELzS2ikx-Y1uY3LUmr8M7k2M7Fre7tma8,764
|
|
24
|
+
pydantic_ai_examples/ag_ui/api/predictive_state_updates.py,sha256=oAvnz6LQLCEuEhMqWVmEDuVuHJOoLObdzGmppJFHLSc,2123
|
|
25
|
+
pydantic_ai_examples/ag_ui/api/shared_state.py,sha256=J09k2Ry83K3aCwbsEq9j3k8e7EJiD6fJRjzjaYOt8IE,3801
|
|
26
|
+
pydantic_ai_examples/ag_ui/api/tool_based_generative_ui.py,sha256=zSUcn31wDksEStPofSuvjF0Arc0TglpvCzm_-bVG-PM,218
|
|
27
27
|
pydantic_ai_examples/evals/__init__.py,sha256=4f1v2o4F-gnUVtlkZU-dpwwwbLhqRxMcZv676atjNLg,115
|
|
28
|
-
pydantic_ai_examples/evals/agent.py,sha256=
|
|
28
|
+
pydantic_ai_examples/evals/agent.py,sha256=o_l6I4DF3HXh7fgsmyz7mViq1ckdFV1Hxq_B7KJPLa0,2041
|
|
29
29
|
pydantic_ai_examples/evals/custom_evaluators.py,sha256=siSpALUMrUGJ1DDrm0Ejniuxhmxhlvee_jubgXjOAeU,2244
|
|
30
30
|
pydantic_ai_examples/evals/example_01_generate_dataset.py,sha256=R-cV9bBHMA8EMIyveP5Yf2p3_VV-g_NSXtDa_zz0ODs,2368
|
|
31
31
|
pydantic_ai_examples/evals/example_02_add_custom_evaluators.py,sha256=pFX0bvVeyfbZGGb0LSajRW-g1ZiVID3e3-sEXZVcjv8,977
|
|
32
32
|
pydantic_ai_examples/evals/example_03_unit_testing.py,sha256=G4Ry7ykJfozaQ9GEXi6cnz0O-6pGBrZIkV4_6RNK194,1207
|
|
33
|
-
pydantic_ai_examples/evals/example_04_compare_models.py,sha256=
|
|
33
|
+
pydantic_ai_examples/evals/example_04_compare_models.py,sha256=4oPIeFgbk2vMkN7asN6LjWMYPatMpUFLkKhEzrioqJg,1199
|
|
34
34
|
pydantic_ai_examples/evals/models.py,sha256=QYe_fNv03fmF4ssgSqutHgGx2YX5NLKhhth8-0XFnWo,1776
|
|
35
35
|
pydantic_ai_examples/evals/datasets/time_range_v1.yaml,sha256=pSUawuDen4NQt2RqqJNmrVENgksTWxIFcw-Kkao_yo8,4193
|
|
36
36
|
pydantic_ai_examples/evals/datasets/time_range_v1_schema.json,sha256=xS-wRRSvcoG2FcQZGdL0i332mbjsZh9MOSJAND6VkWU,19932
|
|
37
37
|
pydantic_ai_examples/evals/datasets/time_range_v2.yaml,sha256=zIffxC5bR2l05MrrECJsTHiagFaz8nIPTH-YrmjJz8I,4326
|
|
38
38
|
pydantic_ai_examples/evals/datasets/time_range_v2_schema.json,sha256=GDbDtBH1skdbUzK5Wd_0-SNXTmEWHMTYhhshaLsq_1Q,21309
|
|
39
39
|
pydantic_ai_examples/slack_lead_qualifier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
pydantic_ai_examples/slack_lead_qualifier/agent.py,sha256=
|
|
40
|
+
pydantic_ai_examples/slack_lead_qualifier/agent.py,sha256=kskE4RjlqeqAT51NDt7FoC1OIyQ47DqFcTDkCOvQS9k,1935
|
|
41
41
|
pydantic_ai_examples/slack_lead_qualifier/app.py,sha256=KALNxIV8hz0lGxFclZHxolqoH4MsiIYga_CmpidzONE,1036
|
|
42
42
|
pydantic_ai_examples/slack_lead_qualifier/functions.py,sha256=4LsYtPH_SBo_rJ7008DXvKq_SOwiGtweW_DfzJh8R0s,2196
|
|
43
43
|
pydantic_ai_examples/slack_lead_qualifier/modal.py,sha256=f464AaeyP-n3UIfvEVVc4DZ7FQQtsEX7-kUP3VqoPYo,1635
|
|
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.
|
|
48
|
-
pydantic_ai_examples-1.
|
|
49
|
-
pydantic_ai_examples-1.
|
|
50
|
-
pydantic_ai_examples-1.
|
|
47
|
+
pydantic_ai_examples-1.8.0.dist-info/METADATA,sha256=5MmWc0mCoCTmRE7W_Z0IGdsUyejVlX4TI6wMh2jcXX0,2760
|
|
48
|
+
pydantic_ai_examples-1.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
49
|
+
pydantic_ai_examples-1.8.0.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
|
|
50
|
+
pydantic_ai_examples-1.8.0.dist-info/RECORD,,
|
|
File without changes
|
{pydantic_ai_examples-1.6.0.dist-info → pydantic_ai_examples-1.8.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|