AnthropicLanguageModel
Ai Models
Signature
declare function model(model: unknown, config?: Omit<Service, "model">): Model<"anthropic", LanguageModel, AnthropicClient> Since v1.0.0 Source
Signature
declare function modelWithTokenizer(model: unknown, config?: Omit<Service, "model">): Model<"anthropic", any, AnthropicClient>Configuration
Since 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: unknown;}): Layer<LanguageModel, never, AnthropicClient> Since v1.0.0 Source
Signature
declare function layerWithTokenizer(options: { readonly config?: Omit<Service, "model">; readonly model: unknown;}): Layer<any, never, AnthropicClient>Models
AnthropicTools
type Since v1.0.0 Source
Represents all possible Anthropic provider-defined tools.
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.EncodedSignature
type Model = typeof Generated.Model.EncodedOther
Provider Metadata
Since 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
Since 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>