ModelTurnRequest
@forge/monorepo / backend/src / ModelTurnRequest
Type Alias: ModelTurnRequest
ModelTurnRequest =
object
Defined in: backend/src/models/streaming.ts:131
Properties
abortSignal?
readonlyoptionalabortSignal?:AbortSignal
Defined in: backend/src/models/streaming.ts:145
maxOutputTokens?
readonlyoptionalmaxOutputTokens?:number
Defined in: backend/src/models/streaming.ts:178
maxSteps?
readonlyoptionalmaxSteps?:number
Defined in: backend/src/models/streaming.ts:144
messages
readonlymessages: readonlyTurnMessage[]
Defined in: backend/src/models/streaming.ts:134
model
readonlymodel:ResolvedModel
Defined in: backend/src/models/streaming.ts:132
modelModalities?
readonlyoptionalmodelModalities?: readonlyInputModality[]
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?
readonlyoptionalpromptCaching?:"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?
readonlyoptionalstopSequences?: readonlystring[]
Defined in: backend/src/models/streaming.ts:181
structuredOutput?
readonlyoptionalstructuredOutput?: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
readonlyschema:unknown
system?
readonlyoptionalsystem?:string
Defined in: backend/src/models/streaming.ts:133
temperature?
readonlyoptionaltemperature?:number
Defined in: backend/src/models/streaming.ts:179
tools?
readonlyoptionaltools?: readonlyModelTurnTool[]
Defined in: backend/src/models/streaming.ts:143
topP?
readonlyoptionaltopP?:number
Defined in: backend/src/models/streaming.ts:180