AnthropicLanguageModel
Ai Models
Signature
declare function model(
model: any,
config?: Omit<Service, "model">,
): Model<"anthropic", LanguageModel, AnthropicClient>;modelWithTokenizer
Added in v1.0.0
Source
Signature
declare function modelWithTokenizer(
model: any,
config?: Omit<Service, "model">,
): Model<"anthropic", any, AnthropicClient>;Configuration
withConfigOverride
Added in v1.0.0
Source
Signature
declare const withConfigOverride: {
(config: Service): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R>;
<A, E, R>(self: Effect<A, E, R>, config: Service): Effect<A, E, R>;
};Constructors
Context
Layers
Signature
declare function layer(options: {
readonly config?: Omit<Service, "model">;
readonly model: any;
}): Layer<LanguageModel, never, AnthropicClient>;layerWithTokenizer
Added in v1.0.0
Source
Signature
declare function layerWithTokenizer(options: {
readonly config?: Omit<Service, "model">;
readonly model: any;
}): Layer<any, never, AnthropicClient>;Models
AnthropicTools type
Added in v1.0.0
Source
Signature
type AnthropicTools =
| typeof Generated.BetaTool.Encoded
| typeof Generated.BetaBashTool20241022.Encoded
| typeof Generated.BetaBashTool20250124.Encoded
| typeof Generated.BetaComputerUseTool20241022.Encoded
| typeof Generated.BetaComputerUseTool20250124.Encoded
| typeof Generated.BetaTextEditor20241022.Encoded
| typeof Generated.BetaTextEditor20250124.Encoded
| typeof Generated.BetaTextEditor20250429.Encoded
| typeof Generated.BetaTextEditor20250728.Encoded;Signature
type Model = typeof Generated.Model.Encoded;Other
Provider Metadata
AnthropicReasoningInfo type
Added in v1.0.0
Source
Signature
type AnthropicReasoningInfo =
| {
readonly signature: typeof Generated.ResponseThinkingBlock.fields.thinking.Encoded;
readonly type: "thinking";
}
| {
readonly redactedData: typeof Generated.RequestRedactedThinkingBlock.fields.data.Encoded;
readonly type: "redacted_thinking";
};Tool Calling
prepareTools
Added in v1.0.0
Source
A helper method which takes in large language model provider options from the base Effect AI SDK as well as Anthropic request configuration options and returns the prepared tools, tool choice, and Anthropic betas to include in a request.
This method is primarily exposed for use by other Effect provider integrations which can utilize Anthropic models (i.e. Amazon Bedrock).
Signature
declare const prepareTools: (
options: LanguageModel.ProviderOptions,
config: Config.Service,
) => Effect.Effect<
{
readonly betas: ReadonlySet<string>;
readonly toolChoice: typeof Generated.BetaToolChoice.Encoded | undefined;
readonly tools: ReadonlyArray<AnthropicTools> | undefined;
},
AiError.AiError
>;
Represents all possible Anthropic provider-defined tools.