@ai-sdk/anthropic 3.0.0-beta.50 → 3.0.0-beta.51
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 +6 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -550,6 +550,11 @@ interface AnthropicProviderSettings {
|
|
|
550
550
|
*/
|
|
551
551
|
fetch?: FetchFunction;
|
|
552
552
|
generateId?: () => string;
|
|
553
|
+
/**
|
|
554
|
+
* Custom provider name
|
|
555
|
+
* Defaults to 'anthropic.messages'.
|
|
556
|
+
*/
|
|
557
|
+
name?: string;
|
|
553
558
|
}
|
|
554
559
|
/**
|
|
555
560
|
Create an Anthropic provider instance.
|
package/dist/index.d.ts
CHANGED
|
@@ -550,6 +550,11 @@ interface AnthropicProviderSettings {
|
|
|
550
550
|
*/
|
|
551
551
|
fetch?: FetchFunction;
|
|
552
552
|
generateId?: () => string;
|
|
553
|
+
/**
|
|
554
|
+
* Custom provider name
|
|
555
|
+
* Defaults to 'anthropic.messages'.
|
|
556
|
+
*/
|
|
557
|
+
name?: string;
|
|
553
558
|
}
|
|
554
559
|
/**
|
|
555
560
|
Create an Anthropic provider instance.
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
31
31
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
32
32
|
|
|
33
33
|
// src/version.ts
|
|
34
|
-
var VERSION = true ? "3.0.0-beta.
|
|
34
|
+
var VERSION = true ? "3.0.0-beta.51" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -3303,13 +3303,14 @@ var anthropicTools = {
|
|
|
3303
3303
|
|
|
3304
3304
|
// src/anthropic-provider.ts
|
|
3305
3305
|
function createAnthropic(options = {}) {
|
|
3306
|
-
var _a;
|
|
3306
|
+
var _a, _b;
|
|
3307
3307
|
const baseURL = (_a = (0, import_provider_utils20.withoutTrailingSlash)(
|
|
3308
3308
|
(0, import_provider_utils20.loadOptionalSetting)({
|
|
3309
3309
|
settingValue: options.baseURL,
|
|
3310
3310
|
environmentVariableName: "ANTHROPIC_BASE_URL"
|
|
3311
3311
|
})
|
|
3312
3312
|
)) != null ? _a : "https://api.anthropic.com/v1";
|
|
3313
|
+
const providerName = (_b = options.name) != null ? _b : "anthropic.messages";
|
|
3313
3314
|
const getHeaders = () => (0, import_provider_utils20.withUserAgentSuffix)(
|
|
3314
3315
|
{
|
|
3315
3316
|
"anthropic-version": "2023-06-01",
|
|
@@ -3325,7 +3326,7 @@ function createAnthropic(options = {}) {
|
|
|
3325
3326
|
const createChatModel = (modelId) => {
|
|
3326
3327
|
var _a2;
|
|
3327
3328
|
return new AnthropicMessagesLanguageModel(modelId, {
|
|
3328
|
-
provider:
|
|
3329
|
+
provider: providerName,
|
|
3329
3330
|
baseURL,
|
|
3330
3331
|
headers: getHeaders,
|
|
3331
3332
|
fetch: options.fetch,
|