Skip to main content
Version: 2.00

Predicción

Predicción

Enviar mensaje al flujo y obtener respuesta de la IA

post /prediction/{id}

Envía un mensaje a tu flujo y recibe una respuesta generada por la IA. Este es el endpoint principal para interactuar con tus flujos y asistentes.

Authentication: Es posible que se requiera una clave API, dependiendo de la configuración del flujo.

Authorizations
Path parameters
Body
  POST /prediction/{id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 628

{
"question": "What is artificial intelligence?",
"form": {
"title": "Example",
"count": 1
},
"streaming": false,
"overrideConfig": {
"sessionId": "user-session-123",
"temperature": 0.7,
"maxTokens": 500,
"vars": {
"user_name": "Alice"
}
},
"history": [
{
"role": "apiMessage",
"content": "Hello! I'm an AI assistant. How can I help you today?"
},
{
"role": "userMessage",
"content": "Hi, my name is Sarah and I'm learning about AI"
}
],
"uploads": [
{
"type": "file",
"name": "example.png",
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG",
"mime": "image/png"
}
],
"humanInput": {
"type": "reject",
"feedback": "Include more emoji"
}
}