POST
/
api
/
analytics
/
rag
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 '{
  "filter": {
    "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"
    },
    "rag_type": "chosen_chunks"
  },
  "page": 1,
  "sort_by": "hallucination_score",
  "sort_order": "desc",
  "type": "rag_queries"
}'
{
  "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>",
      "query_rating": {
        "note": "<string>",
        "rating": 123
      },
      "rag_type": "chosen_chunks",
      "results": [
        "<any>"
      ],
      "search_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "top_score": 123,
      "user_id": "<string>",
      "user_message": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Headers

TR-Dataset
string
required

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.

Body

application/json
JSON request payload to filter the graph
type
enum<string>
required
Available options:
rag_queries
filter
object
page
integer | null
Required range: x > 0
sort_by
enum<string>
Available options:
hallucination_score,
top_score,
created_at,
latency
sort_order
enum<string>
Available options:
desc,
asc

Response

200
application/json
The RAG analytics for the dataset
queries
object[]
required