@toolcog/anthropic
Toolcog Anthropic plugin
References
default
Renames and re-exports anthropic
Interfaces
AnthropicGeneratorConfig
Options for configuring a Generator function.
Note that generator plugins may augment this type with additional options.
Extends
Properties
anthropic?
optionalanthropic:Anthropic|ClientOptions
Inherited from
GeneratorConfig.anthropic
Defined in
packages/plugins/anthropic/src/generator.ts:30
dispatcher?
optionaldispatcher:Dispatcher<DispatcherEvents>
Defined in
packages/plugins/anthropic/src/generator.ts:69
max_tokens?
optionalmax_tokens:number
Inherited from
GeneratorConfig.max_tokens
Defined in
packages/plugins/anthropic/src/generator.ts:32
metadata?
optionalmetadata:Metadata
Inherited from
GeneratorConfig.metadata
Defined in
packages/plugins/anthropic/src/generator.ts:34
model?
optionalmodel:GenerativeModel
The default model the generator should use.
Inherited from
Defined in
packages/framework/core/src/generative.ts:103
stop_sequences?
optionalstop_sequences: readonlystring[]
Inherited from
GeneratorConfig.stop_sequences
Defined in
packages/plugins/anthropic/src/generator.ts:36
stream?
optionalstream:boolean
Whether or not the generator should stream responses by default.
Inherited from
Defined in
packages/framework/core/src/generative.ts:114
system?
optionalsystem:string
The default system prompt the generator should use when generating the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:109
temperature?
optionaltemperature:number
Inherited from
GeneratorConfig.temperature
Defined in
packages/plugins/anthropic/src/generator.ts:38
tools?
optionaltools:null| readonlyToolSource[]
The default set of tools the generator should use.
Inherited from
Defined in
packages/framework/core/src/generative.ts:98
top_k?
optionaltop_k:number
Inherited from
GeneratorConfig.top_k
Defined in
packages/plugins/anthropic/src/generator.ts:40
top_p?
optionaltop_p:number
Inherited from
GeneratorConfig.top_p
Defined in
packages/plugins/anthropic/src/generator.ts:42
AnthropicGeneratorOptions
Options for controlling a Generator call.
Note that generator plugins may augment this type with additional options.
Extends
Properties
anthropic?
optionalanthropic:Anthropic|ClientOptions
Inherited from
GeneratorOptions.anthropic
Defined in
packages/plugins/anthropic/src/generator.ts:46
dispatcher?
optionaldispatcher:Dispatcher<DispatcherEvents>
Defined in
packages/plugins/anthropic/src/generator.ts:73
id?
optionalid:string
Inherited from
Defined in
packages/framework/core/src/generative.ts:123
instructions?
optionalinstructions:InstructionsSource
Instructions the generator should follow when generating the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:138
max_tokens?
optionalmax_tokens:number
Inherited from
GeneratorOptions.max_tokens
Defined in
packages/plugins/anthropic/src/generator.ts:48
metadata?
optionalmetadata:Metadata
Inherited from
GeneratorOptions.metadata
Defined in
packages/plugins/anthropic/src/generator.ts:50
model?
optionalmodel:GenerativeModel
The model the generator should use to generate the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:148
parameters?
optionalparameters:Schema
A schema that describes the arguments to the generator call.
Inherited from
Defined in
packages/framework/core/src/generative.ts:128
returns?
optionalreturns:Schema
A schema that describes the value the generator must generate.
Inherited from
Defined in
packages/framework/core/src/generative.ts:133
signal?
optionalsignal:null|AbortSignal
An abort signal that can be used to cancel the generator call.
Inherited from
Defined in
packages/framework/core/src/generative.ts:163
stop_sequences?
optionalstop_sequences: readonlystring[]
Inherited from
GeneratorOptions.stop_sequences
Defined in
packages/plugins/anthropic/src/generator.ts:52
stream?
optionalstream:boolean
Whether or not the generator should stream responses.
Inherited from
Defined in
packages/framework/core/src/generative.ts:158
system?
optionalsystem:string
The system prompt the generator should use when generating the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:153
temperature?
optionaltemperature:number
Inherited from
GeneratorOptions.temperature
Defined in
packages/plugins/anthropic/src/generator.ts:54
tool_choice?
optionaltool_choice:ToolChoiceAuto|ToolChoiceAny|ToolChoiceTool
Inherited from
GeneratorOptions.tool_choice
Defined in
packages/plugins/anthropic/src/generator.ts:56
tools?
optionaltools:null| readonlyToolSource[]
The tools the generator should use when generating the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:143
top_k?
optionaltop_k:number
Inherited from
GeneratorOptions.top_k
Defined in
packages/plugins/anthropic/src/generator.ts:62
top_p?
optionaltop_p:number
Inherited from
GeneratorOptions.top_p
Defined in
packages/plugins/anthropic/src/generator.ts:64
AnthropicPluginConfig
Extends
ClientOptions
Properties
apiKey?
optionalapiKey:null|string
Defaults to process.env[‘ANTHROPIC_API_KEY’].
Inherited from
ClientOptions.apiKey
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:10
authToken?
optionalauthToken:null|string
Defaults to process.env[‘ANTHROPIC_AUTH_TOKEN’].
Inherited from
ClientOptions.authToken
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:14
baseURL?
optionalbaseURL:null|string
Override the default base URL for the API, e.g., “https://api.example.com/v2/”
Defaults to process.env[‘ANTHROPIC_BASE_URL’].
Inherited from
ClientOptions.baseURL
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:20
dangerouslyAllowBrowser?
optionaldangerouslyAllowBrowser:boolean
By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
Only set this option to true if you understand the risks and have appropriate mitigations in place.
Inherited from
ClientOptions.dangerouslyAllowBrowser
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:68
defaultHeaders?
optionaldefaultHeaders:Headers
Default headers to include with every request to the API.
These can be removed in individual requests by explicitly setting the
header to undefined or null in request options.
Inherited from
ClientOptions.defaultHeaders
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:56
defaultQuery?
optionaldefaultQuery:DefaultQuery
Default query parameters to include with every request to the API.
These can be removed in individual requests by explicitly setting the
param to undefined in request options.
Inherited from
ClientOptions.defaultQuery
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:63
dispatcher?
optionaldispatcher:Dispatcher<DispatcherEvents>
Defined in
packages/plugins/anthropic/src/plugin.ts:11
fetch?
optionalfetch:Fetch
Specify a custom fetch function implementation.
If not provided, we use node-fetch on Node.js and otherwise expect that fetch is
defined globally.
Inherited from
ClientOptions.fetch
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:42
generator?
optionalgenerator:AnthropicGeneratorConfig
Defined in
packages/plugins/anthropic/src/plugin.ts:9
httpAgent?
optionalhttpAgent:Agent
An HTTP agent used to manage HTTP(S) connections.
If not provided, an agent will be constructed by default in the Node.js environment, otherwise no agent is used.
Inherited from
ClientOptions.httpAgent
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:35
maxRetries?
optionalmaxRetries:number
The maximum number of times that the client will retry a request in case of a temporary failure, like a network error or a 5XX error from the server.
Default
2Inherited from
ClientOptions.maxRetries
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:49
timeout?
optionaltimeout:number
The maximum amount of time (in milliseconds) that the client should wait for a response from the server before timing out a single request.
Note that request timeouts are retried by default, so in a worst-case scenario you may wait much longer than this timeout before the promise succeeds or fails.
Inherited from
ClientOptions.timeout
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:28
Functions
anthropic()
anthropic(
config?):Plugin
Parameters
• config?: AnthropicPluginConfig
Returns
Defined in
packages/plugins/anthropic/src/plugin.ts:14
generate()
generate(
args,options?):Promise<unknown>
Parameters
• args: unknown
• options?: AnthropicGeneratorOptions
Returns
Promise<unknown>
Defined in
packages/plugins/anthropic/src/generator.ts:95
generator()
generator(
options?):undefined|Generator
Parameters
• options?: AnthropicGeneratorOptions
Returns
undefined | Generator