PUT
/
api
/
message
curl --request PUT \
  --url https://api.trieve.ai/api/message \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TR-Dataset: <tr-dataset>' \
  --data '{
  "audio_input": "<string>",
  "concat_user_messages_query": true,
  "context_options": {
    "include_links": true
  },
  "filters": {
    "must": [
      {
        "field": "tag_set",
        "match_all": [
          "A",
          "B"
        ]
      },
      {
        "field": "num_value",
        "range": {
          "gte": 10,
          "lte": 25
        }
      }
    ]
  },
  "highlight_options": {
    "highlight_delimiters": [
      "<string>"
    ],
    "highlight_max_length": 1,
    "highlight_max_num": 1,
    "highlight_results": true,
    "highlight_strategy": "exactmatch",
    "highlight_threshold": 123,
    "highlight_window": 1,
    "post_tag": "<string>",
    "pre_tag": "<string>"
  },
  "image_urls": [
    "<string>"
  ],
  "llm_options": {
    "completion_first": true,
    "frequency_penalty": 123,
    "image_config": {
      "images_per_chunk": 1,
      "use_images": true
    },
    "max_tokens": 1,
    "presence_penalty": 123,
    "stop_tokens": [
      "<string>"
    ],
    "stream_response": true,
    "system_prompt": "<string>",
    "temperature": 123
  },
  "message_sort_order": 123,
  "new_message_content": "<string>",
  "no_result_message": "<string>",
  "only_include_docs_used": true,
  "page_size": 1,
  "score_threshold": 123,
  "search_query": "<string>",
  "search_type": "fulltext",
  "sort_options": {
    "location_bias": {
      "bias": 123,
      "location": {
        "lat": 123,
        "lon": 123
      }
    },
    "mmr": {
      "mmr_lambda": 123,
      "use_mmr": true
    },
    "recency_bias": 123,
    "sort_by": {
      "direction": "desc",
      "field": "<string>",
      "prefetch_amount": 1
    },
    "tag_weights": {},
    "use_weights": true
  },
  "topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "use_group_search": true,
  "user_id": "<string>"
}'
This response has no body data.

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 edit a message and get a new stream
message_sort_order
integer
required

The sort order of the message to edit.

topic_id
string
required

The id of the topic to edit the message at the given sort order for.

audio_input
string | null

The base64 encoded audio input of the user message to attach to the topic and then generate an assistant message in response to.

concat_user_messages_query
boolean | null

If concat user messages query is set to true, all of the user messages in the topic will be concatenated together and used as the search query. If not specified, this defaults to false. Default is false.

context_options
object

Context options to use for the completion. If not specified, all options will default to false.

filters
object

ChunkFilter is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata.

highlight_options
object

Highlight Options lets you specify different methods to highlight the chunks in the result set. If not specified, this defaults to the score of the chunks.

image_urls
string[] | null

The URL of the image(s) to attach to the message.

llm_options
object

LLM options to use for the completion. If not specified, this defaults to the dataset's LLM options.

new_message_content
string | null

The new content of the message to replace the old content with.

no_result_message
string | null

No result message for when there are no chunks found above the score threshold.

only_include_docs_used
boolean | null

Only include docs used in the completion. If not specified, this defaults to false.

page_size
integer | null

Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None.

Required range: x > 0
score_threshold
number | null

Set score_threshold to a float to filter out chunks with a score below the threshold. This threshold applies before weight and bias modifications. If not specified, this defaults to 0.0.

search_query
string | null

Query is the search query. This can be any string. The search_query will be used to create a dense embedding vector and/or sparse vector which will be used to find the result set. If not specified, will default to the last user message or HyDE if HyDE is enabled in the dataset configuration. Default is None.

search_type
enum<string>
Available options:
fulltext,
semantic,
hybrid,
bm25
sort_options
object

Sort Options lets you specify different methods to rerank the chunks in the result set. If not specified, this defaults to the score of the chunks.

user_id
string | null

The user_id is the id of the user who is making the request. This is used to track user interactions with the RAG results.