Résumer
Aperçu
Le message Résumer condense les conversations en résumés concis pour améliorer la compréhension de contextes spécifiques.
Référence API
Point de Terminaison
- URL WebSocket :
wss://ws-{{tenant}}.oco.optave.{{tld}} - Point de Terminaison REST (POST) :
https://{{tenant}}.oco.optave.{{tld}}/message/summarize
Pour pouvoir envoyer des messages, il est nécessaire de s'authentifier d'abord.
Payload de requête
Le message summarize requiert un payload contenant l'historique de conversation (conversations), connections.threadId, et context.organizationId (l'identifiant d'organisation spécifique à votre client). Les autres champs sont optionnels.
- REST
- WebSocket
{
session: {
sessionId: "a1b2c3d4-e5f6-7890-abcd-123456789012",
channel: { language: "en-US" },
interface: { type: "chat" }
},
request: {
requestId: "a1b2c3d4-e5f6-7890-1234-56789ab2345",
attributes: {
variant: "A"
},
connections: {
threadId: "9e8d3c6b-5a4f-3e2d-1c0b-0987654321ab" // REQUIS
},
context: { // généré par optave
organizationId: "f7e8d9c0-b1a2-3456-7890-123456789abc" // REQUIS
},
scope: {
conversations: [ // REQUIS
{
conversationId: "",
participants: [
{
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
role: "user",
displayName: "Alice Hawthorne"
},
{
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
role: "operator",
displayName: "Tom Callahan"
}
],
messages: [
{
content: "My flight was cancelled and I need to rebook",
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
timestamp: "2024-01-15T10:30:00.000Z"
},
{
content: "I understand this is frustrating. Let me help you with rebooking your flight. Could you please provide your booking reference?",
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
timestamp: "2024-01-15T10:30:30.000Z"
},
{
content: "Sure, it is XYZ789",
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
timestamp: "2024-01-15T10:31:00.000Z"
}
],
metadata: {}
}
]
}
}
}
{
headers: {
correlationId: "20e35101-61e8-46e0-926d-6af84b378d95",
tenantId: "6e3j5hdgemmjmoqih5u9b4mmqhrr",
traceId: "405101-61e8-46e0-926d-6af84b378d95",
idempotencyKey: "30e35101-61e8-46e0-926d-6af84b378d95",
identifier: "message",
action: "summarize",
schemaRef: "optave.message.v3",
sdkVersion: "3.2.1",
timestamp: "2025-09-05T16:30:00.000Z"
},
payload: {
session: {
sessionId: "a1b2c3d4-e5f6-7890-abcd-123456789012",
channel: { language: "en-US" },
interface: { type: "chat" }
},
request: {
requestId: "a1b2c3d4-e5f6-7890-1234-56789ab2345",
attributes: {
variant: "A"
},
connections: {
threadId: "9e8d3c6b-5a4f-3e2d-1c0b-0987654321ab" // REQUIS
},
context: { // généré par optave
organizationId: "f7e8d9c0-b1a2-3456-7890-123456789abc" // REQUIS
},
scope: {
conversations: [ // REQUIS
{
conversationId: "",
participants: [
{
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
role: "user",
displayName: "Alice Hawthorne"
},
{
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
role: "operator",
displayName: "Tom Callahan"
}
],
messages: [
{
content: "My flight was cancelled and I need to rebook",
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
timestamp: "2024-01-15T10:30:00.000Z"
},
{
content: "I understand this is frustrating. Let me help you with rebooking your flight. Could you please provide your booking reference?",
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
timestamp: "2024-01-15T10:30:30.000Z"
},
{
content: "Sure, it is XYZ789",
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
timestamp: "2024-01-15T10:31:00.000Z"
}
],
metadata: {}
}
]
}
}
},
action: "message"
}
Réponses
🟢 Succès (200-201)
La réponse consiste en un superpouvoir summarize.
{
action: "superpower",
actionType: "summarize",
state: "completed",
message: {
results: [
{
response: [
{
content: "I need some help booking a ticket for the helicopter flight"
}
]
}
]
}
}
🔴 Erreur
Les messages d'erreur sont similaires en format aux messages de succès, mais contiennent un état d'erreur et un objet JSON "response" :
{
action: "superpower",
actionType: "<superpower-name>",
state: "error",
message: {
results: [
{
response: [
{
content: 'Erreur lors de la récupération des résultats'
}
]
}
]
}
}