@ai-sdk/anthropic 2.0.17 → 2.0.19

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/dist/index.mjs CHANGED
@@ -5,9 +5,13 @@ import {
5
5
  import {
6
6
  generateId as generateId2,
7
7
  loadApiKey,
8
- withoutTrailingSlash
8
+ withoutTrailingSlash,
9
+ withUserAgentSuffix
9
10
  } from "@ai-sdk/provider-utils";
10
11
 
12
+ // src/version.ts
13
+ var VERSION = true ? "2.0.19" : "0.0.0-test";
14
+
11
15
  // src/anthropic-messages-language-model.ts
12
16
  import {
13
17
  UnsupportedFunctionalityError as UnsupportedFunctionalityError3
@@ -2085,15 +2089,18 @@ var anthropicTools = {
2085
2089
  function createAnthropic(options = {}) {
2086
2090
  var _a;
2087
2091
  const baseURL = (_a = withoutTrailingSlash(options.baseURL)) != null ? _a : "https://api.anthropic.com/v1";
2088
- const getHeaders = () => ({
2089
- "anthropic-version": "2023-06-01",
2090
- "x-api-key": loadApiKey({
2091
- apiKey: options.apiKey,
2092
- environmentVariableName: "ANTHROPIC_API_KEY",
2093
- description: "Anthropic"
2094
- }),
2095
- ...options.headers
2096
- });
2092
+ const getHeaders = () => withUserAgentSuffix(
2093
+ {
2094
+ "anthropic-version": "2023-06-01",
2095
+ "x-api-key": loadApiKey({
2096
+ apiKey: options.apiKey,
2097
+ environmentVariableName: "ANTHROPIC_API_KEY",
2098
+ description: "Anthropic"
2099
+ }),
2100
+ ...options.headers
2101
+ },
2102
+ `ai-sdk/anthropic/${VERSION}`
2103
+ );
2097
2104
  const createChatModel = (modelId) => {
2098
2105
  var _a2;
2099
2106
  return new AnthropicMessagesLanguageModel(modelId, {
@@ -2129,6 +2136,7 @@ function createAnthropic(options = {}) {
2129
2136
  }
2130
2137
  var anthropic = createAnthropic();
2131
2138
  export {
2139
+ VERSION,
2132
2140
  anthropic,
2133
2141
  createAnthropic
2134
2142
  };