proposit-core
    Preparing search index...

    Type Alias TLlmRequest<T>

    type TLlmRequest<T> = {
        _typeMarker?: T;
        maxOutputTokens?: number;
        model: string;
        onResponseCreated?: (responseId: string) => void;
        outputSchema: TSchema;
        previousResponseId?: TResponseId;
        reasoningEffort?: TReasoningEffort;
        signal?: AbortSignal;
        systemPrompt: string;
        tools?: readonly TToolSpec[];
        userMessage: string;
    }

    Type Parameters

    • T
    Index

    Properties

    _typeMarker?: T

    Phantom field that carries the structured-output type T from outputSchema into the response. Always undefined at runtime.

    maxOutputTokens?: number
    model: string

    Free-form for forward-compat. The known set is TLlmModel.

    onResponseCreated?: (responseId: string) => void

    Optional callback fired by a provider as soon as the upstream response id is known — before the call resolves. Lets a caller persist the id mid-flight so an interrupted in-flight call can be recovered from the upstream's stored copy.

    Only providers that can surface an id mid-flight invoke it (the OpenAI provider in background-stream mode, from the first response.created SSE event). Synchronous providers leave it uncalled and surface the id only at completion via TLlmResponse.rawResponseId. Optional + backward-compatible: callers that don't set it are unaffected. Invoked at most once per provider call (per attempt).

    outputSchema: TSchema
    previousResponseId?: TResponseId

    The provider response id to chain this request against. When set, the provider should continue from the specified prior response rather than starting a fresh conversation. Only meaningful for providers that support response chaining (e.g. the OpenAI Responses API). Synchronous providers (e.g. chat-completions) ignore this field — the caller folds the transcript into userMessage instead. Optional + backward-compatible.

    reasoningEffort?: TReasoningEffort
    signal?: AbortSignal
    systemPrompt: string
    tools?: readonly TToolSpec[]
    userMessage: string