Theia API Documentation v1.77.0
    Preparing search index...
    interface AnthropicLanguageModelsManager {
        apiKey: string | undefined;
        createOrUpdateLanguageModels(
            ...models: AnthropicModelDescription[],
        ): Promise<void>;
        fetchAvailableModels(): Promise<ModelDiscoveryResult>;
        getApiKeySource(): Promise<ApiKeySource>;
        removeLanguageModels(...modelIds: string[]): void;
        setAllowEnvironmentApiKey(allowed: boolean): void;
        setApiKey(key: string | undefined): void;
        setProxyUrl(proxyUrl: string | undefined): void;
    }

    Implemented by

    Index
    apiKey: string | undefined
    • Fetches the models Anthropic currently offers from its /v1/models endpoint, retrying transient connection failures and persisting a snapshot for offline use.

      Requires an API key. Returns an empty result when no key is configured. On a live-fetch failure it falls back to the cached snapshot (fromCache: true) when one exists, and only throws when there is no cache to fall back to.

      Returns Promise<ModelDiscoveryResult>

    • Allows or refuses the use of an API key found in the environment. Refused by default: an environment key is only used once the user has confirmed it, and setting this back to false stops it being used immediately, wherever it would have been used.

      Parameters

      • allowed: boolean

      Returns void