ART Framework API Docs
    Preparing search index...

    Class OpenRouterAdapter

    Adapter for OpenRouter, which acts as a proxy to a wide variety of models.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    providerName: "openrouter" = 'openrouter'

    The unique identifier name for this provider (e.g., 'openai', 'anthropic').

    Methods

    • Executes a call to the configured Large Language Model (LLM). This method is typically implemented by a specific ProviderAdapter. When streaming is requested via options.stream, it returns an AsyncIterable that yields StreamEvent objects as they are generated by the LLM provider. When streaming is not requested, it should still return an AsyncIterable that yields a minimal sequence of events (e.g., a single TOKEN event with the full response, a METADATA event if available, and an END event).

      Parameters

      • prompt: ArtStandardPrompt

        The prompt to send to the LLM, potentially formatted specifically for the provider.

      • options: CallOptions

        Options controlling the LLM call, including mandatory threadId, tracing IDs, model parameters (like temperature), streaming preference, and call context.

      Returns Promise<AsyncIterable<StreamEvent, any, any>>

      A promise resolving to an AsyncIterable of StreamEvent objects.

      If a critical error occurs during the initial call setup or if the stream itself errors out (typically code LLM_PROVIDER_ERROR).