Aller au contenu principal
Version: 3.2.1

Insights

Aperçu

Le message Insights fournit une évaluation détaillée de la performance de l'agent et une analyse du sentiment client. Il utilise plusieurs critères pour évaluer la qualité de conversation sans générer de suggestions IA.

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/insights

Pour pouvoir envoyer des messages, il est nécessaire de s'authentifier d'abord.

Charge Utile de Requête

Le message insights 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.

{
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: {
journeyId: "",
parentId: "",
threadId: "9e8d7c6b-5a49-3827-1605-948372615abc" // REQUIS
},
context: { // autres champs générés par Optave
caseId: "",
departmentId: "",
operatorId: "",
organizationId: "f7e8d9c0-b1a2-3456-7890-123456789abc", // REQUIS
userId: ""
},
reference: {
ids: [
{ name: "", value: "" }
],
labels: [],
tags: []
},
resources: {
codes: [],
links: [],
offers: []
},
scope: {
conversations: [ // REQUIS
{
conversationId: "",
participants: [
{
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
displayName: "Alice Hawthorne",
role: "user"
},
{
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
displayName: "Tom Callahan",
role: "operator"
}
],
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: {}
}
],
interactions: [
{
content: "Support ticket T12345 has been created for user Alice Hawthorne",
id: "1",
name: "ticket_created",
role: "system",
timestamp: "2024-01-15T10:29:45.000Z"
}
]
}
}
}

Réponses

🟢 Succès (200-201)

Lors de l'utilisation du WebSocket, plusieurs critères d'évaluation et analyses de sentiment peuvent être reçus comme des messages séparés. Les réponses peuvent inclure des exemples comme ci-dessous :

{
action: "superpower",
actionType: "performance_criteria",
state: "completed",
message: {
results: [
{
//?
}
]
}
}
{
action: "superpower",
actionType: "sentiment_analysis",
state: "completed",
message: {
results: [
{
//?
}
]
}
}

🔴 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'
}
]
}
]
}
}

curl 
--request POST
--url https://{{tenant}}.oco.optave.{{tld}}/message/insights
--header "Authorization: Bearer your-access-token-here"
--header "Content-Type: application/json"
-d '{
"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": "9e8d7c6b-5a49-3827-1605-948372615abc"
},
"context": {
"organizationId": "f7e8d9c0-b1a2-3456-7890-123456789abc"
},
"scope": {
"conversations": [
{
"conversationId": "7f6e5d4c-3b2a-1098-fedc-ba9876543210",
"participants": [
{
"participantId": "2c4f8a9b-1d3e-5f70-8293-456789012def",
"displayName": "Alice Hawthorne",
"role": "user"
},
{
"participantId": "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
"displayName": "Tom Callahan",
"role": "operator"
}
],
"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: "superpower",
actionType: "<superpower-name>",
state: "completed",
message: {
results: [
{
response: [
{
// Le contenu dépend du superpouvoir
}
]
}
]
}
}