@aigne/anthropic 0.3.10 → 0.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.3.10...anthropic-v0.4.0) (2025-07-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **cli:** support HTTPS_PROXY and named path param ([#196](https://github.com/AIGNE-io/aigne-framework/issues/196)) ([04e684e](https://github.com/AIGNE-io/aigne-framework/commit/04e684ee26bc2d79924b0e3cb541cd07a7191804))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.27.0
16
+ * devDependencies
17
+ * @aigne/test-utils bumped to 0.4.11
18
+
3
19
  ## [0.3.10](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.3.9...anthropic-v0.3.10) (2025-06-30)
4
20
 
5
21
 
@@ -1,6 +1,6 @@
1
1
  import { type AgentProcessResult, ChatModel, type ChatModelInput, type ChatModelOptions, type ChatModelOutput } from "@aigne/core";
2
2
  import { type PromiseOrValue } from "@aigne/core/utils/type-utils.js";
3
- import Anthropic from "@anthropic-ai/sdk";
3
+ import Anthropic, { type ClientOptions } from "@anthropic-ai/sdk";
4
4
  import { z } from "zod";
5
5
  /**
6
6
  * Configuration options for Claude Chat Model
@@ -22,6 +22,10 @@ export interface AnthropicChatModelOptions {
22
22
  * Additional model options to control behavior
23
23
  */
24
24
  modelOptions?: ChatModelOptions;
25
+ /**
26
+ * Optional client options for the Anthropic SDK
27
+ */
28
+ clientOptions?: Partial<ClientOptions>;
25
29
  }
26
30
  /**
27
31
  * @hidden
@@ -63,7 +63,10 @@ class AnthropicChatModel extends core_1.ChatModel {
63
63
  const apiKey = this.options?.apiKey || process.env.ANTHROPIC_API_KEY || process.env.CLAUDE_API_KEY;
64
64
  if (!apiKey)
65
65
  throw new Error("Api Key is required for AnthropicChatModel");
66
- this._client ??= new sdk_1.default({ apiKey });
66
+ this._client ??= new sdk_1.default({
67
+ apiKey,
68
+ ...this.options?.clientOptions,
69
+ });
67
70
  return this._client;
68
71
  }
69
72
  get modelOptions() {
@@ -1,6 +1,6 @@
1
1
  import { type AgentProcessResult, ChatModel, type ChatModelInput, type ChatModelOptions, type ChatModelOutput } from "@aigne/core";
2
2
  import { type PromiseOrValue } from "@aigne/core/utils/type-utils.js";
3
- import Anthropic from "@anthropic-ai/sdk";
3
+ import Anthropic, { type ClientOptions } from "@anthropic-ai/sdk";
4
4
  import { z } from "zod";
5
5
  /**
6
6
  * Configuration options for Claude Chat Model
@@ -22,6 +22,10 @@ export interface AnthropicChatModelOptions {
22
22
  * Additional model options to control behavior
23
23
  */
24
24
  modelOptions?: ChatModelOptions;
25
+ /**
26
+ * Optional client options for the Anthropic SDK
27
+ */
28
+ clientOptions?: Partial<ClientOptions>;
25
29
  }
26
30
  /**
27
31
  * @hidden
@@ -1,6 +1,6 @@
1
1
  import { type AgentProcessResult, ChatModel, type ChatModelInput, type ChatModelOptions, type ChatModelOutput } from "@aigne/core";
2
2
  import { type PromiseOrValue } from "@aigne/core/utils/type-utils.js";
3
- import Anthropic from "@anthropic-ai/sdk";
3
+ import Anthropic, { type ClientOptions } from "@anthropic-ai/sdk";
4
4
  import { z } from "zod";
5
5
  /**
6
6
  * Configuration options for Claude Chat Model
@@ -22,6 +22,10 @@ export interface AnthropicChatModelOptions {
22
22
  * Additional model options to control behavior
23
23
  */
24
24
  modelOptions?: ChatModelOptions;
25
+ /**
26
+ * Optional client options for the Anthropic SDK
27
+ */
28
+ clientOptions?: Partial<ClientOptions>;
25
29
  }
26
30
  /**
27
31
  * @hidden
@@ -57,7 +57,10 @@ export class AnthropicChatModel extends ChatModel {
57
57
  const apiKey = this.options?.apiKey || process.env.ANTHROPIC_API_KEY || process.env.CLAUDE_API_KEY;
58
58
  if (!apiKey)
59
59
  throw new Error("Api Key is required for AnthropicChatModel");
60
- this._client ??= new Anthropic({ apiKey });
60
+ this._client ??= new Anthropic({
61
+ apiKey,
62
+ ...this.options?.clientOptions,
63
+ });
61
64
  return this._client;
62
65
  }
63
66
  get modelOptions() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/anthropic",
3
- "version": "0.3.10",
3
+ "version": "0.4.0",
4
4
  "description": "AIGNE Anthropic SDK for integrating with Claude AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "@anthropic-ai/sdk": "^0.41.0",
36
36
  "zod": "^3.24.4",
37
- "@aigne/core": "^1.26.0"
37
+ "@aigne/core": "^1.27.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/bun": "^1.2.12",
@@ -42,7 +42,7 @@
42
42
  "npm-run-all": "^4.1.5",
43
43
  "rimraf": "^6.0.1",
44
44
  "typescript": "^5.8.3",
45
- "@aigne/test-utils": "^0.4.10"
45
+ "@aigne/test-utils": "^0.4.11"
46
46
  },
47
47
  "scripts": {
48
48
  "lint": "tsc --noEmit",