Create Agent Response
POST
/v2/api/agent/{agent_id}/response
Agent Response
How This Endpoint Works
agent_id
as a path parameter to specify which agent should generate the response.Request Body Details
gpt4-o
) to be used for generating responses.web
)Viewing Your Agent ID
agent_id
, refer to this guide:How to View Your Agent ID
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v2/api/agent//response' \
--header 'Content-Type: application/json' \
--data-raw '{
"history": [
{
"user": "hi",
"bot": "Hello! How can I assist you today?"
},
{
"user": "Can you tell me about RAG from the sources?"
}
],
"model": "gpt4-o",
"chat_thread_id": 4329,
"overrides": {
"sources": true
},
"query_source": "web"
}'
Response Response Example
{
"success": true,
"message": "Agent Response Created Successfully.",
"data": {
"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. This approach addresses the limitations of traditional generative models, which rely solely on their training data and may produce outdated or incorrect information if the data is not current. RAG ensures that the responses generated are both contextually appropriate and grounded in factual information by incorporating real-time data from external sources.",
"sources": "[0]",
"followup_questions": [
"string"
],
"indexes": [
"string"
],
"query": "Explain how Retrieval-Augmented Generation (RAG) works.",
"total_tokens": 4809,
"prompt_tokens": 4329,
"completion_tokens": 480,
"cache_hit": false,
"history": [
{
"user": "string",
"bot": "string"
}
],
"prompt_prefix": "You are an AI assistant specializing in providing legal advice on regulatory requirements, compliance issues, and legal barriers to market entry.",
"instructions": [
"string"
],
"agent_mode": "QnA",
"references": [
{
"number": 0,
"url": "Introduction to RAG1738098993.txt",
"order": 1
}
],
"success": true,
"corpus_ids": [
645
],
"run_id": "bb7b49f8-fa06-4504-9e39-dec8f10cb0b9",
"chat_thread_name": "RAG Process",
"thread_id": 4354,
"agent_response_id": 10954
}
}
Request
Path Params
agent_id
integerÂ
required
Body Params application/json