Skip to content

Commit c07b23a

Browse files
fix: Add state
Signed-off-by: Luis Valdes <[email protected]>
1 parent d5f1bce commit c07b23a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

typescript-sdk/integrations/pydantic-ai/examples/server/api/agentic_chat.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
from __future__ import annotations
44

5+
from dataclasses import dataclass
56
from datetime import datetime
7+
from typing import Any
68
from zoneinfo import ZoneInfo
79

810
from pydantic_ai import Agent
911

10-
agent = Agent('openai:gpt-4o-mini')
12+
13+
@dataclass
14+
class ChatState:
15+
"""State handler for the agentic chat agent."""
16+
state: dict[str, Any]
17+
18+
19+
agent = Agent('openai:gpt-4o-mini', deps_type=ChatState)
1120
app = agent.to_ag_ui()
1221

1322

0 commit comments

Comments
 (0)