basalt / ai/src / AnthropicProvider
Class: AnthropicProvider
Defined in: ai/src/provider/anthropic.ts:33
Anthropic Messages API provider — REST directly, no SDK (same approach as the Elasticsearch driver). System messages are hoisted into the top-level system field, as the API requires.
Implements
Constructors
Constructor
> new AnthropicProvider(options): AnthropicProvider
Defined in: ai/src/provider/anthropic.ts:40
Parameters
options
Returns
AnthropicProvider
Properties
model
> readonly model: string
Defined in: ai/src/provider/anthropic.ts:35
Concrete model id in use, e.g. 'claude-sonnet-5'.
Implementation of
name
> readonly name: "anthropic" = 'anthropic'
Defined in: ai/src/provider/anthropic.ts:34
Stable id, e.g. 'anthropic'.
Implementation of
Methods
generate()
> generate(options): Promise<string>
Defined in: ai/src/provider/anthropic.ts:52
One-shot completion — returns the assistant's full text.
Parameters
options
Returns
Promise<string>
Implementation of
stream()
> stream(options): AsyncIterable<string>
Defined in: ai/src/provider/anthropic.ts:89
Streaming completion — yields chunks as they arrive.
Parameters
options
Returns
AsyncIterable<string>