/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { providerConfigsCreateProvider } from "../funcs/provider-configs-create-provider.js"; import { providerConfigsDeleteProvider } from "../funcs/provider-configs-delete-provider.js"; import { providerConfigsGetModelsCatalog } from "../funcs/provider-configs-get-models-catalog.js"; import { providerConfigsGetProvider } from "../funcs/provider-configs-get-provider.js"; import { providerConfigsListAvailableModels } from "../funcs/provider-configs-list-available-models.js"; import { providerConfigsListProviderModels } from "../funcs/provider-configs-list-provider-models.js"; import { providerConfigsListProviders } from "../funcs/provider-configs-list-providers.js"; import { providerConfigsTestProvider } from "../funcs/provider-configs-test-provider.js"; import { providerConfigsUpdateProvider } from "../funcs/provider-configs-update-provider.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class ProviderConfigs extends ClientSDK { /** * List provider configs * * @remarks * Get all provider configurations filtered by scope. API keys are masked in responses. */ async listProviders( request?: operations.ListProvidersRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsListProviders( this, request, options, )); } /** * Create provider config * * @remarks * Create a new provider configuration. The credential is tested against the live provider BEFORE it is persisted — a failed test returns the provider's own error, scrubbed of the submitted secret, and writes no row. On success the API key is encrypted before storage and is never returned in plain text. */ async createProvider( request: models.NameProviderApiKey, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsCreateProvider( this, request, options, )); } /** * List available models * * @remarks * Returns available LLM models based on configured provider types. Uses a static registry - does not call provider APIs. */ async listAvailableModels( options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsListAvailableModels( this, options, )); } /** * Get provider config * * @remarks * Get provider configuration details by ID. API key is masked. */ async getProvider( request: operations.GetProviderRequest, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsGetProvider( this, request, options, )); } /** * Update provider config * * @remarks * Update an existing provider configuration. If API key is provided, it will be re-encrypted. */ async updateProvider( request: operations.UpdateProviderRequest, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsUpdateProvider( this, request, options, )); } /** * Delete provider config * * @remarks * Delete a provider configuration. */ async deleteProvider( request: operations.DeleteProviderRequest, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsDeleteProvider( this, request, options, )); } /** * Get models catalog * * @remarks * Returns the union of static known models and declared provider models for a workspace. Used by the optimizer dropdown. */ async getModelsCatalog( options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsGetModelsCatalog( this, options, )); } /** * List a provider configuration models * * @remarks * The models this provider configuration offers, listed live from the provider and narrowed to the catalog's allow-list policy, with this workspace's per-model enablement applied. When the provider cannot be reached the stored allow-list is returned with `degraded: true` and the reason — an empty list is never presented as 'no models'. */ async listProviderModels( request: operations.ListProviderModelsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsListProviderModels( this, request, options, )); } /** * Test provider connection * * @remarks * Test the connection to the provider using the configured API key. Returns success/failure with details. */ async testProvider( request: operations.TestProviderRequest, options?: RequestOptions, ): Promise { return unwrapAsync(providerConfigsTestProvider( this, request, options, )); } }