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.

feat: amend union type for message object (#5326)

cthomasf79a47dbc1c3
diff --git a/fern/openapi.json b/fern/openapi.json
index dac07f7df..32533b230 100644
--- a/fern/openapi.json
+++ b/fern/openapi.json
@@ -30090,21 +30090,14 @@
"anyOf": [
{
"items": {
- "oneOf": [
+ "anyOf": [
{
"$ref": "#/components/schemas/ApprovalReturn"
},
{
- "$ref": "#/components/schemas/letta__schemas__letta_message__ToolReturn"
- }
- ],
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "approval": "#/components/schemas/ApprovalReturn",
- "tool": "#/components/schemas/letta__schemas__letta_message__ToolReturn"
+ "$ref": "#/components/schemas/letta__schemas__message__ToolReturn"
}
- }
+ ]
},
"type": "array"
},
diff --git a/letta/schemas/message.py b/letta/schemas/message.py
index b876212db..f30bf1da8 100644
--- a/letta/schemas/message.py
+++ b/letta/schemas/message.py
@@ -225,7 +225,7 @@ class Message(BaseMessage):
)
approve: Optional[bool] = Field(default=None, description="Whether tool call is approved.")
denial_reason: Optional[str] = Field(default=None, description="The reason the tool call request was denied.")
- approvals: Optional[List[LettaMessageReturnUnion]] = Field(default=None, description="The list of approvals for this message.")
+ approvals: Optional[List[ApprovalReturn | ToolReturn]] = Field(default=None, description="The list of approvals for this message.")
# This overrides the optional base orm schema, created_at MUST exist on all messages objects
created_at: datetime = Field(default_factory=get_utc_time, description="The timestamp when the object was created.")