@ai-sdk/anthropic 2.1.0-beta.0 → 2.1.0-beta.2

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,23 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.1.0-beta.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1cad0ab: feat: add provider version to user-agent header
8
+ - Updated dependencies [0c4822d]
9
+ - @ai-sdk/provider@2.1.0-beta.1
10
+ - @ai-sdk/provider-utils@3.1.0-beta.2
11
+
12
+ ## 2.1.0-beta.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [953d0f2]
17
+ - Updated dependencies [cbb1d35]
18
+ - @ai-sdk/test-server@1.0.0-beta.0
19
+ - @ai-sdk/provider-utils@3.1.0-beta.1
20
+
3
21
  ## 2.1.0-beta.0
4
22
 
5
23
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -251,4 +251,6 @@ Default Anthropic provider instance.
251
251
  */
252
252
  declare const anthropic: AnthropicProvider;
253
253
 
254
- export { type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, anthropic, createAnthropic };
254
+ declare const VERSION: string;
255
+
256
+ export { type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, VERSION, anthropic, createAnthropic };
package/dist/index.d.ts CHANGED
@@ -251,4 +251,6 @@ Default Anthropic provider instance.
251
251
  */
252
252
  declare const anthropic: AnthropicProvider;
253
253
 
254
- export { type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, anthropic, createAnthropic };
254
+ declare const VERSION: string;
255
+
256
+ export { type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, VERSION, anthropic, createAnthropic };
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ VERSION: () => VERSION,
33
34
  anthropic: () => anthropic,
34
35
  createAnthropic: () => createAnthropic
35
36
  });
@@ -39,6 +40,9 @@ module.exports = __toCommonJS(src_exports);
39
40
  var import_provider4 = require("@ai-sdk/provider");
40
41
  var import_provider_utils13 = require("@ai-sdk/provider-utils");
41
42
 
43
+ // src/version.ts
44
+ var VERSION = true ? "2.1.0-beta.2" : "0.0.0-test";
45
+
42
46
  // src/anthropic-messages-language-model.ts
43
47
  var import_provider3 = require("@ai-sdk/provider");
44
48
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
@@ -2102,15 +2106,18 @@ var anthropicTools = {
2102
2106
  function createAnthropic(options = {}) {
2103
2107
  var _a;
2104
2108
  const baseURL = (_a = (0, import_provider_utils13.withoutTrailingSlash)(options.baseURL)) != null ? _a : "https://api.anthropic.com/v1";
2105
- const getHeaders = () => ({
2106
- "anthropic-version": "2023-06-01",
2107
- "x-api-key": (0, import_provider_utils13.loadApiKey)({
2108
- apiKey: options.apiKey,
2109
- environmentVariableName: "ANTHROPIC_API_KEY",
2110
- description: "Anthropic"
2111
- }),
2112
- ...options.headers
2113
- });
2109
+ const getHeaders = () => (0, import_provider_utils13.withUserAgentSuffix)(
2110
+ {
2111
+ "anthropic-version": "2023-06-01",
2112
+ "x-api-key": (0, import_provider_utils13.loadApiKey)({
2113
+ apiKey: options.apiKey,
2114
+ environmentVariableName: "ANTHROPIC_API_KEY",
2115
+ description: "Anthropic"
2116
+ }),
2117
+ ...options.headers
2118
+ },
2119
+ `ai-sdk/anthropic/${VERSION}`
2120
+ );
2114
2121
  const createChatModel = (modelId) => {
2115
2122
  var _a2;
2116
2123
  return new AnthropicMessagesLanguageModel(modelId, {
@@ -2147,6 +2154,7 @@ function createAnthropic(options = {}) {
2147
2154
  var anthropic = createAnthropic();
2148
2155
  // Annotate the CommonJS export names for ESM import in node:
2149
2156
  0 && (module.exports = {
2157
+ VERSION,
2150
2158
  anthropic,
2151
2159
  createAnthropic
2152
2160
  });