v1
latestOpenAPI 3.0.22026-07-174617345.8 KBSend a message to a conversation.
Send a message to a conversation within an agent (formerly known as project) identified by its unique projectId and sessionId. This endpoint enables you to send a new message to a specific conversation, facilitating seamless communication and collaboration within the agent. By providing the projectId and sessionId, you can target the desired conversation and contribute to the ongoing discussion. This API endpoint supports real-time streaming, allowing for instant message delivery and dynamic updates which enables efficient and interactive communication between the user and agent. Here is an example to send a message to a conversation: API SDK.
Path parameters
The ID of the agent to get the messages for
The session ID of the converstaions to get the messages for
Query parameters
Whether to stream the response or not, if stream the responses will be sent as data-only server-sent events as they become available, with the stream terminated by a status: "finish" message. Example Python code.
The language to use for the prompt
The external ID of the prompt history.
Request body
Example request
{
"prompt": "Write me hello world program in C",
"custom_persona": "You are a custom AI Agent called *agent name*, a friendly *agent role* who works for *organization* and answers questions based on the given context. Be as helpful as possible. Always prioritize the customer. Escalate complex issues. Stay on topic. Use appropriate language, Acknowledge limitations.",
"chatbot_model": "gpt-4-o",
"response_source": "default"
}Response
Send a message to a conversation
Example response
{
"status": "success",
"data": {
"id": 1,
"user_id": 1,
"user_query": "What is the meaning of life?",
"openai_response": "The meaning of life is to be happy.",
"created_at": "2021-01-01 00:00:00",
"updated_at": "2021-01-01 00:00:00",
"conversation_id": 1,
"citations": [
1,
2,
3
],
"metadata": {
"user_ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)",
"external_id": "ext_id_1234567890",
"request_source": "web"
},
"response_feedback": {
"created_at": "2024-08-27T21:07:20.000000Z",
"updated_at": "2024-08-27T21:07:20.000000Z",
"user_id": 1,
"reaction": "liked"
}
}
}