Polyman Documentation - v3.1.0
    Preparing search index...
    • Builds the provider for a chat. The provider and model are, first one wins:

      • provider: provider, then the ai.json default, then OpenRouter.
      • model: model; then the ai.json default model when it is for the same provider; then DEFAULT_CHAT_MODEL for OpenRouter, the first saved model for custom, or the first preset model of the provider.

      secrets holds every known key, for redact.

      It never throws for a missing key, an unknown provider or a broken ai.json: it returns { error } with a message to show the user.

      Parameters

      Returns Promise<ChatProviderResult>