Skip to content

Commit afcfc1c

Browse files
fix: resolve pydantic violation.
1 parent 04fabfd commit afcfc1c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/contextual/types/agent_metadata_response.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class GetTwilightAgentResponse(BaseModel):
4040
"""Description of the agent"""
4141

4242

43-
AgentMetadataResponse: TypeAlias = Union["AgentMetadata", GetTwilightAgentResponse]
44-
4543
from .agent_metadata import AgentMetadata
44+
45+
# Made a one-time change here to import the AgentMetadata before union, instead of using forward reference.
46+
# Forward reference here violates the Pydantic type system, so it doesn't quite work.
47+
# If there is any issue (circular import, etc) regarding this in the future, we can then find another solution.
48+
AgentMetadataResponse: TypeAlias = Union[AgentMetadata, GetTwilightAgentResponse]

0 commit comments

Comments
 (0)