@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?
optional
anthropic:Anthropic
|ClientOptions
Inherited from
GeneratorConfig.anthropic
Defined in
packages/plugins/anthropic/src/generator.ts:30
dispatcher?
optional
dispatcher:Dispatcher
<DispatcherEvents
>
Defined in
packages/plugins/anthropic/src/generator.ts:69
max_tokens?
optional
max_tokens:number
Inherited from
GeneratorConfig.max_tokens
Defined in
packages/plugins/anthropic/src/generator.ts:32
metadata?
optional
metadata:Metadata
Inherited from
GeneratorConfig.metadata
Defined in
packages/plugins/anthropic/src/generator.ts:34
model?
optional
model:GenerativeModel
The default model the generator should use.
Inherited from
Defined in
packages/framework/core/src/generative.ts:103
stop_sequences?
optional
stop_sequences: readonlystring
[]
Inherited from
GeneratorConfig.stop_sequences
Defined in
packages/plugins/anthropic/src/generator.ts:36
stream?
optional
stream:boolean
Whether or not the generator should stream responses by default.
Inherited from
Defined in
packages/framework/core/src/generative.ts:114
system?
optional
system: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?
optional
temperature:number
Inherited from
GeneratorConfig.temperature
Defined in
packages/plugins/anthropic/src/generator.ts:38
tools?
optional
tools:null
| readonlyToolSource
[]
The default set of tools the generator should use.
Inherited from
Defined in
packages/framework/core/src/generative.ts:98
top_k?
optional
top_k:number
Inherited from
GeneratorConfig.top_k
Defined in
packages/plugins/anthropic/src/generator.ts:40
top_p?
optional
top_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?
optional
anthropic:Anthropic
|ClientOptions
Inherited from
GeneratorOptions.anthropic
Defined in
packages/plugins/anthropic/src/generator.ts:46
dispatcher?
optional
dispatcher:Dispatcher
<DispatcherEvents
>
Defined in
packages/plugins/anthropic/src/generator.ts:73
id?
optional
id:string
Inherited from
Defined in
packages/framework/core/src/generative.ts:123
instructions?
optional
instructions:InstructionsSource
Instructions the generator should follow when generating the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:138
max_tokens?
optional
max_tokens:number
Inherited from
GeneratorOptions.max_tokens
Defined in
packages/plugins/anthropic/src/generator.ts:48
metadata?
optional
metadata:Metadata
Inherited from
GeneratorOptions.metadata
Defined in
packages/plugins/anthropic/src/generator.ts:50
model?
optional
model:GenerativeModel
The model the generator should use to generate the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:148
parameters?
optional
parameters:Schema
A schema that describes the arguments to the generator call.
Inherited from
Defined in
packages/framework/core/src/generative.ts:128
returns?
optional
returns:Schema
A schema that describes the value the generator must generate.
Inherited from
Defined in
packages/framework/core/src/generative.ts:133
signal?
optional
signal: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?
optional
stop_sequences: readonlystring
[]
Inherited from
GeneratorOptions.stop_sequences
Defined in
packages/plugins/anthropic/src/generator.ts:52
stream?
optional
stream:boolean
Whether or not the generator should stream responses.
Inherited from
Defined in
packages/framework/core/src/generative.ts:158
system?
optional
system:string
The system prompt the generator should use when generating the response.
Inherited from
Defined in
packages/framework/core/src/generative.ts:153
temperature?
optional
temperature:number
Inherited from
GeneratorOptions.temperature
Defined in
packages/plugins/anthropic/src/generator.ts:54
tool_choice?
optional
tool_choice:ToolChoiceAuto
|ToolChoiceAny
|ToolChoiceTool
Inherited from
GeneratorOptions.tool_choice
Defined in
packages/plugins/anthropic/src/generator.ts:56
tools?
optional
tools: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?
optional
top_k:number
Inherited from
GeneratorOptions.top_k
Defined in
packages/plugins/anthropic/src/generator.ts:62
top_p?
optional
top_p:number
Inherited from
GeneratorOptions.top_p
Defined in
packages/plugins/anthropic/src/generator.ts:64
AnthropicPluginConfig
Extends
ClientOptions
Properties
apiKey?
optional
apiKey: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?
optional
authToken: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?
optional
baseURL: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?
optional
dangerouslyAllowBrowser: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?
optional
defaultHeaders: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?
optional
defaultQuery: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?
optional
dispatcher:Dispatcher
<DispatcherEvents
>
Defined in
packages/plugins/anthropic/src/plugin.ts:11
fetch?
optional
fetch: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?
optional
generator:AnthropicGeneratorConfig
Defined in
packages/plugins/anthropic/src/plugin.ts:9
httpAgent?
optional
httpAgent: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?
optional
maxRetries: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
2
Inherited from
ClientOptions.maxRetries
Defined in
node_modules/.pnpm/@[email protected]/node_modules/@anthropic-ai/sdk/index.d.mts:49
timeout?
optional
timeout: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