Skip to main content

ModelTurnRequest

@forge/monorepo


@forge/monorepo / backend/src / ModelTurnRequest

Type Alias: ModelTurnRequest

ModelTurnRequest = object

Defined in: backend/src/models/streaming.ts:131

Properties

abortSignal?

readonly optional abortSignal?: AbortSignal

Defined in: backend/src/models/streaming.ts:145


maxOutputTokens?

readonly optional maxOutputTokens?: number

Defined in: backend/src/models/streaming.ts:178


maxSteps?

readonly optional maxSteps?: number

Defined in: backend/src/models/streaming.ts:144


messages

readonly messages: readonly TurnMessage[]

Defined in: backend/src/models/streaming.ts:134


model

readonly model: ResolvedModel

Defined in: backend/src/models/streaming.ts:132


modelModalities?

readonly optional modelModalities?: readonly InputModality[]

Defined in: backend/src/models/streaming.ts:142

What the resolved model accepts — #185. Optional, and its absence means "do not check".

Absent rather than defaulting to ["text"], because a caller that has not said what the model takes has not said the model takes text only. Defaulting would refuse every image turn from every caller that has not been updated, which is an outage dressed as a safety check.


promptCaching?

readonly optional promptCaching?: "automatic" | "explicit" | "none"

Defined in: backend/src/models/streaming.ts:177

Where this turn's prompt prefix may be cached, and how — task #247.

"explicit" makes this layer emit the provider's cache directive; "automatic" and "none" emit nothing, for opposite reasons — one needs no help and the other would reject the field. Mapped by the engine from ModelDefinition.capabilities.promptCaching, so a caller that supplies no definition sends nothing, which is the behaviour every existing host already has.


stopSequences?

readonly optional stopSequences?: readonly string[]

Defined in: backend/src/models/streaming.ts:181


structuredOutput?

readonly optional structuredOutput?: object

Defined in: backend/src/models/streaming.ts:168

Ask the model for a value conforming to a schema, rather than prose — task #243.

Neutral on purpose: this layer sits below agents/, so it takes a schema rather than an AgentManifest["responseFormat"]. The engine does the mapping.

The schema must be validatable by this process — see structuredValidator. A bare JSON schema is refused, because the AI SDK's jsonSchema() wrapper leaves validate undefined: it constrains the provider request and checks nothing on the way back, which would make "structured" a request rather than a guarantee. That distinction is the entire point of the task.

schema

readonly schema: unknown


system?

readonly optional system?: string

Defined in: backend/src/models/streaming.ts:133


temperature?

readonly optional temperature?: number

Defined in: backend/src/models/streaming.ts:179


tools?

readonly optional tools?: readonly ModelTurnTool[]

Defined in: backend/src/models/streaming.ts:143


topP?

readonly optional topP?: number

Defined in: backend/src/models/streaming.ts:180