We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0693a1 commit d599502Copy full SHA for d599502
examples/agent_patterns/output_guardrails.py
@@ -2,6 +2,7 @@
2
3
import asyncio
4
import json
5
+from typing import Union
6
7
from pydantic import BaseModel, Field
8
@@ -31,7 +32,7 @@
31
32
class MessageOutput(BaseModel):
33
reasoning: str = Field(description="Thoughts on how to respond to the user's message")
34
response: str = Field(description="The response to the user's message")
- 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")
36
37
38
@output_guardrail
0 commit comments