Skip to content
Sursa Developers

Objects

ChatEventError

An error after the stream has started. The stream ends without done, and the question is not saved to the log. When the server instance stops for an update (code = server_restart, retry: true), the answer is marked as canceled and is not generated again, so you can send the same request again unchanged.

Fields

  • type"error"required
  • codeChatErrorCoderequired
  • messagestringrequired
  • retryboolean

    true means the answer did not complete because of the server (the instance stopped for an update, code = server_restart), and you can repeat the request unchanged. Absent for other codes.

  • answer_idstring

    ID of the answer object, if the answer was already created.

  • detailsobject

    Details. For sources_inaccessible and out_of_scope: hidden (the number of unavailable sources), can_request (you can request access with POST /v1/access-requests and answer_id), reason (the same as the event field), and for out_of_scope also collections (a list of CollectionRef where the answer exists). For assistant.unavailable when the assistant is busy (reason rate_limited): retry_after, the pause before a retry in seconds, as in 429 answers.engine_busy before the stream starts. details does not include a previous code of the error.

    Fields
    • hiddeninteger
    • can_requestboolean
    • reasonstring
    • collectionsarray of CollectionRef
    • retry_afterinteger
  • reasonstring

    Reason code for a message in the interface language (extensible, a free-form string). Assistant error codes: timeout, rate_limited, upstream_unavailable, license_blocked, license_restricted, forbidden, canceled, internal, bad_request, conflict, not_found, too_large, unprocessable, not_implemented, server_restart. Sursa codes: engine_unavailable (the assistant is unavailable), engine_closed (the assistant's stream closed without a result), sources_inaccessible, server_restart (the Sursa instance stopped for an update), sources_unavailable (hidden because of deleted or archived sources), out_of_scope (sources exist only outside the selected collection), superseded (with canceled: the answer was replaced by a retry with the same request_id), and awaiting_classification (hidden because the document is still being processed: its access category is not determined yet, the answer becomes available after classification, and access cannot be requested, so can_request = false). Show a message based on the code. For an unknown code, show a generic message based on code; message is only a fallback for clients without translations, and its language is not guaranteed.

Part of

ChatEvent