@aigne/anthropic 0.10.6 → 0.10.7

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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.7](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.10.6...anthropic-v0.10.7) (2025-08-05)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * The following workspace dependencies were updated
9
+ * dependencies
10
+ * @aigne/core bumped to 1.43.1
11
+ * devDependencies
12
+ * @aigne/test-utils bumped to 0.5.19
13
+
3
14
  ## [0.10.6](https://github.com/AIGNE-io/aigne-framework/compare/anthropic-v0.10.5...anthropic-v0.10.6) (2025-08-04)
4
15
 
5
16
 
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @aigne/anthropic
2
2
 
3
+ <p align="center">
4
+ <picture>
5
+ <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo-dark.svg" media="(prefers-color-scheme: dark)">
6
+ <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo.svg" media="(prefers-color-scheme: light)">
7
+ <img src="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo.svg" alt="AIGNE Logo" width="400" />
8
+ </picture>
9
+ </p>
10
+
3
11
  [![GitHub star chart](https://img.shields.io/github/stars/AIGNE-io/aigne-framework?style=flat-square)](https://star-history.com/#AIGNE-io/aigne-framework)
4
12
  [![Open Issues](https://img.shields.io/github/issues-raw/AIGNE-io/aigne-framework?style=flat-square)](https://github.com/AIGNE-io/aigne-framework/issues)
5
13
  [![codecov](https://codecov.io/gh/AIGNE-io/aigne-framework/graph/badge.svg?token=DO07834RQL)](https://codecov.io/gh/AIGNE-io/aigne-framework)
@@ -12,7 +12,6 @@ const stream_utils_js_1 = require("@aigne/core/utils/stream-utils.js");
12
12
  const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
13
13
  const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
14
14
  const ajv_1 = require("ajv");
15
- const jaison_1 = __importDefault(require("jaison"));
16
15
  const zod_1 = require("zod");
17
16
  const CHAT_MODEL_CLAUDE_DEFAULT_MODEL = "claude-3-7-sonnet-latest";
18
17
  /**
@@ -132,7 +131,7 @@ class AnthropicChatModel extends core_1.ChatModel {
132
131
  return result;
133
132
  // Try to parse the text response as JSON
134
133
  // If it matches the json_schema, return it as json
135
- const json = safeParseJSON(result.text || "");
134
+ const json = (0, core_1.safeParseJSON)(result.text || "");
136
135
  if (this.ajv.validate(input.responseFormat.jsonSchema.schema, json)) {
137
136
  return { ...result, json, text: undefined };
138
137
  }
@@ -362,13 +361,4 @@ function convertTools({ tools, toolChoice, disableParallelToolUse, }) {
362
361
  tool_choice: choice,
363
362
  };
364
363
  }
365
- function safeParseJSON(text) {
366
- if (!text)
367
- return null;
368
- try {
369
- return (0, jaison_1.default)(text);
370
- }
371
- catch {
372
- return null;
373
- }
374
- }
364
+ // safeParseJSON is now imported from @aigne/core
@@ -1,4 +1,4 @@
1
- import { ChatModel, } from "@aigne/core";
1
+ import { ChatModel, safeParseJSON, } from "@aigne/core";
2
2
  import { parseJSON } from "@aigne/core/utils/json-schema.js";
3
3
  import { logger } from "@aigne/core/utils/logger.js";
4
4
  import { mergeUsage } from "@aigne/core/utils/model-utils.js";
@@ -6,7 +6,6 @@ import { agentResponseStreamToObject } from "@aigne/core/utils/stream-utils.js";
6
6
  import { checkArguments, isEmpty, isNonNullable, } from "@aigne/core/utils/type-utils.js";
7
7
  import Anthropic from "@anthropic-ai/sdk";
8
8
  import { Ajv } from "ajv";
9
- import jaison from "jaison";
10
9
  import { z } from "zod";
11
10
  const CHAT_MODEL_CLAUDE_DEFAULT_MODEL = "claude-3-7-sonnet-latest";
12
11
  /**
@@ -355,13 +354,4 @@ function convertTools({ tools, toolChoice, disableParallelToolUse, }) {
355
354
  tool_choice: choice,
356
355
  };
357
356
  }
358
- function safeParseJSON(text) {
359
- if (!text)
360
- return null;
361
- try {
362
- return jaison(text);
363
- }
364
- catch {
365
- return null;
366
- }
367
- }
357
+ // safeParseJSON is now imported from @aigne/core
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@aigne/anthropic",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "description": "AIGNE Anthropic SDK for integrating with Claude AI models",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
9
- "homepage": "https://github.com/AIGNE-io/aigne-framework",
9
+ "homepage": "https://www.aigne.io/framework",
10
10
  "license": "Elastic-2.0",
11
11
  "repository": {
12
12
  "type": "git",
13
13
  "url": "git+https://github.com/AIGNE-io/aigne-framework"
14
14
  },
15
+ "bugs": {
16
+ "url": "https://github.com/AIGNE-io/aigne-framework/issues"
17
+ },
15
18
  "files": [
16
19
  "lib/cjs",
17
20
  "lib/dts",
@@ -34,9 +37,8 @@
34
37
  "dependencies": {
35
38
  "@anthropic-ai/sdk": "^0.56.0",
36
39
  "ajv": "^8.17.1",
37
- "jaison": "^2.0.2",
38
40
  "zod": "^3.25.67",
39
- "@aigne/core": "^1.43.0"
41
+ "@aigne/core": "^1.43.1"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@types/bun": "^1.2.18",
@@ -44,7 +46,7 @@
44
46
  "npm-run-all": "^4.1.5",
45
47
  "rimraf": "^6.0.1",
46
48
  "typescript": "^5.8.3",
47
- "@aigne/test-utils": "^0.5.18"
49
+ "@aigne/test-utils": "^0.5.19"
48
50
  },
49
51
  "scripts": {
50
52
  "lint": "tsc --noEmit",