Skip to content

Commit d599502

Browse files
Fixed annotations example output_guardrails
1 parent d0693a1 commit d599502

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/agent_patterns/output_guardrails.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import json
5+
from typing import Union
56

67
from pydantic import BaseModel, Field
78

@@ -31,7 +32,7 @@
3132
class MessageOutput(BaseModel):
3233
reasoning: str = Field(description="Thoughts on how to respond to the user's message")
3334
response: str = Field(description="The response to the user's message")
34-
user_name: str | None = Field(description="The name of the user who sent the message, if known")
35+
user_name: Union[str, None] = Field(description="The name of the user who sent the message, if known")
3536

3637

3738
@output_guardrail

0 commit comments

Comments
 (0)