Skip to content

Interface: ConversationMessageRequest

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ConversationMessageRequest

Defined in: src/types/conversation.ts:15

Request to send a message in a conversation.

The conversation service translates natural language to OSFQL, executes it (with up to 3 self-correction retries on failure), and returns both the generated OSFQL and the results.

Reuse conversationId from a previous response for multi-turn context (pronoun resolution, follow-up queries).

optional constrainedDecode?: boolean | null

Defined in: src/types/conversation.ts:43

Per-request override for constrained-decode repair of a hallucinated query.

false disables the repair — the certify-or-abstain gate just abstains, surfacing the raw model output. true / omitted keep the default (repair when configured). Lets a UI toggle constrained decoding to compare the correction against the raw query. See ConversationMessageResponse.repaired.


optional contextTermIds?: string[]

Defined in: src/types/conversation.ts:86

Records the question is about, by term id. The engine reads at most 8, loads them from this tenant itself and answers from them as retrieved knowledge. An id the tenant does not hold is ignored.


optional conversationId?: string | null

Defined in: src/types/conversation.ts:23

Optional conversation ID to continue an existing conversation. If omitted, a new conversation is created.


optional currentSortContext?: string | null

Defined in: src/types/conversation.ts:29

Optional sort name hint from the current page context.


optional generateCertificate?: boolean

Defined in: src/types/conversation.ts:32

When true, generate a cryptographic validity certificate for this response.


optional includePromptTrace?: boolean

Defined in: src/types/conversation.ts:79

Ask for the privileged ConversationMessageResponse.promptTrace diagnostic.

Honoured only on a deployment that set OSFKB_CONVERSATION_PROMPT_TRACE, for a caller carrying platform_admin. Any other caller that sets it is refused with 403 (a ForbiddenError) before the pipeline runs — on the streaming route too, before the stream opens. An ordinary client never sets it.


optional injection?: InjectionPolicy | null

Defined in: src/types/conversation.ts:66

Adaptive ontology injection for this turn: tier the prompt’s sorts by the model’s parametric coverage κ under a tokenizer-counted budget.

Absent (or null) means blanket injection, the default. When set, the response carries ConversationMessageResponse.injection.


message: string

Defined in: src/types/conversation.ts:17

The user’s natural language message.


optional model?: string | null

Defined in: src/types/conversation.ts:56

Model id selecting which served NL→OSFQL endpoint answers this turn.

Omitted means the server’s default LLM. Drives side-by-side model comparison — one call per model — and is echoed back as ConversationMessageResponse.modelId, which the server populates only when this is set.

The ids come from the compare registry: client.conversation.listModels().


optional queryMode?: ChatQueryMode | null

Defined in: src/types/conversation.ts:95

How a read question becomes a query this turn: text (the model writes OSFQL), frame (the model fills a schema-typed query frame under provider-enforced structured output), or auto (frames wherever the model adapter enforces a schema, else text). Absent: the deployment default (OSFKB_CHAT_QUERY_MODE, itself text unless set).


optional queryModel?: string | null

Defined in: src/types/conversation.ts:101

An internal query translator id (from /api/v1/query-models). Answer generation keeps using the conversation model.


optional sessionId?: string | null

Defined in: src/types/conversation.ts:26

Session ID for session tracking.