@warlock.js/ai-anthropic 4.1.6 → 4.1.8
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/cjs/index.cjs +7 -7
- package/esm/config.type.d.mts +1 -1
- package/esm/known-vision-models.mjs +1 -1
- package/esm/model.mjs +1 -1
- package/esm/sdk.d.mts +1 -1
- package/esm/sdk.mjs +1 -1
- package/esm/utils/map-stop-reason.mjs +1 -1
- package/esm/utils/to-anthropic-messages.mjs +1 -1
- package/esm/utils/to-anthropic-tools.mjs +1 -1
- package/esm/utils/wrap-anthropic-error.mjs +1 -1
- package/package.json +3 -3
package/cjs/index.cjs
CHANGED
|
@@ -31,7 +31,7 @@ _anthropic_ai_sdk = __toESM(_anthropic_ai_sdk, 1);
|
|
|
31
31
|
let _warlock_js_ai = require("@warlock.js/ai");
|
|
32
32
|
let _warlock_js_logger = require("@warlock.js/logger");
|
|
33
33
|
|
|
34
|
-
//#region
|
|
34
|
+
//#region ../@warlock.js/ai-anthropic/src/known-vision-models.ts
|
|
35
35
|
/**
|
|
36
36
|
* Model-name prefixes for Claude families that accept image input
|
|
37
37
|
* (vision) on the Messages API.
|
|
@@ -73,7 +73,7 @@ function inferVisionCapability(modelName) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
//#endregion
|
|
76
|
-
//#region
|
|
76
|
+
//#region ../@warlock.js/ai-anthropic/src/utils/map-stop-reason.ts
|
|
77
77
|
const stopReasonMap = {
|
|
78
78
|
end_turn: "stop",
|
|
79
79
|
stop_sequence: "stop",
|
|
@@ -101,7 +101,7 @@ function mapStopReason(raw) {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
//#endregion
|
|
104
|
-
//#region
|
|
104
|
+
//#region ../@warlock.js/ai-anthropic/src/utils/to-anthropic-messages.ts
|
|
105
105
|
/**
|
|
106
106
|
* Convert vendor-neutral `Message[]` into Anthropic's request shape.
|
|
107
107
|
*
|
|
@@ -224,7 +224,7 @@ function toAnthropicContentBlock(part) {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
//#endregion
|
|
227
|
-
//#region
|
|
227
|
+
//#region ../@warlock.js/ai-anthropic/src/utils/to-anthropic-tools.ts
|
|
228
228
|
/**
|
|
229
229
|
* Convert vendor-neutral `ToolConfig[]` into Anthropic's `tools` array.
|
|
230
230
|
* Uses the shared `extractJsonSchema` helper; Anthropic requires the
|
|
@@ -257,7 +257,7 @@ function toInputSchema(input) {
|
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
//#endregion
|
|
260
|
-
//#region
|
|
260
|
+
//#region ../@warlock.js/ai-anthropic/src/utils/wrap-anthropic-error.ts
|
|
261
261
|
/**
|
|
262
262
|
* Wrap any thrown value caught inside the Anthropic adapter into the
|
|
263
263
|
* appropriate `@warlock.js/ai` `AIError` subclass.
|
|
@@ -410,7 +410,7 @@ function parseRetryAfter(headers) {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
//#endregion
|
|
413
|
-
//#region
|
|
413
|
+
//#region ../@warlock.js/ai-anthropic/src/model.ts
|
|
414
414
|
const LOG_MODULE = "ai.anthropic";
|
|
415
415
|
/**
|
|
416
416
|
* Anthropic requires `max_tokens` on every request (unlike OpenAI,
|
|
@@ -702,7 +702,7 @@ var AnthropicModel = class {
|
|
|
702
702
|
};
|
|
703
703
|
|
|
704
704
|
//#endregion
|
|
705
|
-
//#region
|
|
705
|
+
//#region ../@warlock.js/ai-anthropic/src/sdk.ts
|
|
706
706
|
/**
|
|
707
707
|
* Anthropic-backed implementation of `SDKAdapterContract`.
|
|
708
708
|
*
|
package/esm/config.type.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientOptions } from "@anthropic-ai/sdk";
|
|
2
2
|
import { ModelConfig, ModelPricing } from "@warlock.js/ai";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/ai-anthropic/src/config.type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Configuration for the Anthropic SDK adapter.
|
|
7
7
|
*
|
package/esm/model.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import "./utils/index.mjs";
|
|
|
7
7
|
import { safeJsonParse } from "@warlock.js/ai";
|
|
8
8
|
import { log } from "@warlock.js/logger";
|
|
9
9
|
|
|
10
|
-
//#region
|
|
10
|
+
//#region ../@warlock.js/ai-anthropic/src/model.ts
|
|
11
11
|
const LOG_MODULE = "ai.anthropic";
|
|
12
12
|
/**
|
|
13
13
|
* Anthropic requires `max_tokens` on every request (unlike OpenAI,
|
package/esm/sdk.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnthropicModelConfig, AnthropicSDKConfig } from "./config.type.mjs";
|
|
2
2
|
import { ModelContract, SDKAdapterContract } from "@warlock.js/ai";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/ai-anthropic/src/sdk.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Anthropic-backed implementation of `SDKAdapterContract`.
|
|
7
7
|
*
|
package/esm/sdk.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { AnthropicModel } from "./model.mjs";
|
|
|
2
2
|
import Anthropic from "@anthropic-ai/sdk";
|
|
3
3
|
import { approximateTokenCount } from "@warlock.js/ai";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/ai-anthropic/src/sdk.ts
|
|
6
6
|
/**
|
|
7
7
|
* Anthropic-backed implementation of `SDKAdapterContract`.
|
|
8
8
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extractJsonSchema } from "@warlock.js/ai";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/ai-anthropic/src/utils/to-anthropic-tools.ts
|
|
4
4
|
/**
|
|
5
5
|
* Convert vendor-neutral `ToolConfig[]` into Anthropic's `tools` array.
|
|
6
6
|
* Uses the shared `extractJsonSchema` helper; Anthropic requires the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { APIConnectionTimeoutError, APIError } from "@anthropic-ai/sdk";
|
|
2
2
|
import { AIError, ContextLengthExceededError, InvalidRequestError, ProviderAuthError, ProviderError, ProviderRateLimitError, ProviderTimeoutError, QuotaExceededError } from "@warlock.js/ai";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/ai-anthropic/src/utils/wrap-anthropic-error.ts
|
|
5
5
|
/**
|
|
6
6
|
* Wrap any thrown value caught inside the Anthropic adapter into the
|
|
7
7
|
* appropriate `@warlock.js/ai` `AIError` subclass.
|
package/package.json
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@anthropic-ai/sdk": "^0.96.0",
|
|
18
|
-
"@warlock.js/logger": "
|
|
18
|
+
"@warlock.js/logger": "*"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@warlock.js/ai": "
|
|
21
|
+
"@warlock.js/ai": "*"
|
|
22
22
|
},
|
|
23
|
-
"version": "4.1.
|
|
23
|
+
"version": "4.1.8",
|
|
24
24
|
"main": "./cjs/index.cjs",
|
|
25
25
|
"module": "./esm/index.mjs",
|
|
26
26
|
"types": "./esm/index.d.mts",
|