Create a conversation
Create a conversation
Chat with Brewit agent.
POST
curl --request POST \
--url https://api.brewit.ai/v2/conversations \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer access-token' \
--data '{
"query": "user query",
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"user_id": 1,
"query": "sales by month",
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "query",
"response": {
"sql": "SELECT month, SUM(net_revenue) FROM sales GROUP BY month",
"explanation": "",
"data": [
{
"month": "January",
"sum_net_revenue": 1000
},
{
"month": "February",
"sum_net_revenue": 2000
}
]
},
"title": "",
"status": "SUCCESS",
"feedback_type": "NEUTRAL",
"feedback_detail": "",
"dataset_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"root_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"last_child_id": null,
"created_at": "2024-01-02T03:04:05.000000",
"updated_at": "2024-01-02T03:04:05.000000"
}
curl --request POST \
--url https://api.brewit.ai/v2/conversations \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer access-token' \
--data '{
"query": "user query",
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"user_id": 1,
"query": "sales by month",
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "query",
"response": {
"sql": "SELECT month, SUM(net_revenue) FROM sales GROUP BY month",
"explanation": "",
"data": [
{
"month": "January",
"sum_net_revenue": 1000
},
{
"month": "February",
"sum_net_revenue": 2000
}
]
},
"title": "",
"status": "SUCCESS",
"feedback_type": "NEUTRAL",
"feedback_detail": "",
"dataset_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"root_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"last_child_id": null,
"created_at": "2024-01-02T03:04:05.000000",
"updated_at": "2024-01-02T03:04:05.000000"
}
Body Parameters
The incoming query from the user. Cannot be empty.
This is the identifier of the dataset to use for the conversation.
This is the identifier of the parent conversation. By providing this, you can continue a conversation from a previous one. If not provided, a new conversation will be created.
Was this page helpful?
curl --request POST \
--url https://api.brewit.ai/v2/conversations \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer access-token' \
--data '{
"query": "user query",
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"user_id": 1,
"query": "sales by month",
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "query",
"response": {
"sql": "SELECT month, SUM(net_revenue) FROM sales GROUP BY month",
"explanation": "",
"data": [
{
"month": "January",
"sum_net_revenue": 1000
},
{
"month": "February",
"sum_net_revenue": 2000
}
]
},
"title": "",
"status": "SUCCESS",
"feedback_type": "NEUTRAL",
"feedback_detail": "",
"dataset_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"root_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"last_child_id": null,
"created_at": "2024-01-02T03:04:05.000000",
"updated_at": "2024-01-02T03:04:05.000000"
}