@agentxin-ai/plugin-anthropic 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # AgentXin Plugin: Anthropic
2
+
3
+ ## Overview
4
+
5
+ `@agentxin-ai/plugin-anthropic` provides a model adapter for connecting Anthropic's Claude models to the [AgentXinAI](https://github.com/agentxin-ai/agentxin) platform. The plugin enables agents to invoke Claude series models with support for streaming, tool calling, and vision capabilities within a unified AgentXinAI agentic workflow.
6
+
7
+ ## Core Features
8
+
9
+ - Provides the `AnthropicPlugin` NestJS module, which automatically registers model providers, lifecycle logging, and configuration validation logic.
10
+ - Wraps Anthropic's Claude models as AgentXinAI's `LargeLanguageModel` via `AnthropicLargeLanguageModel`, supporting function calling (tool use), streaming output, and agent token statistics.
11
+ - Supports vision capabilities for vision-enabled Claude models.
12
+ - Integrates seamlessly with AgentXinAI's agent workflow system.
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @agentxin-ai/plugin-anthropic
18
+ ```
19
+
20
+ > **Peer Dependencies**: The host project must also provide libraries such as `@agentxin-ai/plugin-sdk`, `@nestjs/common`, `@nestjs/config`, `@metad/contracts`, `@langchain/anthropic`, `chalk`, and `zod`. Please refer to `package.json` for version requirements.
21
+
22
+ ## Enabling in AgentXinAI
23
+
24
+ 1. Add the plugin package to your system dependencies and ensure it is resolvable by Node.js.
25
+ 2. Before starting the service, declare the plugin in your environment variables:
26
+ ```bash
27
+ PLUGINS=@agentxin-ai/plugin-anthropic
28
+ ```
29
+ 3. Add a new model provider in the AgentXinAI admin interface or configuration file, and select `anthropic`.
30
+
31
+ ## Credentials & Model Configuration
32
+
33
+ The form fields defined in `anthropic.yaml` cover common Anthropic deployment scenarios:
34
+
35
+ - **API Key**: Your Anthropic API key (required)
36
+ - **Model Name**: The Claude model identifier (e.g., `claude-sonnet-4-6`, `claude-opus-4-6`, `claude-haiku-4-5`)
37
+ - **Context Size**: Maximum context window size (default: 200000)
38
+ - **Max Tokens**: Maximum tokens to generate (default: 4096)
39
+ - **Function Calling**: Enable/disable tool calling support
40
+ - **Vision Support**: Enable/disable vision capabilities
41
+ - **Streaming**: Enable/disable streaming output
42
+
43
+ ## Supported Model Types
44
+
45
+ - **Large Language Models (LLM)**: Claude series models with support for:
46
+ - Conversational interactions
47
+ - Tool calling (function calling)
48
+ - Streaming output
49
+ - Vision capabilities (for vision-enabled models)
50
+
51
+ ## Model Examples
52
+
53
+ Common Claude model identifiers:
54
+
55
+ - `claude-sonnet-4-6` - Latest Claude Sonnet 4.6
56
+ - `claude-opus-4-6` - Latest Claude Opus 4.6
57
+ - `claude-haiku-4-5` - Latest Claude Haiku 4.5
58
+
59
+ The plugin supports all available Claude models from Anthropic. You can use any valid model identifier from the Anthropic API. For the latest model list, refer to [Anthropic's documentation](https://docs.anthropic.com/claude/docs/models-overview).
60
+
61
+ ## Configuration Example
62
+
63
+ When configuring a model provider in AgentXinAI:
64
+
65
+ 1. Select provider type: `anthropic`
66
+ 2. Enter your Anthropic API key
67
+ 3. Specify the model name (e.g., `claude-sonnet-4-6`)
68
+ 4. Set context size (default: 200000)
69
+ 5. Configure max tokens (default: 4096)
70
+ 6. Enable/disable features as needed:
71
+ - Function calling: `tool_call`
72
+ - Vision support: `support`
73
+ - Streaming: `supported`
74
+
75
+ ## Development
76
+
77
+ This plugin is built using:
78
+
79
+ - TypeScript
80
+ - NestJS
81
+ - LangChain Anthropic SDK
82
+ - AgentXinAI Plugin SDK
83
+
84
+ ## License
85
+
86
+ See the main repository LICENSE file.
Binary file
@@ -0,0 +1,78 @@
1
+ <svg width="90" height="20" viewBox="0 0 90 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_8587_60274)">
3
+ <mask id="mask0_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
4
+ <path d="M89.375 4.99805H0V14.998H89.375V4.99805Z" fill="white"/>
5
+ </mask>
6
+ <g mask="url(#mask0_8587_60274)">
7
+ <mask id="mask1_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
8
+ <path d="M0 4.99609H89.375V14.9961H0V4.99609Z" fill="white"/>
9
+ </mask>
10
+ <g mask="url(#mask1_8587_60274)">
11
+ <mask id="mask2_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
12
+ <path d="M0 4.99414H89.375V14.9941H0V4.99414Z" fill="white"/>
13
+ </mask>
14
+ <g mask="url(#mask2_8587_60274)">
15
+ <mask id="mask3_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
16
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
17
+ </mask>
18
+ <g mask="url(#mask3_8587_60274)">
19
+ <path d="M18.1273 11.9244L13.7773 5.15625H11.4297V14.825H13.4321V8.05688L17.7821 14.825H20.1297V5.15625H18.1273V11.9244Z" fill="black" fill-opacity="0.92"/>
20
+ </g>
21
+ <mask id="mask4_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
22
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
23
+ </mask>
24
+ <g mask="url(#mask4_8587_60274)">
25
+ <path d="M21.7969 7.02094H25.0423V14.825H27.1139V7.02094H30.3594V5.15625H21.7969V7.02094Z" fill="black" fill-opacity="0.92"/>
26
+ </g>
27
+ <mask id="mask5_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
28
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
29
+ </mask>
30
+ <g mask="url(#mask5_8587_60274)">
31
+ <path d="M38.6442 9.00994H34.0871V5.15625H32.0156V14.825H34.0871V10.8746H38.6442V14.825H40.7156V5.15625H38.6442V9.00994Z" fill="black" fill-opacity="0.92"/>
32
+ </g>
33
+ <mask id="mask6_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
34
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
35
+ </mask>
36
+ <g mask="url(#mask6_8587_60274)">
37
+ <path d="M45.3376 7.02094H47.893C48.9152 7.02094 49.4539 7.39387 49.4539 8.09831C49.4539 8.80275 48.9152 9.17569 47.893 9.17569H45.3376V7.02094ZM51.5259 8.09831C51.5259 6.27506 50.186 5.15625 47.9897 5.15625H43.2656V14.825H45.3376V11.0404H47.6443L49.7164 14.825H52.0094L49.715 10.7521C50.8666 10.3094 51.5259 9.37721 51.5259 8.09831Z" fill="black" fill-opacity="0.92"/>
38
+ </g>
39
+ <mask id="mask7_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
40
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
41
+ </mask>
42
+ <g mask="url(#mask7_8587_60274)">
43
+ <path d="M57.8732 13.0565C56.2438 13.0565 55.2496 11.8963 55.2496 10.004C55.2496 8.08416 56.2438 6.92394 57.8732 6.92394C59.4887 6.92394 60.4691 8.08416 60.4691 10.004C60.4691 11.8963 59.4887 13.0565 57.8732 13.0565ZM57.8732 4.99023C55.0839 4.99023 53.1094 7.06206 53.1094 10.004C53.1094 12.9184 55.0839 14.9902 57.8732 14.9902C60.6486 14.9902 62.6094 12.9184 62.6094 10.004C62.6094 7.06206 60.6486 4.99023 57.8732 4.99023Z" fill="black" fill-opacity="0.92"/>
44
+ </g>
45
+ <mask id="mask8_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
46
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
47
+ </mask>
48
+ <g mask="url(#mask8_8587_60274)">
49
+ <path d="M69.1794 9.45194H66.6233V7.02094H69.1794C70.2019 7.02094 70.7407 7.43532 70.7407 8.23644C70.7407 9.03756 70.2019 9.45194 69.1794 9.45194ZM69.2762 5.15625H64.5508V14.825H66.6233V11.3166H69.2762C71.473 11.3166 72.8133 10.1564 72.8133 8.23644C72.8133 6.3165 71.473 5.15625 69.2762 5.15625Z" fill="black" fill-opacity="0.92"/>
50
+ </g>
51
+ <mask id="mask9_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
52
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
53
+ </mask>
54
+ <g mask="url(#mask9_8587_60274)">
55
+ <path d="M86.8413 11.5786C86.4823 12.5179 85.7642 13.0565 84.7837 13.0565C83.1542 13.0565 82.16 11.8963 82.16 10.004C82.16 8.08416 83.1542 6.92394 84.7837 6.92394C85.7642 6.92394 86.4823 7.46261 86.8413 8.40183H89.0369C88.4984 6.33002 86.8827 4.99023 84.7837 4.99023C81.9942 4.99023 80.0195 7.06206 80.0195 10.004C80.0195 12.9184 81.9942 14.9902 84.7837 14.9902C86.8965 14.9902 88.5122 13.6366 89.0508 11.5786H86.8413Z" fill="black" fill-opacity="0.92"/>
56
+ </g>
57
+ <mask id="mask10_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
58
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
59
+ </mask>
60
+ <g mask="url(#mask10_8587_60274)">
61
+ <path d="M73.6484 5.15625L77.5033 14.825H79.6172L75.7624 5.15625H73.6484Z" fill="black" fill-opacity="0.92"/>
62
+ </g>
63
+ <mask id="mask11_8587_60274" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="4" width="90" height="11">
64
+ <path d="M0 4.99219H89.375V14.9922H0V4.99219Z" fill="white"/>
65
+ </mask>
66
+ <g mask="url(#mask11_8587_60274)">
67
+ <path d="M3.64038 10.9989L4.95938 7.60106L6.27838 10.9989H3.64038ZM3.85422 5.15625L0 14.825H2.15505L2.9433 12.7946H6.97558L7.76371 14.825H9.91875L6.06453 5.15625H3.85422Z" fill="black" fill-opacity="0.92"/>
68
+ </g>
69
+ </g>
70
+ </g>
71
+ </g>
72
+ </g>
73
+ <defs>
74
+ <clipPath id="clip0_8587_60274">
75
+ <rect width="89.375" height="10" fill="white" transform="translate(0 5)"/>
76
+ </clipPath>
77
+ </defs>
78
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="24" height="24" rx="6" fill="#CA9F7B"/>
3
+ <path d="M15.3843 6.43481H12.9687L17.3739 17.5652H19.7896L15.3843 6.43481ZM8.40522 6.43481L4 17.5652H6.4633L7.36417 15.2279H11.9729L12.8737 17.5652H15.337L10.9318 6.43481H8.40522ZM8.16104 13.1607L9.66852 9.24907L11.176 13.1607H8.16104Z" fill="#191918"/>
4
+ </svg>
@@ -0,0 +1,44 @@
1
+ background: '#F0F0EB'
2
+ configurate_methods:
3
+ - predefined-model
4
+ description:
5
+ en_US: Anthropic’s powerful models, such as Claude 3.
6
+ zh_Hans: Anthropic 的强大模型,例如 Claude 3。
7
+ help:
8
+ title:
9
+ en_US: Get your API Key from Anthropic
10
+ zh_Hans: 从 Anthropic 获取 API Key
11
+ url:
12
+ en_US: https://console.anthropic.com/account/keys
13
+ icon_large:
14
+ en_US: icon_l_en.png
15
+ icon_small:
16
+ en_US: icon_s_en.svg
17
+ label:
18
+ en_US: Anthropic
19
+ models:
20
+ llm:
21
+ position: models/llm/_position.yaml
22
+ predefined:
23
+ - models/llm/*.yaml
24
+ provider: anthropic
25
+ provider_credential_schema:
26
+ credential_form_schemas:
27
+ - label:
28
+ en_US: API Key
29
+ placeholder:
30
+ en_US: Enter your API Key
31
+ zh_Hans: 在此输入您的 API Key
32
+ required: true
33
+ type: secret-input
34
+ variable: anthropic_api_key
35
+ - label:
36
+ en_US: API URL
37
+ placeholder:
38
+ en_US: Enter your API URL
39
+ zh_Hans: 在此输入您的 API URL
40
+ required: false
41
+ type: text-input
42
+ variable: anthropic_api_url
43
+ supported_model_types:
44
+ - llm
@@ -0,0 +1,3 @@
1
+ - claude-sonnet-4-6
2
+ - claude-opus-4-6
3
+ - claude-haiku-4-5
@@ -0,0 +1,120 @@
1
+ model: claude-haiku-4-5
2
+ label:
3
+ en_US: claude-haiku-4-5
4
+ model_type: llm
5
+ features:
6
+ - agent-thought
7
+ - vision
8
+ - tool-call
9
+ - stream-tool-call
10
+ - document
11
+ model_properties:
12
+ mode: chat
13
+ context_size: 200000
14
+ parameter_rules:
15
+ - name: thinking
16
+ label:
17
+ zh_Hans: 推理模式
18
+ en_US: Thinking Mode
19
+ type: boolean
20
+ default: false
21
+ required: false
22
+ help:
23
+ zh_Hans: 控制模型的推理能力。启用时,temperature、top_p和top_k将被禁用。
24
+ en_US: Controls the model's thinking capability. When enabled, temperature, top_p and top_k will be disabled.
25
+ - name: thinking_budget
26
+ label:
27
+ zh_Hans: 推理预算
28
+ en_US: Thinking Budget
29
+ type: int
30
+ default: 1024
31
+ min: 1024
32
+ max: 64000
33
+ required: false
34
+ help:
35
+ zh_Hans: 推理的预算限制(最小1024),必须小于max_tokens。仅在推理模式启用时可用。
36
+ en_US: Budget limit for thinking (minimum 1024), must be less than max_tokens. Only available when thinking mode is enabled.
37
+ - name: temperature
38
+ use_template: temperature
39
+ - name: top_p
40
+ use_template: top_p
41
+ - name: top_k
42
+ label:
43
+ zh_Hans: 取样数量
44
+ en_US: Top k
45
+ type: int
46
+ help:
47
+ zh_Hans: 仅从每个后续标记的前 K 个选项中采样。
48
+ en_US: Only sample from the top K options for each subsequent token.
49
+ required: false
50
+ - name: max_tokens
51
+ use_template: max_tokens
52
+ required: true
53
+ default: 64000
54
+ min: 1
55
+ max: 64000
56
+ - name: prompt_caching_message_flow
57
+ label:
58
+ zh_Hans: 大消息自动缓存阈值
59
+ en_US: Cache Message Flow Threshold
60
+ type: int
61
+ default: 0
62
+ required: false
63
+ help:
64
+ zh_Hans: 当用户或助手消息的单词数超过此阈值时,自动为该消息添加缓存控制。0 表示禁用。
65
+ en_US: If a user or assistant message exceeds this word count, add cache_control automatically. 0 disables the feature.
66
+ - name: prompt_caching_system_message
67
+ label:
68
+ zh_Hans: 缓存系统消息
69
+ en_US: Cache System Message
70
+ type: boolean
71
+ default: true
72
+ required: false
73
+ help:
74
+ zh_Hans: 启用系统消息的提示缓存。<cache></cache>中的内容将自动缓存。
75
+ en_US: Enable prompt caching for system messages. Content within <cache></cache> will be cached.
76
+ - name: prompt_caching_images
77
+ label:
78
+ zh_Hans: 缓存图片
79
+ en_US: Cache Images
80
+ type: boolean
81
+ default: true
82
+ required: false
83
+ help:
84
+ zh_Hans: 启用图片的提示缓存。
85
+ en_US: Enable prompt caching for images.
86
+ - name: prompt_caching_documents
87
+ label:
88
+ zh_Hans: 缓存文档
89
+ en_US: Cache Documents
90
+ type: boolean
91
+ default: true
92
+ required: false
93
+ help:
94
+ zh_Hans: 启用文档的提示缓存。
95
+ en_US: Enable prompt caching for documents.
96
+ - name: prompt_caching_tool_definitions
97
+ label:
98
+ zh_Hans: 缓存工具定义
99
+ en_US: Cache Tool Definitions
100
+ type: boolean
101
+ default: true
102
+ required: false
103
+ help:
104
+ zh_Hans: 启用工具定义的提示缓存。
105
+ en_US: Enable prompt caching for tool definitions.
106
+ - name: prompt_caching_tool_results
107
+ label:
108
+ zh_Hans: 缓存工具结果
109
+ en_US: Cache Tool Results
110
+ type: boolean
111
+ default: true
112
+ required: false
113
+ help:
114
+ zh_Hans: 启用工具结果的提示缓存。
115
+ en_US: Enable prompt caching for tool results.
116
+ pricing:
117
+ input: '1.00'
118
+ output: '5.00'
119
+ unit: '0.000001'
120
+ currency: USD
@@ -0,0 +1,120 @@
1
+ model: claude-opus-4-6
2
+ label:
3
+ en_US: claude-opus-4-6
4
+ model_type: llm
5
+ features:
6
+ - agent-thought
7
+ - vision
8
+ - tool-call
9
+ - stream-tool-call
10
+ - document
11
+ model_properties:
12
+ mode: chat
13
+ context_size: 200000
14
+ parameter_rules:
15
+ - name: thinking
16
+ label:
17
+ zh_Hans: 推理模式
18
+ en_US: Thinking Mode
19
+ type: boolean
20
+ default: false
21
+ required: false
22
+ help:
23
+ zh_Hans: 控制模型的推理能力。启用时,temperature、top_p和top_k将被禁用。
24
+ en_US: Controls the model's thinking capability. When enabled, temperature, top_p and top_k will be disabled.
25
+ - name: thinking_budget
26
+ label:
27
+ zh_Hans: 推理预算
28
+ en_US: Thinking Budget
29
+ type: int
30
+ default: 1024
31
+ min: 1024
32
+ max: 64000
33
+ required: false
34
+ help:
35
+ zh_Hans: 推理的预算限制(最小1024),必须小于max_tokens。仅在推理模式启用时可用。
36
+ en_US: Budget limit for thinking (minimum 1024), must be less than max_tokens. Only available when thinking mode is enabled.
37
+ - name: temperature
38
+ use_template: temperature
39
+ - name: top_p
40
+ use_template: top_p
41
+ - name: top_k
42
+ label:
43
+ zh_Hans: 取样数量
44
+ en_US: Top k
45
+ type: int
46
+ help:
47
+ zh_Hans: 仅从每个后续标记的前 K 个选项中采样。
48
+ en_US: Only sample from the top K options for each subsequent token.
49
+ required: false
50
+ - name: max_tokens
51
+ use_template: max_tokens
52
+ required: true
53
+ default: 64000
54
+ min: 1
55
+ max: 64000
56
+ - name: prompt_caching_message_flow
57
+ label:
58
+ zh_Hans: 大消息自动缓存阈值
59
+ en_US: Cache Message Flow Threshold
60
+ type: int
61
+ default: 0
62
+ required: false
63
+ help:
64
+ zh_Hans: 当用户或助手消息的单词数超过此阈值时,自动为该消息添加缓存控制。0 表示禁用。
65
+ en_US: If a user or assistant message exceeds this word count, add cache_control automatically. 0 disables the feature.
66
+ - name: prompt_caching_system_message
67
+ label:
68
+ zh_Hans: 缓存系统消息
69
+ en_US: Cache System Message
70
+ type: boolean
71
+ default: true
72
+ required: false
73
+ help:
74
+ zh_Hans: 启用系统消息的提示缓存。<cache></cache>中的内容将自动缓存。
75
+ en_US: Enable prompt caching for system messages. Content within <cache></cache> will be cached.
76
+ - name: prompt_caching_images
77
+ label:
78
+ zh_Hans: 缓存图片
79
+ en_US: Cache Images
80
+ type: boolean
81
+ default: true
82
+ required: false
83
+ help:
84
+ zh_Hans: 启用图片的提示缓存。
85
+ en_US: Enable prompt caching for images.
86
+ - name: prompt_caching_documents
87
+ label:
88
+ zh_Hans: 缓存文档
89
+ en_US: Cache Documents
90
+ type: boolean
91
+ default: true
92
+ required: false
93
+ help:
94
+ zh_Hans: 启用文档的提示缓存。
95
+ en_US: Enable prompt caching for documents.
96
+ - name: prompt_caching_tool_definitions
97
+ label:
98
+ zh_Hans: 缓存工具定义
99
+ en_US: Cache Tool Definitions
100
+ type: boolean
101
+ default: true
102
+ required: false
103
+ help:
104
+ zh_Hans: 启用工具定义的提示缓存。
105
+ en_US: Enable prompt caching for tool definitions.
106
+ - name: prompt_caching_tool_results
107
+ label:
108
+ zh_Hans: 缓存工具结果
109
+ en_US: Cache Tool Results
110
+ type: boolean
111
+ default: true
112
+ required: false
113
+ help:
114
+ zh_Hans: 启用工具结果的提示缓存。
115
+ en_US: Enable prompt caching for tool results.
116
+ pricing:
117
+ input: '5.00'
118
+ output: '25.00'
119
+ unit: '0.000001'
120
+ currency: USD
@@ -0,0 +1,130 @@
1
+ model: claude-sonnet-4-6
2
+ label:
3
+ en_US: claude-sonnet-4-6
4
+ model_type: llm
5
+ features:
6
+ - agent-thought
7
+ - vision
8
+ - tool-call
9
+ - stream-tool-call
10
+ - document
11
+ model_properties:
12
+ mode: chat
13
+ context_size: 1000000
14
+ parameter_rules:
15
+ - name: thinking
16
+ label:
17
+ zh_Hans: 推理模式
18
+ en_US: Thinking Mode
19
+ type: boolean
20
+ default: false
21
+ required: false
22
+ help:
23
+ zh_Hans: 控制模型的推理能力。启用时,temperature、top_p和top_k将被禁用。
24
+ en_US: Controls the model's thinking capability. When enabled, temperature, top_p and top_k will be disabled.
25
+ - name: thinking_budget
26
+ label:
27
+ zh_Hans: 推理预算
28
+ en_US: Thinking Budget
29
+ type: int
30
+ default: 1024
31
+ min: 0
32
+ max: 64000
33
+ required: false
34
+ help:
35
+ zh_Hans: 推理的预算限制(最小1024),必须小于max_tokens。仅在推理模式启用时可用。
36
+ en_US: Budget limit for thinking (minimum 1024), must be less than max_tokens. Only available when thinking mode is enabled.
37
+ - name: temperature
38
+ use_template: temperature
39
+ - name: top_p
40
+ use_template: top_p
41
+ - name: top_k
42
+ label:
43
+ zh_Hans: 取样数量
44
+ en_US: Top k
45
+ type: int
46
+ help:
47
+ zh_Hans: 仅从每个后续标记的前 K 个选项中采样。
48
+ en_US: Only sample from the top K options for each subsequent token.
49
+ required: false
50
+ - name: max_tokens
51
+ use_template: max_tokens
52
+ required: true
53
+ default: 64000
54
+ min: 1
55
+ max: 64000
56
+ - name: prompt_caching_message_flow
57
+ label:
58
+ zh_Hans: 大消息自动缓存阈值
59
+ en_US: Cache Message Flow Threshold
60
+ type: int
61
+ default: 0
62
+ required: false
63
+ help:
64
+ zh_Hans: 当用户或助手消息的单词数超过此阈值时,自动为该消息添加缓存控制。0 表示禁用。
65
+ en_US: If a user or assistant message exceeds this word count, add cache_control automatically. 0 disables the feature.
66
+ - name: prompt_caching_system_message
67
+ label:
68
+ zh_Hans: 缓存系统消息
69
+ en_US: Cache System Message
70
+ type: boolean
71
+ default: true
72
+ required: false
73
+ help:
74
+ zh_Hans: 启用系统消息的提示缓存。<cache></cache>中的内容将自动缓存。
75
+ en_US: Enable prompt caching for system messages. Content within <cache></cache> will be cached.
76
+ - name: prompt_caching_images
77
+ label:
78
+ zh_Hans: 缓存图片
79
+ en_US: Cache Images
80
+ type: boolean
81
+ default: true
82
+ required: false
83
+ help:
84
+ zh_Hans: 启用图片的提示缓存。
85
+ en_US: Enable prompt caching for images.
86
+ - name: prompt_caching_documents
87
+ label:
88
+ zh_Hans: 缓存文档
89
+ en_US: Cache Documents
90
+ type: boolean
91
+ default: true
92
+ required: false
93
+ help:
94
+ zh_Hans: 启用文档的提示缓存。
95
+ en_US: Enable prompt caching for documents.
96
+ - name: prompt_caching_tool_definitions
97
+ label:
98
+ zh_Hans: 缓存工具定义
99
+ en_US: Cache Tool Definitions
100
+ type: boolean
101
+ default: true
102
+ required: false
103
+ help:
104
+ zh_Hans: 启用工具定义的提示缓存。
105
+ en_US: Enable prompt caching for tool definitions.
106
+ - name: prompt_caching_tool_results
107
+ label:
108
+ zh_Hans: 缓存工具结果
109
+ en_US: Cache Tool Results
110
+ type: boolean
111
+ default: true
112
+ required: false
113
+ help:
114
+ zh_Hans: 启用工具结果的提示缓存。
115
+ en_US: Enable prompt caching for tool results.
116
+ - name: context_1m
117
+ label:
118
+ zh_Hans: 1M上下文窗口
119
+ en_US: 1M Context Window
120
+ type: boolean
121
+ default: true
122
+ required: false
123
+ help:
124
+ zh_Hans: 启用1M令牌上下文窗口。需要使用层级4或自定义速率限制的组织。注意, 超过200K令牌的请求将按高级费率收费(输入2倍,输出1.5倍定价), Dify显示的价格计算可能不准确。
125
+ en_US: Enable 1M token context window. Requires organizations in usage tier 4 or with custom rate limits. Note, Requests exceeding 200K tokens are charged at premium rates (2x input, 1.5x output pricing), Dify's displayed pricing calculations may be inaccurate.
126
+ pricing:
127
+ input: '3.00'
128
+ output: '15.00'
129
+ unit: '0.000001'
130
+ currency: USD
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@agentxin-ai/plugin-anthropic",
3
+ "version": "0.0.2",
4
+ "author": {
5
+ "name": "AgentXinAI",
6
+ "url": "https://agentxinai.cn"
7
+ },
8
+ "license": "AGPL-3.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/agentxin-ai/agentxin-plugins.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/agentxin-ai/agentxin-plugins/issues"
15
+ },
16
+ "type": "module",
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ "./package.json": "./package.json",
22
+ ".": {
23
+ "@agentxin-plugins-starter/source": "./src/index.ts",
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js",
26
+ "default": "./dist/index.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "!**/*.tsbuildinfo"
32
+ ],
33
+ "scripts": {
34
+ "prepack": "node ./scripts/copy-assets.mjs"
35
+ },
36
+ "dependencies": {
37
+ "@langchain/anthropic": "^0.3.0",
38
+ "tslib": "^2.3.0"
39
+ },
40
+ "peerDependencies": {
41
+ "@langchain/core": "^0.3.72",
42
+ "@metad/contracts": "^3.7.0",
43
+ "@nestjs/common": "^11.1.6",
44
+ "@nestjs/config": "^4.0.2",
45
+ "@agentxin-ai/plugin-sdk": "^3.7.1",
46
+ "chalk": "4.1.2",
47
+ "zod": "3.25.67"
48
+ }
49
+ }