Make reply use the API (#5389)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-28 15:27:28 -04:00
committed by GitHub
parent 35f286a9d1
commit 4034f3fcef
7 changed files with 248 additions and 142 deletions
+145 -1
View File
@@ -1247,7 +1247,14 @@
},
"responses": {
"200": {
"description": "Streaming response initiated"
"description": "Streaming response initiated",
"content": {
"text/event-stream": {
"schema": {
"$ref": "#/components/schemas/MessageEvent"
}
}
}
},
"424": {
"description": "Agent not initialized"
@@ -3172,6 +3179,143 @@
"propertyName": "type"
}
},
"MessageEvent": {
"oneOf": [
{
"type": "object",
"required": [
"message",
"type"
],
"properties": {
"message": {
"$ref": "#/components/schemas/Message"
},
"type": {
"type": "string",
"enum": [
"Message"
]
}
}
},
{
"type": "object",
"required": [
"error",
"type"
],
"properties": {
"error": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"Error"
]
}
}
},
{
"type": "object",
"required": [
"reason",
"type"
],
"properties": {
"reason": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"Finish"
]
}
}
},
{
"type": "object",
"required": [
"model",
"mode",
"type"
],
"properties": {
"mode": {
"type": "string"
},
"model": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"ModelChange"
]
}
}
},
{
"type": "object",
"required": [
"request_id",
"message",
"type"
],
"properties": {
"message": {
"type": "object"
},
"request_id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"Notification"
]
}
}
},
{
"type": "object",
"required": [
"conversation",
"type"
],
"properties": {
"conversation": {
"$ref": "#/components/schemas/Conversation"
},
"type": {
"type": "string",
"enum": [
"UpdateConversation"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Ping"
]
}
}
}
],
"discriminator": {
"propertyName": "type"
}
},
"MessageMetadata": {
"type": "object",
"description": "Metadata for message visibility",