v1

latestOpenAPI 3.0.3BSL2026-07-17133415718.8 KB
Chunk

Generate suggested queries

This endpoint will generate 3 suggested queries based off a hybrid search using RAG with the query provided in the request body and return them as a JSON object.

post/api/chunk/suggestions

Headers

TR-Datasetstring uuid 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.

Request body

contextstring nullable

Context is the context of the query. This can be any string under 15 words and 200 characters. The context will be used to generate the suggested queries. Defaults to None.

is_ecommerceboolean nullable

Whether of not the suggested queries are being generated for ecommerce.

is_followupboolean nullable

Whether or not the suggested queries are being generated for a followup question. If true, the suggested queries will be generated for a followup question. If false, the suggested queries will be generated for a new question.

querystring nullable

The query to base the generated suggested queries off of using RAG. A hybrid search for 10 chunks from your dataset using this query will be performed and the context of the chunks will be used to generate the suggested queries.

search_type'fulltext' | 'semantic' | 'hybrid' | 'bm25'
suggestion_type'question' | 'keyword' | 'semantic'
suggestions_to_createinteger nullable

The number of suggested queries to create, defaults to 10

Example request

{
  "filters": {
    "must": [
      {
        "field": "tag_set",
        "match_all": [
          "A",
          "B"
        ]
      },
      {
        "field": "num_value",
        "range": {
          "gte": 10,
          "lte": 25
        }
      }
    ]
  }
}

Response

A JSON object containing a list of alternative suggested queries

queriesstring[] required