@ai-sdk/anthropic 2.0.41 → 2.0.43

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,17 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.43
4
+
5
+ ### Patch Changes
6
+
7
+ - e2dac8b: Support for custom provider name in google and anthropic providers
8
+
9
+ ## 2.0.42
10
+
11
+ ### Patch Changes
12
+
13
+ - 035b927: fix: set providerExecuted on Anthropic web_fetch tool results
14
+
3
15
  ## 2.0.41
4
16
 
5
17
  ### 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.41" : "0.0.0-test";
34
+ var VERSION = true ? "2.0.43" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -2390,7 +2390,8 @@ var AnthropicMessagesLanguageModel = class {
2390
2390
  data: part.content.content.source.data
2391
2391
  }
2392
2392
  }
2393
- }
2393
+ },
2394
+ providerExecuted: true
2394
2395
  });
2395
2396
  } else if (part.content.type === "web_fetch_tool_result_error") {
2396
2397
  controller.enqueue({
@@ -3088,13 +3089,14 @@ var anthropicTools = {
3088
3089
 
3089
3090
  // src/anthropic-provider.ts
3090
3091
  function createAnthropic(options = {}) {
3091
- var _a;
3092
+ var _a, _b;
3092
3093
  const baseURL = (_a = (0, import_provider_utils20.withoutTrailingSlash)(
3093
3094
  (0, import_provider_utils20.loadOptionalSetting)({
3094
3095
  settingValue: options.baseURL,
3095
3096
  environmentVariableName: "ANTHROPIC_BASE_URL"
3096
3097
  })
3097
3098
  )) != null ? _a : "https://api.anthropic.com/v1";
3099
+ const providerName = (_b = options.name) != null ? _b : "anthropic.messages";
3098
3100
  const getHeaders = () => (0, import_provider_utils20.withUserAgentSuffix)(
3099
3101
  {
3100
3102
  "anthropic-version": "2023-06-01",
@@ -3110,7 +3112,7 @@ function createAnthropic(options = {}) {
3110
3112
  const createChatModel = (modelId) => {
3111
3113
  var _a2;
3112
3114
  return new AnthropicMessagesLanguageModel(modelId, {
3113
- provider: "anthropic.messages",
3115
+ provider: providerName,
3114
3116
  baseURL,
3115
3117
  headers: getHeaders,
3116
3118
  fetch: options.fetch,