Skip to content

Commit 9408649

Browse files
committed
fix(example): Resolve UTC error with timezone
1 parent 9e04a9b commit 9408649

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/pydantic_ai_examples/medical_agent_delegation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import asyncio
2626
from dataclasses import dataclass
27-
from datetime import UTC, datetime
27+
from datetime import datetime, timezone
2828
from enum import Enum
2929
from typing import Any
3030

@@ -33,7 +33,8 @@
3333

3434
from pydantic_ai import Agent, ModelHTTPError, RunContext
3535

36-
MODEL = 'openai:gpt-4.1-mini'
36+
# MODEL = 'openai:gpt-4.1-mini'
37+
MODEL = 'cohere:command-r7b-12-2024'
3738

3839

3940
# Structured Outputs
@@ -220,7 +221,7 @@ def __init__(self):
220221
async def handle_patient(
221222
self, complaint: str, patient: PatientInfo
222223
) -> dict[str, str]:
223-
timestamp = datetime.now(UTC).isoformat()
224+
timestamp = datetime.now(tz=timezone.utc).isoformat()
224225
print(f'\n[{timestamp}] Processing complaint: {complaint}')
225226

226227
triage_prompt = (

0 commit comments

Comments
 (0)