@ai-sdk/anthropic 3.0.0-beta.50 → 3.0.0-beta.52

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,18 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.0-beta.52
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [32d8dbb]
8
+ - @ai-sdk/provider-utils@4.0.0-beta.32
9
+
10
+ ## 3.0.0-beta.51
11
+
12
+ ### Patch Changes
13
+
14
+ - 1742445: Support for custom provider name in google and anthropic providers
15
+
3
16
  ## 3.0.0-beta.50
4
17
 
5
18
  ### Patch Changes
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.50" : "0.0.0-test";
34
+ var VERSION = true ? "3.0.0-beta.52" : "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: "anthropic.messages",
3329
+ provider: providerName,
3329
3330
  baseURL,
3330
3331
  headers: getHeaders,
3331
3332
  fetch: options.fetch,