Documentation
    Preparing search index...

    Interface OpenAiAdapterConfig

    Configuration options for initializing OpenAiAdapter.

    interface OpenAiAdapterConfig {
        apiKey: string;
        baseUrl?: string;
        customHeaders?: Record<string, string>;
        defaultModel?: string;
        defaultResponseFormat?:
            | { type: "text"
            | "json_object"
            | "json_schema" }
            | Record<string, unknown>
            | null;
        defaultTemperature?: number;
        timeoutMs?: number;
    }
    Index

    Properties

    apiKey: string

    API secret key for authorization. Must not be empty.

    baseUrl?: string

    Base URL for the OpenAI-compatible API endpoint. Defaults to 'https://api.openai.com/v1'.

    customHeaders?: Record<string, string>

    Additional headers sent with every request (e.g. org ID or custom routing).

    defaultModel?: string

    Default model name to use if not specified in individual calls. Defaults to 'gpt-4o'.

    defaultResponseFormat?:
        | { type: "text"
        | "json_object"
        | "json_schema" }
        | Record<string, unknown>
        | null

    Default response format strategy for structured generation. Defaults to { type: 'json_object' } for remote endpoints, and null (omitted) for local endpoints.

    defaultTemperature?: number

    Default temperature (0.0 to 2.0). Defaults to 0.7.

    timeoutMs?: number

    Request timeout in milliseconds. Defaults to 60000 (60s).