@aigne/anthropic 0.9.2 → 0.10.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,32 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.9.3...anthropic-v0.10.0) (2025-07-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * **cli:** support aigne hub connect and model use ([#267](https://github.com/AIGNE-io/aigne-framework/issues/267)) ([8e5a32a](https://github.com/AIGNE-io/aigne-framework/commit/8e5a32afc64593137153d7407bde13837312ac70))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.38.0
16
+ * devDependencies
17
+ * @aigne/test-utils bumped to 0.5.12
18
+
19
+ ## [0.9.3](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.9.2...anthropic-v0.9.3) (2025-07-22)
20
+
21
+
22
+ ### Dependencies
23
+
24
+ * The following workspace dependencies were updated
25
+ * dependencies
26
+ * @aigne/core bumped to 1.37.0
27
+ * devDependencies
28
+ * @aigne/test-utils bumped to 0.5.11
29
+
3
30
  ## [0.9.2](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.9.1...anthropic-v0.9.2) (2025-07-17)
4
31
 
5
32
 
@@ -99,6 +99,7 @@ export declare const claudeChatModelOptionsSchema: z.ZodObject<{
99
99
  export declare class AnthropicChatModel extends ChatModel {
100
100
  options?: AnthropicChatModelOptions | undefined;
101
101
  constructor(options?: AnthropicChatModelOptions | undefined);
102
+ protected apiKeyEnvName: string;
102
103
  /**
103
104
  * @hidden
104
105
  */
@@ -58,12 +58,13 @@ class AnthropicChatModel extends core_1.ChatModel {
58
58
  super();
59
59
  this.options = options;
60
60
  }
61
+ apiKeyEnvName = "ANTHROPIC_API_KEY";
61
62
  /**
62
63
  * @hidden
63
64
  */
64
65
  _client;
65
66
  get client() {
66
- const apiKey = this.options?.apiKey || process.env.ANTHROPIC_API_KEY || process.env.CLAUDE_API_KEY;
67
+ const apiKey = this.options?.apiKey || process.env[this.apiKeyEnvName] || process.env.CLAUDE_API_KEY;
67
68
  if (!apiKey)
68
69
  throw new Error("AnthropicChatModel requires an API key. Please provide it via `options.apiKey`, or set the `ANTHROPIC_API_KEY` or `CLAUDE_API_KEY` environment variable");
69
70
  this._client ??= new sdk_1.default({
@@ -99,6 +99,7 @@ export declare const claudeChatModelOptionsSchema: z.ZodObject<{
99
99
  export declare class AnthropicChatModel extends ChatModel {
100
100
  options?: AnthropicChatModelOptions | undefined;
101
101
  constructor(options?: AnthropicChatModelOptions | undefined);
102
+ protected apiKeyEnvName: string;
102
103
  /**
103
104
  * @hidden
104
105
  */
@@ -99,6 +99,7 @@ export declare const claudeChatModelOptionsSchema: z.ZodObject<{
99
99
  export declare class AnthropicChatModel extends ChatModel {
100
100
  options?: AnthropicChatModelOptions | undefined;
101
101
  constructor(options?: AnthropicChatModelOptions | undefined);
102
+ protected apiKeyEnvName: string;
102
103
  /**
103
104
  * @hidden
104
105
  */
@@ -52,12 +52,13 @@ export class AnthropicChatModel extends ChatModel {
52
52
  super();
53
53
  this.options = options;
54
54
  }
55
+ apiKeyEnvName = "ANTHROPIC_API_KEY";
55
56
  /**
56
57
  * @hidden
57
58
  */
58
59
  _client;
59
60
  get client() {
60
- const apiKey = this.options?.apiKey || process.env.ANTHROPIC_API_KEY || process.env.CLAUDE_API_KEY;
61
+ const apiKey = this.options?.apiKey || process.env[this.apiKeyEnvName] || process.env.CLAUDE_API_KEY;
61
62
  if (!apiKey)
62
63
  throw new Error("AnthropicChatModel requires an API key. Please provide it via `options.apiKey`, or set the `ANTHROPIC_API_KEY` or `CLAUDE_API_KEY` environment variable");
63
64
  this._client ??= new Anthropic({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/anthropic",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "AIGNE Anthropic SDK for integrating with Claude AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -36,7 +36,7 @@
36
36
  "ajv": "^8.17.1",
37
37
  "jaison": "^2.0.2",
38
38
  "zod": "^3.25.67",
39
- "@aigne/core": "^1.36.0"
39
+ "@aigne/core": "^1.38.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/bun": "^1.2.18",
@@ -44,7 +44,7 @@
44
44
  "npm-run-all": "^4.1.5",
45
45
  "rimraf": "^6.0.1",
46
46
  "typescript": "^5.8.3",
47
- "@aigne/test-utils": "^0.5.10"
47
+ "@aigne/test-utils": "^0.5.12"
48
48
  },
49
49
  "scripts": {
50
50
  "lint": "tsc --noEmit",