Skip to content

anthropic / Exports / IAnthropicProviderOptions

Interface: IAnthropicProviderOptions

Anthropic provider options

Note: Anthropic API doesn't support response format configuration. JSON output can be requested through prompt instructions.

Hierarchy

Table of contents

Properties

Properties

apiKey

Optional apiKey: string

Anthropic API key (required when client is not provided)

Defined in

anthropic/src/types.ts:38


timeout

Optional timeout: number

API request timeout (milliseconds)

Defined in

anthropic/src/types.ts:43


baseURL

Optional baseURL: string

API base URL

Defined in

anthropic/src/types.ts:48


client

Optional client: Anthropic

Anthropic client instance (optional: will be created from apiKey if not provided)

Defined in

anthropic/src/types.ts:53


executor

Optional executor: IExecutor

Optional executor for handling AI requests

When provided, the provider will delegate all chat operations to this executor instead of making direct API calls. This enables remote execution capabilities.

Example

typescript
import { LocalExecutor, RemoteExecutor } from '@robota-sdk/agent-core';

// Local execution (registers this provider)
const localExecutor = new LocalExecutor();
localExecutor.registerProvider('anthropic', new AnthropicProvider({ apiKey: 'sk-ant-...' }));

// Remote execution
const remoteExecutor = new RemoteExecutor({
  serverUrl: 'https://api.robota.io',
  userApiKey: 'user-token-123',
});

const provider = new AnthropicProvider({
  executor: remoteExecutor, // No direct API key needed
});

Defined in

anthropic/src/types.ts:80

Released under the MIT License.