Polyman Documentation - v3.1.0
    Preparing search index...

    Interface MockStep

    One model turn in a mock script. Each stream() call plays the next step.

    Events come in this order: reasoning_delta, text_delta, one tool_call per call (toolCall first, then toolCalls), usage, done. A field that is not set gives no event.

    interface MockStep {
        reasoning?: string;
        text?: string;
        toolCall?: MockToolCall;
        toolCalls?: MockToolCall[];
        usage?: MockUsage;
        stopReason?: "end" | "tool_calls" | "max_tokens" | "content_filter";
        error?: ProviderError;
    }
    Index
    reasoning?: string

    Reasoning text, sent as one reasoning_delta.

    text?: string

    Answer text, sent as one text_delta.

    toolCall?: MockToolCall

    One tool call.

    toolCalls?: MockToolCall[]

    More tool calls in the same turn.

    usage?: MockUsage

    Token counts. No usage event when not set.

    stopReason?: "end" | "tool_calls" | "max_tokens" | "content_filter"

    Defaults to tool_calls when the step has tool calls, else end.

    Thrown after the reasoning, text and tool calls, in place of usage and done. A step with only an error fails before the first event, like a failed HTTP request. A step with text and an error is a stream that broke in the middle.