@ai-sdk/anthropic 2.0.42 → 2.0.44
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 +13 -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 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 2.0.44
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [056c471]
|
|
8
|
+
- @ai-sdk/provider-utils@3.0.17
|
|
9
|
+
|
|
10
|
+
## 2.0.43
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- e2dac8b: Support for custom provider name in google and anthropic providers
|
|
15
|
+
|
|
3
16
|
## 2.0.42
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -539,6 +539,11 @@ interface AnthropicProviderSettings {
|
|
|
539
539
|
*/
|
|
540
540
|
fetch?: FetchFunction;
|
|
541
541
|
generateId?: () => string;
|
|
542
|
+
/**
|
|
543
|
+
* Custom provider name
|
|
544
|
+
* Defaults to 'anthropic.messages'.
|
|
545
|
+
*/
|
|
546
|
+
name?: string;
|
|
542
547
|
}
|
|
543
548
|
/**
|
|
544
549
|
Create an Anthropic provider instance.
|
package/dist/index.d.ts
CHANGED
|
@@ -539,6 +539,11 @@ interface AnthropicProviderSettings {
|
|
|
539
539
|
*/
|
|
540
540
|
fetch?: FetchFunction;
|
|
541
541
|
generateId?: () => string;
|
|
542
|
+
/**
|
|
543
|
+
* Custom provider name
|
|
544
|
+
* Defaults to 'anthropic.messages'.
|
|
545
|
+
*/
|
|
546
|
+
name?: string;
|
|
542
547
|
}
|
|
543
548
|
/**
|
|
544
549
|
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 ? "2.0.
|
|
34
|
+
var VERSION = true ? "2.0.44" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -3089,13 +3089,14 @@ var anthropicTools = {
|
|
|
3089
3089
|
|
|
3090
3090
|
// src/anthropic-provider.ts
|
|
3091
3091
|
function createAnthropic(options = {}) {
|
|
3092
|
-
var _a;
|
|
3092
|
+
var _a, _b;
|
|
3093
3093
|
const baseURL = (_a = (0, import_provider_utils20.withoutTrailingSlash)(
|
|
3094
3094
|
(0, import_provider_utils20.loadOptionalSetting)({
|
|
3095
3095
|
settingValue: options.baseURL,
|
|
3096
3096
|
environmentVariableName: "ANTHROPIC_BASE_URL"
|
|
3097
3097
|
})
|
|
3098
3098
|
)) != null ? _a : "https://api.anthropic.com/v1";
|
|
3099
|
+
const providerName = (_b = options.name) != null ? _b : "anthropic.messages";
|
|
3099
3100
|
const getHeaders = () => (0, import_provider_utils20.withUserAgentSuffix)(
|
|
3100
3101
|
{
|
|
3101
3102
|
"anthropic-version": "2023-06-01",
|
|
@@ -3111,7 +3112,7 @@ function createAnthropic(options = {}) {
|
|
|
3111
3112
|
const createChatModel = (modelId) => {
|
|
3112
3113
|
var _a2;
|
|
3113
3114
|
return new AnthropicMessagesLanguageModel(modelId, {
|
|
3114
|
-
provider:
|
|
3115
|
+
provider: providerName,
|
|
3115
3116
|
baseURL,
|
|
3116
3117
|
headers: getHeaders,
|
|
3117
3118
|
fetch: options.fetch,
|