pydantic-ai-examples 0.3.6__py3-none-any.whl → 0.3.7__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.
- pydantic_ai_examples/stream_whales.py +2 -15
- {pydantic_ai_examples-0.3.6.dist-info → pydantic_ai_examples-0.3.7.dist-info}/METADATA +3 -3
- {pydantic_ai_examples-0.3.6.dist-info → pydantic_ai_examples-0.3.7.dist-info}/RECORD +5 -5
- {pydantic_ai_examples-0.3.6.dist-info → pydantic_ai_examples-0.3.7.dist-info}/WHEEL +0 -0
- {pydantic_ai_examples-0.3.6.dist-info → pydantic_ai_examples-0.3.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -11,7 +11,7 @@ Run with:
|
|
|
11
11
|
from typing import Annotated
|
|
12
12
|
|
|
13
13
|
import logfire
|
|
14
|
-
from pydantic import Field
|
|
14
|
+
from pydantic import Field
|
|
15
15
|
from rich.console import Console
|
|
16
16
|
from rich.live import Live
|
|
17
17
|
from rich.table import Table
|
|
@@ -51,20 +51,7 @@ async def main():
|
|
|
51
51
|
) as result:
|
|
52
52
|
console.print('Response:', style='green')
|
|
53
53
|
|
|
54
|
-
async for
|
|
55
|
-
try:
|
|
56
|
-
whales = await result.validate_structured_output(
|
|
57
|
-
message, allow_partial=not last
|
|
58
|
-
)
|
|
59
|
-
except ValidationError as exc:
|
|
60
|
-
if all(
|
|
61
|
-
e['type'] == 'missing' and e['loc'] == ('response',)
|
|
62
|
-
for e in exc.errors()
|
|
63
|
-
):
|
|
64
|
-
continue
|
|
65
|
-
else:
|
|
66
|
-
raise
|
|
67
|
-
|
|
54
|
+
async for whales in result.stream(debounce_by=0.01):
|
|
68
55
|
table = Table(
|
|
69
56
|
title='Species of Whale',
|
|
70
57
|
caption='Streaming Structured responses from GPT-4',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-examples
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: Examples of how to use PydanticAI and what it can do.
|
|
5
5
|
Author-email: Samuel Colvin <samuel@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[anthropic,groq,openai,vertexai]==0.3.
|
|
36
|
-
Requires-Dist: pydantic-evals==0.3.
|
|
35
|
+
Requires-Dist: pydantic-ai-slim[anthropic,groq,openai,vertexai]==0.3.7
|
|
36
|
+
Requires-Dist: pydantic-evals==0.3.7
|
|
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
|
|
@@ -10,7 +10,7 @@ pydantic_ai_examples/rag.py,sha256=mFEnJqofVbx_1jru2FZWgskfyDP965IFfanwSlbQzMs,8
|
|
|
10
10
|
pydantic_ai_examples/roulette_wheel.py,sha256=WUPklPKsnmJy-NoPY20mC-AI0820T-YMAYvAljKyiOc,1653
|
|
11
11
|
pydantic_ai_examples/sql_gen.py,sha256=x-vRRDe93DRW83RWgirXkQdthMFwSGcHm0VIoBgvdaE,5200
|
|
12
12
|
pydantic_ai_examples/stream_markdown.py,sha256=4YcUIXI29gwV5rgUb-u7uaf6el7FxfsY9Rcoo1t2_EA,2447
|
|
13
|
-
pydantic_ai_examples/stream_whales.py,sha256=
|
|
13
|
+
pydantic_ai_examples/stream_whales.py,sha256=KC1oth1rMpFtS1-Tbc9EHMtt-BynahH_SGAEJD5sfIE,2714
|
|
14
14
|
pydantic_ai_examples/weather_agent.py,sha256=MA1SDkHuUyh2hC-lZdWUSsBVVLALSajgKduIb5Wer1Q,3186
|
|
15
15
|
pydantic_ai_examples/weather_agent_gradio.py,sha256=WVoRqD74jEvGyUs5VHmsRIGduLMu2sP7GHvc3E79T6A,4521
|
|
16
16
|
pydantic_ai_examples/evals/__init__.py,sha256=4f1v2o4F-gnUVtlkZU-dpwwwbLhqRxMcZv676atjNLg,115
|
|
@@ -33,7 +33,7 @@ pydantic_ai_examples/slack_lead_qualifier/modal.py,sha256=f464AaeyP-n3UIfvEVVc4D
|
|
|
33
33
|
pydantic_ai_examples/slack_lead_qualifier/models.py,sha256=WTp6D2WCASXqrjPVT3vGgTSYATLPBM3_cjq9wvXMRao,1586
|
|
34
34
|
pydantic_ai_examples/slack_lead_qualifier/slack.py,sha256=VJVfMeUXYClWUJBLHNuaW8PB2sxjNzpTC-O_AJwcxQ4,833
|
|
35
35
|
pydantic_ai_examples/slack_lead_qualifier/store.py,sha256=04vB4eZWKk_Tx0b9K4QuVI1U24JEyJyBS4X76cui7OI,896
|
|
36
|
-
pydantic_ai_examples-0.3.
|
|
37
|
-
pydantic_ai_examples-0.3.
|
|
38
|
-
pydantic_ai_examples-0.3.
|
|
39
|
-
pydantic_ai_examples-0.3.
|
|
36
|
+
pydantic_ai_examples-0.3.7.dist-info/METADATA,sha256=xmp1tfeLIH8j9zW4Kdgxko90bogXbVJiKYjAzICMiTg,2598
|
|
37
|
+
pydantic_ai_examples-0.3.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
38
|
+
pydantic_ai_examples-0.3.7.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
|
|
39
|
+
pydantic_ai_examples-0.3.7.dist-info/RECORD,,
|
|
File without changes
|
{pydantic_ai_examples-0.3.6.dist-info → pydantic_ai_examples-0.3.7.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|