curl --request POST \
--url https://api.trieve.ai/api/analytics/rag \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TR-Dataset: <tr-dataset>' \
--data '{
"type": "rag_queries",
"filter": {
"component_name": "<string>",
"date_range": {
"gt": "2021-01-01 00:00:00.000",
"gte": "2021-01-01 00:00:00.000",
"lt": "2021-01-01 00:00:00.000",
"lte": "2021-01-01 00:00:00.000"
},
"query": "<string>",
"query_rating": {
"gt": 1,
"gte": 1,
"lt": 1,
"lte": 1
},
"rag_type": "chosen_chunks"
},
"has_clicks": true,
"page": 1,
"sort_by": "hallucination_score",
"sort_order": "desc"
}'{
"queries": [
{
"created_at": "<string>",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"detected_hallucinations": [
"<string>"
],
"hallucination_score": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"llm_response": "<string>",
"rag_type": "chosen_chunks",
"results": [
"<unknown>"
],
"search_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"top_score": 123,
"topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "<string>",
"user_message": "<string>",
"metadata": "<unknown>",
"query_rating": {
"rating": 123,
"metadata": "<unknown>",
"note": "<string>"
}
}
]
}This route allows you to view the RAG analytics for a dataset.
curl --request POST \
--url https://api.trieve.ai/api/analytics/rag \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TR-Dataset: <tr-dataset>' \
--data '{
"type": "rag_queries",
"filter": {
"component_name": "<string>",
"date_range": {
"gt": "2021-01-01 00:00:00.000",
"gte": "2021-01-01 00:00:00.000",
"lt": "2021-01-01 00:00:00.000",
"lte": "2021-01-01 00:00:00.000"
},
"query": "<string>",
"query_rating": {
"gt": 1,
"gte": 1,
"lt": 1,
"lte": 1
},
"rag_type": "chosen_chunks"
},
"has_clicks": true,
"page": 1,
"sort_by": "hallucination_score",
"sort_order": "desc"
}'{
"queries": [
{
"created_at": "<string>",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"detected_hallucinations": [
"<string>"
],
"hallucination_score": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"llm_response": "<string>",
"rag_type": "chosen_chunks",
"results": [
"<unknown>"
],
"search_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"top_score": 123,
"topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "<string>",
"user_message": "<string>",
"metadata": "<unknown>",
"query_rating": {
"rating": 123,
"metadata": "<unknown>",
"note": "<string>"
}
}
]
}The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.
JSON request payload to filter the graph
rag_queries Show child attributes
DateRange is a JSON object which can be used to filter chunks by a range of dates. This leverages the time_stamp field on chunks in your dataset. You can specify this if you want values in a certain range. You must provide ISO 8601 combined date and time without timezone.
{
"gt": "2021-01-01 00:00:00.000",
"gte": "2021-01-01 00:00:00.000",
"lt": "2021-01-01 00:00:00.000",
"lte": "2021-01-01 00:00:00.000"
}{ "gt": 1, "gte": 1, "lt": 1, "lte": 1 }chosen_chunks, all_chunks x >= 0hallucination_score, top_score, created_at desc, asc The RAG analytics for the dataset
Show child attributes
chosen_chunks, all_chunks Was this page helpful?