Skip to main content

Interface: CompletionAttempt

Defined in: packages/agentos/src/api/runtime/completionGateway.ts:155

One provider attempt. outcome settles when iteration ends (a never-iterated attempt never calls the provider).

Extends​

  • AsyncIterable<ModelCompletionResponse>

Properties​

outcome​

outcome: Promise<CompletionOutcome>

Defined in: packages/agentos/src/api/runtime/completionGateway.ts:156


schemaInPayload?​

optional schemaInPayload: boolean

Defined in: packages/agentos/src/api/runtime/completionGateway.ts:168

For an attempt with a response schema: true when the hop's provider payload carries the schema (a strict json_schema, Anthropic's forced schema tool, Gemini's responseSchema), false when the schema reaches the model in the prompt alone (no payload for the provider or model, or a JSON mode without one). Unset for an attempt with no schema. It describes the request that answered: a provider that sends the request again without the schema payload (OpenRouter's json_object retry when no endpoint takes the strict schema) says so on its chunks, and the value turns false, so read it once the attempt's stream has ended.


schemaRoute?​

optional schemaRoute: "none" | "json_schema" | "forced_tool"

Defined in: packages/agentos/src/api/runtime/completionGateway.ts:178

For an attempt with a response schema on an Anthropic hop: the route the hop's request took, as the provider's chunks say it (schemaRoute), else the route of the hop's marker. json_schema (the JSON output format; a text answer that parses is lifted into structuredOutput), forced_tool (a schema tool call whose arguments parse is lifted) or none (the schema rode the prompt; nothing is lifted). Unset on other providers and without a schema; like schemaInPayload, read it once the stream has ended.

Methods​

[asyncIterator]()​

[asyncIterator](): AsyncIterator<ModelCompletionResponse, any, any>

Defined in: apps/agentos-live-docs/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts:38

Returns​

AsyncIterator<ModelCompletionResponse, any, any>

Inherited from​

AsyncIterable.[asyncIterator]