@absolutejs/ai 0.0.54-beta.0 → 0.0.55
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/README.md +25 -0
- package/dist/ai/index.js +86 -9
- package/dist/ai/index.js.map +4 -4
- package/dist/ai/providers/anthropic.js +76 -5
- package/dist/ai/providers/anthropic.js.map +3 -3
- package/dist/ai/providers/openrouter.js +79 -8
- package/dist/ai/providers/openrouter.js.map +3 -3
- package/dist/src/ai/index.d.ts +1 -0
- package/dist/types/anthropic.d.ts +26 -0
- package/package.json +2 -2
package/dist/src/ai/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { openaiCompatible, google, xai, deepseek, mistralai, alibaba, meta, moon
|
|
|
22
22
|
export { openaiResponses } from "./providers/openaiResponses";
|
|
23
23
|
export { gemini } from "./providers/gemini";
|
|
24
24
|
export { anthropic } from "./providers/anthropic";
|
|
25
|
+
export type { AnthropicConfig, AnthropicRequestOptions, AnthropicServerTool, AnthropicWebSearchLocation, AnthropicWebSearchParameters, } from "../../types/anthropic";
|
|
25
26
|
export { ollama } from "./providers/ollama";
|
|
26
27
|
export { openai } from "./providers/openai";
|
|
27
28
|
export { createOpenRouterAuthorizationUrl, createOpenRouterClient, createOpenRouterKeyLinks, estimateOpenRouterCost, estimateOpenRouterModelCost, exchangeOpenRouterAuthCode, generateOpenRouterPKCE, openrouter, openrouterMessages, openrouterResponses, openRouterModelMatchesRule, verifyOpenRouterWebhookSignature, } from "./providers/openrouter";
|
|
@@ -19,6 +19,32 @@ export type AnthropicConfig = {
|
|
|
19
19
|
tokenSource?: () => Promise<string> | string;
|
|
20
20
|
transformRequestBody?: (body: Record<string, unknown>, params: AIProviderStreamParams) => Record<string, unknown>;
|
|
21
21
|
};
|
|
22
|
+
export type AnthropicWebSearchLocation = {
|
|
23
|
+
city?: string;
|
|
24
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
25
|
+
country?: string;
|
|
26
|
+
region?: string;
|
|
27
|
+
timezone?: string;
|
|
28
|
+
type: "approximate";
|
|
29
|
+
};
|
|
30
|
+
export type AnthropicWebSearchParameters = {
|
|
31
|
+
allowedCallers?: readonly ("direct" | "code_execution_20260120")[];
|
|
32
|
+
allowedDomains?: readonly string[];
|
|
33
|
+
blockedDomains?: readonly string[];
|
|
34
|
+
maxUses?: number;
|
|
35
|
+
responseInclusion?: "full" | "excluded";
|
|
36
|
+
userLocation?: AnthropicWebSearchLocation;
|
|
37
|
+
/** Defaults to the broadly supported 2025-03-05 tool revision. */
|
|
38
|
+
version?: "web_search_20250305" | "web_search_20260209" | "web_search_20260318";
|
|
39
|
+
};
|
|
40
|
+
export type AnthropicServerTool = {
|
|
41
|
+
parameters?: AnthropicWebSearchParameters;
|
|
42
|
+
type: "anthropic:web_search";
|
|
43
|
+
};
|
|
44
|
+
/** Per-request Anthropic-only controls supplied at providerOptions.anthropic. */
|
|
45
|
+
export type AnthropicRequestOptions = {
|
|
46
|
+
serverTools?: readonly AnthropicServerTool[];
|
|
47
|
+
};
|
|
22
48
|
export type AnthropicMessage = {
|
|
23
49
|
content: string | Array<Record<string, unknown>>;
|
|
24
50
|
role: "user" | "assistant";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/ai",
|
|
3
|
-
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"homepage": "https://github.com/absolutejs/ai",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/absolutejs/ai/issues"
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"react": "^19.2.0",
|
|
100
100
|
"svelte": "^5.35.2",
|
|
101
101
|
"vue": "^3.5.27",
|
|
102
|
-
"@absolutejs/sync": ">=2.14.0
|
|
102
|
+
"@absolutejs/sync": ">=2.14.0 <3"
|
|
103
103
|
},
|
|
104
104
|
"peerDependenciesMeta": {
|
|
105
105
|
"@absolutejs/isolated-jsc": {
|