Interface: ChatRequest<T>
Defined in: packages/client/src/leuria.ts:72
Extends
Omit<ConversationOptions<T>,"messages">.Omit<SendOptions,"timeoutMs">
Type Parameters
T
T = unknown
Properties
context?
optionalcontext?:unknown
Defined in: packages/client/src/conversation.ts:93
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
formatContext?
optionalformatContext?: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?
optionallocalOnly?:boolean
Defined in: packages/client/src/conversation.ts:58
Only providers that keep data on the visitor's device.
Inherited from
maxSteps?
optionalmaxSteps?:number
Defined in: packages/client/src/conversation.ts:69
Most tool calls per turn. Default 10.
Inherited from
Omit.maxSteps
messages?
optionalmessages?:MessageInput[]
Defined in: packages/client/src/leuria.ts:76
The conversation so far; the last message must be the user's.
middleware?
optionalmiddleware?: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?
optionalprompt?:string
Defined in: packages/client/src/leuria.ts:78
Shorthand for a single user message.
provider?
optionalprovider?:string|string[]
Defined in: packages/client/src/conversation.ts:56
Only these providers, in this order of preference.
Inherited from
schema?
optionalschema?:JsonSchema
Defined in: packages/client/src/conversation.ts:65
JSON Schema for structured output on every turn.
Inherited from
Omit.schema
signal?
optionalsignal?:AbortSignal
Defined in: packages/client/src/conversation.ts:88
Inherited from
system?
optionalsystem?:string
Defined in: packages/client/src/conversation.ts:62
Inherited from
Omit.system
timeoutMs?
optionaltimeoutMs?: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?
optionaltools?:ToolDefinition<Record<string,unknown>,unknown>[]
Defined in: packages/client/src/conversation.ts:63
Inherited from
Omit.tools
validate?
optionalvalidate?: (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
withoutTools?
optionalwithoutTools?: (message,options) =>unknown
Defined in: packages/client/src/conversation.ts:84
Lets an AI that can't use tools answer anyway, with less: when no
AI that can use them is ready, one that can't answers, and what this
returns joins the turn's context (e.g. the passages that match the
question, found by the page). Without it, tools are required.
Parameters
message
options
signal
AbortSignal
Returns
unknown
Inherited from
Omit.withoutTools