Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: add message union type ref for LettaResponse (#507)

cthomase2d94614e6a4
diff --git a/letta/schemas/letta_response.py b/letta/schemas/letta_response.py
index 10a1b3800..d7019280b 100644
--- a/letta/schemas/letta_response.py
+++ b/letta/schemas/letta_response.py
@@ -29,19 +29,20 @@ class LettaResponse(BaseModel):
json_schema_extra={
"items": {
"oneOf": [
- {"x-ref-name": "SystemMessage"},
- {"x-ref-name": "UserMessage"},
- {"x-ref-name": "ReasoningMessage"},
- {"x-ref-name": "ToolCallMessage"},
- {"x-ref-name": "ToolReturnMessage"},
- {"x-ref-name": "AssistantMessage"},
+ {"$ref": "#/components/schemas/SystemMessage-Output"},
+ {"$ref": "#/components/schemas/UserMessage-Output"},
+ {"$ref": "#/components/schemas/ReasoningMessage"},
+ {"$ref": "#/components/schemas/ToolCallMessage"},
+ {"$ref": "#/components/schemas/ToolReturnMessage"},
+ {"$ref": "#/components/schemas/AssistantMessage-Output"},
],
"discriminator": {"propertyName": "message_type"},
}
},
)
usage: LettaUsageStatistics = Field(
- ..., description="The usage statistics of the agent.", json_schema_extra={"x-ref-name": "LettaUsageStatistics"}
+ ...,
+ description="The usage statistics of the agent.",
)
def __str__(self):