Skip to content
Sursa Developers

Objects

ChatRequest

Request for an assistant answer: the latest turns of the conversation, the collection, search settings, the answer mode, export, a limit to specific cards, the conversation, the origin of the question, and tools.

Fields

  • messagesarray of ChatMessagerequired

    items ≥ 1

  • collectionstring

    Default: "default"

  • tagsarray of string | null
  • exportstring | null
  • card_idsarray of string | null

    items ≤ 50

  • streamboolean

    Default: false

  • conversation_idstring | null

    length ≤ 64

  • originstring | null
  • toolsboolean | null
  • bypass_cacheboolean

    Do not take the answer from the answer cache (the “Get a fresh answer” button under a cached answer). The fresh answer replaces the cached entry.

    Default: false

  • languagestring | null

    Answer language: an ISO 639-1 code (de, en, ru, …) to answer in that language. With auto or without the field, the language is detected from the question. The interface passes the language of a suggestion in another language explicitly (Starter.language).

  • scopeChatScope | null

    Scope of the question: several collections, a source, tags and a period. The collections of the scope replace collection. A source narrows the answer to its collection (and its own cards). Tags are added to tags. The period limits financial answers to that period. You can select only what the user can see (collections: collections.no_access/collections.not_found; source: sources.not_found). With conversation_id, the scope is saved in the conversation. Without the field, the conversation's scope applies; null or an empty scope clears it.

  • request_idstring

    Idempotency key of the question. Send the same key in every retry of the stream for one question (a retry after a disconnect; here Last-Event-ID does not continue the stream and is only logged). A retry with the key of an answer that is already saved does not create a second question: the saved result is sent again as one done event (and a token with the text), even if the question or credit limit is exhausted. If the previous answer is still being generated for a disconnected client, that generation stops and the answer is generated anew.

    length ≤ 64

  • version_ofinteger (int64)

    Creates a new version of this question's turn in the conversation (question_id from the feed): an edited question (new text in messages), a regenerated answer (the same text, usually with bypass_cache), or the same question with another quality (for example, precise after a fast answer). The previous question and answer pair is kept. The turns after it stay in its branch and are hidden from the feed while the new version is selected (FeedItem.versions, POST /v1/conversations/{conv_id}/versions). The history used for the answer is the selected branch up to this turn. The quality of a version does not change the conversation's settings. Requires conversation_id; a question from another conversation returns 404 questions.not_found.

  • qualitystring

    Balance between speed and accuracy of the search behind the result: fast is quicker, precise is more accurate. Default: precise.

    Allowed values: fastprecise

Used by