@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 +18 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
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.1.0-beta.2" : "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
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
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
|
};
|