Skip to main content

Interface: ChatRequest<T>

Defined in: packages/client/src/leuria.ts:70

Extends​

Type Parameters​

T​

T = unknown

Properties​

context?​

optional context?: unknown

Defined in: packages/client/src/conversation.ts:86

Values bound to this turn: tools get them as ctx.context, and the model sees them rendered with formatContext, apart from the text.

Inherited from​

SendOptions.context


formatContext?​

optional formatContext?: ContextFormatter

Defined in: packages/client/src/conversation.ts:75

Render a turn's context into the prompt. Default: labeled key/value lines.

Inherited from​

Omit.formatContext


localOnly?​

optional localOnly?: boolean

Defined in: packages/client/src/conversation.ts:58

Only providers that keep data on the visitor's device.

Inherited from​

ConversationOptions.localOnly


maxSteps?​

optional maxSteps?: number

Defined in: packages/client/src/conversation.ts:69

Most tool calls per turn. Default 10.

Inherited from​

Omit.maxSteps


messages?​

optional messages?: MessageInput[]

Defined in: packages/client/src/leuria.ts:74

The conversation so far; the last message must be the user's.


middleware?​

optional middleware?: ToolMiddleware[]

Defined in: packages/client/src/conversation.ts:73

Wrap tool calls: observe, redact, block. Runs after the global middleware.

Inherited from​

Omit.middleware


prompt?​

optional prompt?: string

Defined in: packages/client/src/leuria.ts:76

Shorthand for a single user message.


provider?​

optional provider?: string | string[]

Defined in: packages/client/src/conversation.ts:56

Only these providers, in this order of preference.

Inherited from​

ConversationOptions.provider


schema?​

optional schema?: JsonSchema

Defined in: packages/client/src/conversation.ts:65

JSON Schema for structured output on every turn.

Inherited from​

Omit.schema


signal?​

optional signal?: AbortSignal

Defined in: packages/client/src/conversation.ts:81

Inherited from​

SendOptions.signal


system?​

optional system?: string

Defined in: packages/client/src/conversation.ts:62

Inherited from​

Omit.system


timeoutMs?​

optional timeoutMs?: number

Defined in: packages/client/src/conversation.ts:71

Stop a turn that takes longer than this (the session is kept).

Inherited from​

Omit.timeoutMs


tools?​

optional tools?: ToolDefinition<Record<string, unknown>, unknown>[]

Defined in: packages/client/src/conversation.ts:63

Inherited from​

Omit.tools


validate?​

optional validate?: (value) => T

Defined in: packages/client/src/conversation.ts:67

Validate (and type) the structured output; throw to reject it.

Parameters​

value​

unknown

Returns​

T

Inherited from​

Omit.validate