Create Agent Response Log
POST
/v2/api/agent/{agent_id}/response/log
Agent Response
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v2/api/agent//response/log' \
--header 'Content-Type: application/json' \
--data-raw '{
"chat_thread_id": 4354,
"user_id": 147,
"question": "Can you tell me how RAG works from the sources given?",
"response": {
"query": "Explain how Retrieval-Augmented Generation (RAG) works.",
"answer": "Retrieval-Augmented Generation (RAG) is a technique in natural language processing that enhances the capabilities of generative language models by integrating real-time data retrieval...\n",
"run_id": "bb7b49f8-fa06-4504-9e39-dec8f10cb0b9",
"history": [
{
"bot": "Hello! How can I assist you today?",
"user": "hi"
}
],
"indexes": [
0
],
"sources": "[0]",
"success": true,
"thoughts": "",
"cache_hit": false,
"agent_mode": "QnA",
"corpus_ids": [
645
],
"references": [
{
"url": "Introduction to RAG1738098993.txt",
"order": 1,
"number": 0
}
],
"data_points": [
{}
],
"instructions": [
""
],
"total_tokens": 4809,
"prompt_prefix": "You are an AI assistant specializing in providing legal advice...",
"prompt_tokens": 4329,
"completion_tokens": 480,
"followup_questions": [
"What are the components involved in the RAG process?",
"How does RAG ensure responses are contextually appropriate?",
"In what domains is RAG particularly useful?"
]
},
"total_tokens": 4809,
"prompt_tokens": 4329,
"completion_tokens": 480,
"created_by": "user@example.com",
"cache_hit": false,
"query_source": "web",
"llm_config_id": 8
}'
Response Response Example
201 - Example 1
{
"success": true,
"message": "Response Log Created Successfully.",
"data": {
"id": 25248,
"question": "Can you tell me how RAG works from the sources given?",
"response": {
"query": "Explain how Retrieval-Augmented Generation (RAG) works.",
"answer": "Retrieval-Augmented Generation (RAG) is a technique in natural language processing that enhances the capabilities of generative language models by integrating real-time data retrieval...\n",
"run_id": "bb7b49f8-fa06-4504-9e39-dec8f10cb0b9",
"history": [
{
"bot": "Hello! How can I assist you today?",
"user": "hi"
}
],
"indexes": [
0
],
"sources": "[0]",
"success": true,
"thoughts": "",
"cache_hit": false,
"agent_mode": "QnA",
"corpus_ids": [
645
],
"references": [
{
"url": "Introduction to RAG1738098993.txt",
"order": 1,
"number": 0
}
],
"data_points": [
{}
],
"instructions": [
"string"
],
"total_tokens": 4809,
"prompt_prefix": "You are an AI assistant specializing in providing legal advice...",
"prompt_tokens": 4329,
"completion_tokens": 480,
"followup_questions": [
"string"
]
},
"created_by": "user@example.com",
"created_on": "2025-04-04T18:32:35.981741Z",
"is_deleted": false,
"total_tokens": 4809,
"prompt_tokens": 4329,
"completion_tokens": 480,
"cache_hit": false,
"query_source": "web",
"message_id": null,
"cost": "0.02404",
"pinned": false,
"chat_thread": 4354,
"agent": 1297,
"user": 147,
"llm_config": 8
}
}
Request
Path Params
agent_id
integerÂ
required
Example:
1297
Body Params application/json