mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-03 12:27:41 +08:00
refactor: bump AI SDK deps and fix provider API host formatting
- Bump @ai-sdk/* packages to latest versions and update patches
- Fix newapi provider: defer API version suffix to build phase so gemini
endpoints get /v1beta instead of /v1
- Fix Azure provider: split host formatting so azure-anthropic (Claude)
endpoints don't get the /openai suffix meant for Azure OpenAI
- Re-add @ai-sdk/google getModelPath patch (includes("models/") check)
- Support azure-openai provider type in Claude Code agent service by
auto-constructing the /anthropic base URL for Claude models
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
This commit is contained in:
4
.changeset/bump-ai-sdk-deps.md
Normal file
4
.changeset/bump-ai-sdk-deps.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
---
|
||||
|
||||
Bump AI SDK dependencies and fix provider API host formatting
|
||||
25
package.json
25
package.json
@@ -84,7 +84,6 @@
|
||||
"ci": "pnpm ci:basic-check && pnpm ci:test-check"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/groq": "^3.0.31",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.2.81",
|
||||
"@expo/sudo-prompt": "^9.3.2",
|
||||
"@larksuiteoapi/node-sdk": "^1.59.0",
|
||||
@@ -114,24 +113,25 @@
|
||||
"@agentic/exa": "^7.3.3",
|
||||
"@agentic/searxng": "^7.3.3",
|
||||
"@agentic/tavily": "^7.3.3",
|
||||
"@ai-sdk/amazon-bedrock": "^4.0.77",
|
||||
"@ai-sdk/amazon-bedrock": "^4.0.87",
|
||||
"@ai-sdk/anthropic": "^3.0.58",
|
||||
"@ai-sdk/azure": "^3.0.42",
|
||||
"@ai-sdk/azure": "^3.0.50",
|
||||
"@ai-sdk/cerebras": "^2.0.39",
|
||||
"@ai-sdk/cohere": "^3.0.25",
|
||||
"@ai-sdk/gateway": "^3.0.66",
|
||||
"@ai-sdk/google": "^3.0.43",
|
||||
"@ai-sdk/google-vertex": "^4.0.80",
|
||||
"@ai-sdk/gateway": "^3.0.85",
|
||||
"@ai-sdk/google": "^3.0.55",
|
||||
"@ai-sdk/google-vertex": "^4.0.98",
|
||||
"@ai-sdk/groq": "^3.0.32",
|
||||
"@ai-sdk/huggingface": "^1.0.37",
|
||||
"@ai-sdk/mistral": "^3.0.24",
|
||||
"@ai-sdk/openai": "^3.0.41",
|
||||
"@ai-sdk/openai-compatible": "^2.0.35",
|
||||
"@ai-sdk/openai": "^3.0.49",
|
||||
"@ai-sdk/openai-compatible": "^2.0.37",
|
||||
"@ai-sdk/perplexity": "^3.0.23",
|
||||
"@ai-sdk/provider": "^3.0.8",
|
||||
"@ai-sdk/provider-utils": "^4.0.19",
|
||||
"@ai-sdk/test-server": "^1.0.3",
|
||||
"@ai-sdk/togetherai": "^2.0.39",
|
||||
"@ai-sdk/xai": "^3.0.67",
|
||||
"@ai-sdk/xai": "^3.0.75",
|
||||
"@ant-design/cssinjs": "1.23.0",
|
||||
"@ant-design/icons": "5.6.1",
|
||||
"@ant-design/v5-patch-for-react-19": "^1.0.3",
|
||||
@@ -279,7 +279,7 @@
|
||||
"@viz-js/viz": "^3.14.0",
|
||||
"@xyflow/react": "^12.4.4",
|
||||
"adm-zip": "0.4.16",
|
||||
"ai": "^6.0.116",
|
||||
"ai": "^6.0.143",
|
||||
"ansi-to-react": "^6.2.6",
|
||||
"antd": "5.27.0",
|
||||
"archiver": "^7.0.1",
|
||||
@@ -493,9 +493,10 @@
|
||||
"libsql@0.4.7": "patches/libsql-npm-0.4.7-444e260fb1.patch",
|
||||
"pdf-parse@1.1.1": "patches/pdf-parse-npm-1.1.1-04a6109b2a.patch",
|
||||
"ollama-ai-provider-v2@3.3.1": "patches/ollama-ai-provider-v2@3.3.1.patch",
|
||||
"@ai-sdk/openai-compatible@2.0.35": "patches/@ai-sdk__openai-compatible@2.0.35.patch",
|
||||
"@openrouter/ai-sdk-provider": "patches/@openrouter__ai-sdk-provider.patch",
|
||||
"@opeoginni/github-copilot-openai-compatible@1.0.0": "patches/@opeoginni__github-copilot-openai-compatible@1.0.0.patch"
|
||||
"@opeoginni/github-copilot-openai-compatible@1.0.0": "patches/@opeoginni__github-copilot-openai-compatible@1.0.0.patch",
|
||||
"@ai-sdk/openai-compatible@2.0.37": "patches/@ai-sdk__openai-compatible@2.0.37.patch",
|
||||
"@ai-sdk/google@3.0.55": "patches/@ai-sdk__google@3.0.55.patch"
|
||||
},
|
||||
"onlyBuiltDependencies": [
|
||||
"@j178/prek",
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ai-sdk/anthropic": "^3.0.58",
|
||||
"@ai-sdk/google": "^3.0.43",
|
||||
"@ai-sdk/openai": "^3.0.41",
|
||||
"@ai-sdk/openai-compatible": "^2.0.35"
|
||||
"@ai-sdk/google": "^3.0.55",
|
||||
"@ai-sdk/openai": "^3.0.49",
|
||||
"@ai-sdk/openai-compatible": "^2.0.37"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/provider": "^3.0.8",
|
||||
|
||||
@@ -31,20 +31,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/CherryHQ/cherry-studio#readme",
|
||||
"peerDependencies": {
|
||||
"@ai-sdk/google": "^3.0.43",
|
||||
"@ai-sdk/openai": "^3.0.41",
|
||||
"@ai-sdk/google": "^3.0.55",
|
||||
"@ai-sdk/openai": "^3.0.49",
|
||||
"ai": "^6.0.116"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cherrystudio/ai-sdk-provider": "workspace:*",
|
||||
"@ai-sdk/anthropic": "^3.0.58",
|
||||
"@ai-sdk/azure": "^3.0.42",
|
||||
"@ai-sdk/azure": "^3.0.50",
|
||||
"@ai-sdk/deepseek": "^2.0.24",
|
||||
"@ai-sdk/openai-compatible": "^2.0.35",
|
||||
"@ai-sdk/openai-compatible": "^2.0.37",
|
||||
"@openrouter/ai-sdk-provider": "^2.3.3",
|
||||
"@ai-sdk/provider": "^3.0.8",
|
||||
"@ai-sdk/provider-utils": "^4.0.19",
|
||||
"@ai-sdk/xai": "^3.0.67",
|
||||
"@ai-sdk/xai": "^3.0.75",
|
||||
"lru-cache": "^11.2.4",
|
||||
"zod": "^4.1.5"
|
||||
},
|
||||
|
||||
52
patches/@ai-sdk__google@3.0.55.patch
Normal file
52
patches/@ai-sdk__google@3.0.55.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
index a3ff6e37d6dcac474833e05f678bb315de354ac3..a47ee95dbf6ba0bc786546a3c607dea7b8b2eb48 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -698,7 +698,7 @@
|
||||
|
||||
// src/get-model-path.ts
|
||||
function getModelPath(modelId) {
|
||||
- return modelId.includes("/") ? modelId : `models/${modelId}`;
|
||||
+ return modelId.includes("models/") ? modelId : `models/${modelId}`;
|
||||
}
|
||||
|
||||
// src/google-generative-ai-options.ts
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
index b658b194a4d8957509420908478b7ee0cbb9ee1f..0623050b93859f61a3597f4d0b2ea82fcbef6336 100644
|
||||
--- a/dist/index.mjs
|
||||
+++ b/dist/index.mjs
|
||||
@@ -704,7 +704,7 @@
|
||||
|
||||
// src/get-model-path.ts
|
||||
function getModelPath(modelId) {
|
||||
- return modelId.includes("/") ? modelId : `models/${modelId}`;
|
||||
+ return modelId.includes("models/") ? modelId : `models/${modelId}`;
|
||||
}
|
||||
|
||||
// src/google-generative-ai-options.ts
|
||||
diff --git a/dist/internal/index.js b/dist/internal/index.js
|
||||
index 1234567890abcdef..abcdef1234567890 100644
|
||||
--- a/dist/internal/index.js
|
||||
+++ b/dist/internal/index.js
|
||||
@@ -487,7 +487,7 @@
|
||||
|
||||
// src/get-model-path.ts
|
||||
function getModelPath(modelId) {
|
||||
- return modelId.includes("/") ? modelId : `models/${modelId}`;
|
||||
+ return modelId.includes("models/") ? modelId : `models/${modelId}`;
|
||||
}
|
||||
|
||||
// src/google-error.ts
|
||||
diff --git a/dist/internal/index.mjs b/dist/internal/index.mjs
|
||||
index abcdef1234567890..1234567890abcdef 100644
|
||||
--- a/dist/internal/index.mjs
|
||||
+++ b/dist/internal/index.mjs
|
||||
@@ -470,7 +470,7 @@
|
||||
|
||||
// src/get-model-path.ts
|
||||
function getModelPath(modelId) {
|
||||
- return modelId.includes("/") ? modelId : `models/${modelId}`;
|
||||
+ return modelId.includes("models/") ? modelId : `models/${modelId}`;
|
||||
}
|
||||
|
||||
// src/google-error.ts
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
index f5902dd4342750bf651a5f454d8d965bf91cf20d..6d906f880de4946cbae375bd3707137cdb50f752 100644
|
||||
index d73573b013e61903991cad2074187a3ade8921ab..919cbb2d14c0019716080c1bf041dde96c2b6cab 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -570,6 +570,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
@@ -572,6 +572,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
text: reasoning
|
||||
});
|
||||
}
|
||||
@@ -20,7 +20,7 @@ index f5902dd4342750bf651a5f454d8d965bf91cf20d..6d906f880de4946cbae375bd3707137c
|
||||
if (choice.message.tool_calls != null) {
|
||||
for (const toolCall of choice.message.tool_calls) {
|
||||
const thoughtSignature = (_c = (_b = toolCall.extra_content) == null ? void 0 : _b.google) == null ? void 0 : _c.thought_signature;
|
||||
@@ -730,6 +741,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
@@ -732,6 +743,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
delta: delta.content
|
||||
});
|
||||
}
|
||||
@@ -38,7 +38,7 @@ index f5902dd4342750bf651a5f454d8d965bf91cf20d..6d906f880de4946cbae375bd3707137c
|
||||
if (delta.tool_calls != null) {
|
||||
if (isActiveReasoning) {
|
||||
controller.enqueue({
|
||||
@@ -926,6 +948,14 @@ var OpenAICompatibleChatResponseSchema = import_v43.z.looseObject({
|
||||
@@ -928,6 +950,14 @@ var OpenAICompatibleChatResponseSchema = import_v43.z.looseObject({
|
||||
}).nullish()
|
||||
}).nullish()
|
||||
})
|
||||
@@ -53,7 +53,7 @@ index f5902dd4342750bf651a5f454d8d965bf91cf20d..6d906f880de4946cbae375bd3707137c
|
||||
).nullish()
|
||||
}),
|
||||
finish_reason: import_v43.z.string().nullish()
|
||||
@@ -962,6 +992,14 @@ var chunkBaseSchema = import_v43.z.looseObject({
|
||||
@@ -964,6 +994,14 @@ var chunkBaseSchema = import_v43.z.looseObject({
|
||||
}).nullish()
|
||||
}).nullish()
|
||||
})
|
||||
@@ -69,10 +69,10 @@ index f5902dd4342750bf651a5f454d8d965bf91cf20d..6d906f880de4946cbae375bd3707137c
|
||||
}).nullish(),
|
||||
finish_reason: import_v43.z.string().nullish()
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
index 75d3b9d8fdb57e9eca7d9590a45a85340427fe59..302b7d62fb7291f7028bdf51525ac95759e0fa5f 100644
|
||||
index 237c9e209da9da2d4d557eb309e1adc2157c1426..2e140f053bb9d7e88ed6b54238d355e7f5aae49b 100644
|
||||
--- a/dist/index.mjs
|
||||
+++ b/dist/index.mjs
|
||||
@@ -554,6 +554,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
@@ -559,6 +559,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
text: reasoning
|
||||
});
|
||||
}
|
||||
@@ -90,7 +90,7 @@ index 75d3b9d8fdb57e9eca7d9590a45a85340427fe59..302b7d62fb7291f7028bdf51525ac957
|
||||
if (choice.message.tool_calls != null) {
|
||||
for (const toolCall of choice.message.tool_calls) {
|
||||
const thoughtSignature = (_c = (_b = toolCall.extra_content) == null ? void 0 : _b.google) == null ? void 0 : _c.thought_signature;
|
||||
@@ -714,6 +725,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
@@ -719,6 +730,17 @@ var OpenAICompatibleChatLanguageModel = class {
|
||||
delta: delta.content
|
||||
});
|
||||
}
|
||||
@@ -108,7 +108,7 @@ index 75d3b9d8fdb57e9eca7d9590a45a85340427fe59..302b7d62fb7291f7028bdf51525ac957
|
||||
if (delta.tool_calls != null) {
|
||||
if (isActiveReasoning) {
|
||||
controller.enqueue({
|
||||
@@ -910,6 +932,14 @@ var OpenAICompatibleChatResponseSchema = z3.looseObject({
|
||||
@@ -915,6 +937,14 @@ var OpenAICompatibleChatResponseSchema = z3.looseObject({
|
||||
}).nullish()
|
||||
}).nullish()
|
||||
})
|
||||
@@ -123,7 +123,7 @@ index 75d3b9d8fdb57e9eca7d9590a45a85340427fe59..302b7d62fb7291f7028bdf51525ac957
|
||||
).nullish()
|
||||
}),
|
||||
finish_reason: z3.string().nullish()
|
||||
@@ -946,6 +976,14 @@ var chunkBaseSchema = z3.looseObject({
|
||||
@@ -951,6 +981,14 @@ var chunkBaseSchema = z3.looseObject({
|
||||
}).nullish()
|
||||
}).nullish()
|
||||
})
|
||||
266
pnpm-lock.yaml
generated
266
pnpm-lock.yaml
generated
@@ -33,9 +33,12 @@ overrides:
|
||||
'@napi-rs/canvas': 0.1.97
|
||||
|
||||
patchedDependencies:
|
||||
'@ai-sdk/openai-compatible@2.0.35':
|
||||
hash: 75058a2443f9c0eb3d44e09a419a2c9720e51329bbb174019c772e57521843f1
|
||||
path: patches/@ai-sdk__openai-compatible@2.0.35.patch
|
||||
'@ai-sdk/google@3.0.55':
|
||||
hash: 61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959
|
||||
path: patches/@ai-sdk__google@3.0.55.patch
|
||||
'@ai-sdk/openai-compatible@2.0.37':
|
||||
hash: d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a
|
||||
path: patches/@ai-sdk__openai-compatible@2.0.37.patch
|
||||
'@langchain/core@1.0.2':
|
||||
hash: 8dc787a82cebafe8b23c8826f25f29aca64fc8b43a0a1878e0010782e4da96ed
|
||||
path: patches/@langchain-core-npm-1.0.2-183ef83fe4.patch
|
||||
@@ -83,9 +86,6 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@ai-sdk/groq':
|
||||
specifier: ^3.0.31
|
||||
version: 3.0.31(zod@4.3.4)
|
||||
'@anthropic-ai/claude-agent-sdk':
|
||||
specifier: 0.2.81
|
||||
version: 0.2.81(zod@4.3.4)
|
||||
@@ -169,14 +169,14 @@ importers:
|
||||
specifier: ^7.3.3
|
||||
version: 7.6.9(zod@4.3.4)
|
||||
'@ai-sdk/amazon-bedrock':
|
||||
specifier: ^4.0.77
|
||||
version: 4.0.83(zod@4.3.4)
|
||||
specifier: ^4.0.87
|
||||
version: 4.0.87(zod@4.3.4)
|
||||
'@ai-sdk/anthropic':
|
||||
specifier: ^3.0.58
|
||||
version: 3.0.64(zod@4.3.4)
|
||||
'@ai-sdk/azure':
|
||||
specifier: ^3.0.42
|
||||
version: 3.0.49(zod@4.3.4)
|
||||
specifier: ^3.0.50
|
||||
version: 3.0.50(zod@4.3.4)
|
||||
'@ai-sdk/cerebras':
|
||||
specifier: ^2.0.39
|
||||
version: 2.0.41(zod@4.3.4)
|
||||
@@ -184,14 +184,17 @@ importers:
|
||||
specifier: ^3.0.25
|
||||
version: 3.0.27(zod@4.3.4)
|
||||
'@ai-sdk/gateway':
|
||||
specifier: ^3.0.66
|
||||
version: 3.0.80(zod@4.3.4)
|
||||
specifier: ^3.0.85
|
||||
version: 3.0.85(zod@4.3.4)
|
||||
'@ai-sdk/google':
|
||||
specifier: ^3.0.43
|
||||
version: 3.0.43(zod@4.3.4)
|
||||
specifier: ^3.0.55
|
||||
version: 3.0.55(patch_hash=61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959)(zod@4.3.4)
|
||||
'@ai-sdk/google-vertex':
|
||||
specifier: ^4.0.80
|
||||
version: 4.0.95(zod@4.3.4)
|
||||
specifier: ^4.0.98
|
||||
version: 4.0.98(zod@4.3.4)
|
||||
'@ai-sdk/groq':
|
||||
specifier: ^3.0.32
|
||||
version: 3.0.32(zod@4.3.4)
|
||||
'@ai-sdk/huggingface':
|
||||
specifier: ^1.0.37
|
||||
version: 1.0.39(zod@4.3.4)
|
||||
@@ -199,11 +202,11 @@ importers:
|
||||
specifier: ^3.0.24
|
||||
version: 3.0.27(zod@4.3.4)
|
||||
'@ai-sdk/openai':
|
||||
specifier: ^3.0.41
|
||||
version: 3.0.48(zod@4.3.4)
|
||||
specifier: ^3.0.49
|
||||
version: 3.0.49(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible':
|
||||
specifier: ^2.0.35
|
||||
version: 2.0.35(patch_hash=75058a2443f9c0eb3d44e09a419a2c9720e51329bbb174019c772e57521843f1)(zod@4.3.4)
|
||||
specifier: ^2.0.37
|
||||
version: 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/perplexity':
|
||||
specifier: ^3.0.23
|
||||
version: 3.0.26(zod@4.3.4)
|
||||
@@ -220,8 +223,8 @@ importers:
|
||||
specifier: ^2.0.39
|
||||
version: 2.0.41(zod@4.3.4)
|
||||
'@ai-sdk/xai':
|
||||
specifier: ^3.0.67
|
||||
version: 3.0.74(zod@4.3.4)
|
||||
specifier: ^3.0.75
|
||||
version: 3.0.75(zod@4.3.4)
|
||||
'@ant-design/cssinjs':
|
||||
specifier: 1.23.0
|
||||
version: 1.23.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
@@ -395,7 +398,7 @@ importers:
|
||||
version: 2.3.0(encoding@0.1.13)
|
||||
'@openrouter/ai-sdk-provider':
|
||||
specifier: ^2.3.3
|
||||
version: 2.3.3(patch_hash=508e8e662b8547de93410cb7c3b1336077f34c6bf79c520ef5273962ea777c52)(ai@6.0.138(zod@4.3.4))(zod@4.3.4)
|
||||
version: 2.3.3(patch_hash=508e8e662b8547de93410cb7c3b1336077f34c6bf79c520ef5273962ea777c52)(ai@6.0.143(zod@4.3.4))(zod@4.3.4)
|
||||
'@opentelemetry/api':
|
||||
specifier: ^1.9.0
|
||||
version: 1.9.0
|
||||
@@ -664,8 +667,8 @@ importers:
|
||||
specifier: 0.4.16
|
||||
version: 0.4.16
|
||||
ai:
|
||||
specifier: ^6.0.116
|
||||
version: 6.0.138(zod@4.3.4)
|
||||
specifier: ^6.0.143
|
||||
version: 6.0.143(zod@4.3.4)
|
||||
ansi-to-react:
|
||||
specifier: ^6.2.6
|
||||
version: 6.2.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
@@ -935,7 +938,7 @@ importers:
|
||||
version: 1.3.0
|
||||
ollama-ai-provider-v2:
|
||||
specifier: 3.3.1
|
||||
version: 3.3.1(patch_hash=8aceca32b8ea722ca9955177622f35735676b9c573fa7347f7d9b28e6210d3bb)(ai@6.0.138(zod@4.3.4))(zod@4.3.4)
|
||||
version: 3.3.1(patch_hash=8aceca32b8ea722ca9955177622f35735676b9c573fa7347f7d9b28e6210d3bb)(ai@6.0.143(zod@4.3.4))(zod@4.3.4)
|
||||
open:
|
||||
specifier: ^8.4.2
|
||||
version: 8.4.2
|
||||
@@ -1286,14 +1289,14 @@ importers:
|
||||
specifier: ^3.0.58
|
||||
version: 3.0.64(zod@4.3.6)
|
||||
'@ai-sdk/google':
|
||||
specifier: ^3.0.43
|
||||
version: 3.0.53(zod@4.3.6)
|
||||
specifier: ^3.0.55
|
||||
version: 3.0.55(patch_hash=61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959)(zod@4.3.6)
|
||||
'@ai-sdk/openai':
|
||||
specifier: ^3.0.41
|
||||
version: 3.0.48(zod@4.3.6)
|
||||
specifier: ^3.0.49
|
||||
version: 3.0.49(zod@4.3.6)
|
||||
'@ai-sdk/openai-compatible':
|
||||
specifier: ^2.0.35
|
||||
version: 2.0.37(zod@4.3.6)
|
||||
specifier: ^2.0.37
|
||||
version: 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.6)
|
||||
'@ai-sdk/provider':
|
||||
specifier: ^3.0.8
|
||||
version: 3.0.8
|
||||
@@ -1317,20 +1320,20 @@ importers:
|
||||
specifier: ^3.0.58
|
||||
version: 3.0.64(zod@4.3.4)
|
||||
'@ai-sdk/azure':
|
||||
specifier: ^3.0.42
|
||||
version: 3.0.49(zod@4.3.4)
|
||||
specifier: ^3.0.50
|
||||
version: 3.0.50(zod@4.3.4)
|
||||
'@ai-sdk/deepseek':
|
||||
specifier: ^2.0.24
|
||||
version: 2.0.26(zod@4.3.4)
|
||||
'@ai-sdk/google':
|
||||
specifier: ^3.0.43
|
||||
version: 3.0.53(zod@4.3.4)
|
||||
specifier: ^3.0.55
|
||||
version: 3.0.55(patch_hash=61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959)(zod@4.3.4)
|
||||
'@ai-sdk/openai':
|
||||
specifier: ^3.0.41
|
||||
version: 3.0.48(zod@4.3.4)
|
||||
specifier: ^3.0.49
|
||||
version: 3.0.49(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible':
|
||||
specifier: ^2.0.35
|
||||
version: 2.0.37(zod@4.3.4)
|
||||
specifier: ^2.0.37
|
||||
version: 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider':
|
||||
specifier: ^3.0.8
|
||||
version: 3.0.8
|
||||
@@ -1338,17 +1341,17 @@ importers:
|
||||
specifier: ^4.0.19
|
||||
version: 4.0.21(zod@4.3.4)
|
||||
'@ai-sdk/xai':
|
||||
specifier: ^3.0.67
|
||||
version: 3.0.74(zod@4.3.4)
|
||||
specifier: ^3.0.75
|
||||
version: 3.0.75(zod@4.3.4)
|
||||
'@cherrystudio/ai-sdk-provider':
|
||||
specifier: workspace:*
|
||||
version: link:../ai-sdk-provider
|
||||
'@openrouter/ai-sdk-provider':
|
||||
specifier: ^2.3.3
|
||||
version: 2.3.3(patch_hash=508e8e662b8547de93410cb7c3b1336077f34c6bf79c520ef5273962ea777c52)(ai@6.0.138(zod@4.3.4))(zod@4.3.4)
|
||||
version: 2.3.3(patch_hash=508e8e662b8547de93410cb7c3b1336077f34c6bf79c520ef5273962ea777c52)(ai@6.0.143(zod@4.3.4))(zod@4.3.4)
|
||||
ai:
|
||||
specifier: ^6.0.116
|
||||
version: 6.0.138(zod@4.3.4)
|
||||
version: 6.0.143(zod@4.3.4)
|
||||
lru-cache:
|
||||
specifier: ^11.2.4
|
||||
version: 11.2.4
|
||||
@@ -1427,8 +1430,8 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25.67
|
||||
|
||||
'@ai-sdk/amazon-bedrock@4.0.83':
|
||||
resolution: {integrity: sha512-DoRpvIWGU/r83UeJAM9L93Lca8Kf/yP5fIhfEOltMPGP/PXrGe0BZaz0maLSRn8djJ6+HzWIsgu5ZI6bZqXEXg==}
|
||||
'@ai-sdk/amazon-bedrock@4.0.87':
|
||||
resolution: {integrity: sha512-Deo3zkkTTk4rzxTAL2UQOKB1RT9X/H1k/1S0Zt4IXqxzz+PGcMsO57IwcQmUOreYy9ZwN6AVmdzTYnMlQ1wk1w==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
@@ -1439,8 +1442,8 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/azure@3.0.49':
|
||||
resolution: {integrity: sha512-wskgAL+OmrHG7by/iWIxEBQCEdc1mDudha/UZav46i0auzdFfsDB/k2rXZaC4/3nWSgMZkxr0W3ncyouEGX/eg==}
|
||||
'@ai-sdk/azure@3.0.50':
|
||||
resolution: {integrity: sha512-rw1YoADyXIKv3P/fRkK4hq9+u9XvnN6KZxXFnUQsVsxXk+TUIoIZ66FTrz1l+p7hzY+go0EmxmSMa/P/NXXT9A==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
@@ -1463,32 +1466,26 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/gateway@3.0.80':
|
||||
resolution: {integrity: sha512-uM7kpZB5l977lW7+2X1+klBUxIZQ78+1a9jHlaHFEzcOcmmslTl3sdP0QqfuuBcO0YBM2gwOiqVdp8i4TRQYcw==}
|
||||
'@ai-sdk/gateway@3.0.85':
|
||||
resolution: {integrity: sha512-oPvs3bYnxndBY/O0gFSFuc5aA/QKCJbk/CaJaRnKgA/ZPH17jeVvEtiUBE6/N8hWhK7XgX53NFI7F3CGmDfm1g==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/google-vertex@4.0.95':
|
||||
resolution: {integrity: sha512-xL44fHlTtDM7RLkMTgyqMfkfthA38JS91bbMaHItObIhte1PAIY936ZV1PLl/Z9A/oBAXjHWbXo5xDoHzB7LEg==}
|
||||
'@ai-sdk/google-vertex@4.0.98':
|
||||
resolution: {integrity: sha512-SOKKEC0Qer5TPWF4xPk+GPL2Sz5WhX8PzBKczE+Tz3W4MQbK7BpWaEG/uBgdRrb6ikB640+6nX0jtLDuC9kG+Q==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/google@3.0.43':
|
||||
resolution: {integrity: sha512-NGCgP5g8HBxrNdxvF8Dhww+UKfqAkZAmyYBvbu9YLoBkzAmGKDBGhVptN/oXPB5Vm0jggMdoLycZ8JReQM8Zqg==}
|
||||
'@ai-sdk/google@3.0.55':
|
||||
resolution: {integrity: sha512-lIID7kDdeqzSR/eg+LrEFJGoe/mIwuW4eBdjS84Bi0cIY4cmGwSsvwYILSdiad0197Ha+DUbCxOUuSOnORUx7g==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/google@3.0.53':
|
||||
resolution: {integrity: sha512-uz8tIlkDgQJG9Js2Wh9JHzd4kI9+hYJqf9XXJLx60vyN5mRIqhr49iwR5zGP5Gl8odp2PeR3Gh2k+5bh3Z1HHw==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/groq@3.0.31':
|
||||
resolution: {integrity: sha512-XbbugpnFmXGu2TlXiq8KUJskP6/VVbuFcnFIGDzDIB/Chg6XHsNnqrTF80Zxkh0Pd3+NvbM+2Uqrtsndk6bDAg==}
|
||||
'@ai-sdk/groq@3.0.32':
|
||||
resolution: {integrity: sha512-cKa+viBUgkY0GVWDAMYYOaRS+r9PNJvstfLujqi8YQSlpknQsE+J9TeG8b8bjkAnMnCpUd8s/ZEJHMuKzp+rYQ==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
@@ -1505,20 +1502,14 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/openai-compatible@2.0.35':
|
||||
resolution: {integrity: sha512-g3wA57IAQFb+3j4YuFndgkUdXyRETZVvbfAWM+UX7bZSxA3xjes0v3XKgIdKdekPtDGsh4ZX2byHD0gJIMPfiA==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/openai-compatible@2.0.37':
|
||||
resolution: {integrity: sha512-+POSFVcgiu47BK64dhsI6OpcDC0/VAE2ZSaXdXGNNhpC/ava++uSRJYks0k2bpfY0wwCTgpAWZsXn/dG2Yppiw==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/openai@3.0.48':
|
||||
resolution: {integrity: sha512-ALmj/53EXpcRqMbGpPJPP4UOSWw0q4VGpnDo7YctvsynjkrKDmoneDG/1a7VQnSPYHnJp6tTRMf5ZdxZ5whulg==}
|
||||
'@ai-sdk/openai@3.0.49':
|
||||
resolution: {integrity: sha512-U2f0pCyNn/jQH3wjgxr8o9VvCkuDFTtXbIhbFFtgXqCzMbed6rBnvzQcAMEK0/Pa44byL9zfcvCOFOflvkRA8w==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
@@ -1529,12 +1520,6 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/provider-utils@4.0.19':
|
||||
resolution: {integrity: sha512-3eG55CrSWCu2SXlqq2QCsFjo3+E7+Gmg7i/oRVoSZzIodTuDSfLb3MRje67xE9RFea73Zao7Lm4mADIfUETKGg==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/provider-utils@4.0.21':
|
||||
resolution: {integrity: sha512-MtFUYI1/8mgDvRmaBDjbLJPFFrMG777AvSgyIFQtZHIMzm88R/12vYBBpnk7pfiWLFE1DSZzY4WDYzGbKAcmiw==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -1555,8 +1540,8 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
|
||||
'@ai-sdk/xai@3.0.74':
|
||||
resolution: {integrity: sha512-HDDLsT+QrzE3c2QZLRV/HKAwMtXDb0PMDdk1PYUXLJ3r9Qv76zGKGyvJLX7Pu6c8TOHD1mwLrOVYrsTpC/eTMw==}
|
||||
'@ai-sdk/xai@3.0.75':
|
||||
resolution: {integrity: sha512-V8UKK4fNpI9cnrtsZBvUp9O9J6Y9fTKBRoSLyEaNGPirACewixmLDbXsSgAeownPVWiWpK34bFysd+XouI5Ywg==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
@@ -5940,10 +5925,12 @@ packages:
|
||||
'@xmldom/xmldom@0.8.11':
|
||||
resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
deprecated: this version has critical issues, please update to the latest version
|
||||
|
||||
'@xmldom/xmldom@0.9.8':
|
||||
resolution: {integrity: sha512-p96FSY54r+WJ50FIOsCOjyj/wavs8921hG5+kVMmZgKcvIKxMXHTrjNJvRgWa/zuX3B6t2lijLNFaOyuxUH+2A==}
|
||||
engines: {node: '>=14.6'}
|
||||
deprecated: this version has critical issues, please update to the latest version
|
||||
|
||||
'@xyflow/react@12.10.0':
|
||||
resolution: {integrity: sha512-eOtz3whDMWrB4KWVatIBrKuxECHqip6PfA8fTpaS2RUGVpiEAe+nqDKsLqkViVWxDGreq0lWX71Xth/SPAzXiw==}
|
||||
@@ -5988,8 +5975,8 @@ packages:
|
||||
resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==}
|
||||
engines: {node: '>= 8.0.0'}
|
||||
|
||||
ai@6.0.138:
|
||||
resolution: {integrity: sha512-49OfPe0f5uxJ6jUdA5BBXjIinP6+ZdYfAtpF2aEH64GA5wPcxH2rf/TBUQQ0bbamBz/D+TLMV18xilZqOC+zaA==}
|
||||
ai@6.0.143:
|
||||
resolution: {integrity: sha512-wVDb7StQ1EPQ9GDAOmi1AsuAXQRSii+zZT2sFK+MCisH4vV7XNEAdzXL+sKsUAFhhq+EtVFWWlB4mCk4hcoIMw==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
zod: ^3.25.76 || ^4.1.8
|
||||
@@ -6208,6 +6195,9 @@ packages:
|
||||
axios@1.13.6:
|
||||
resolution: {integrity: sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==}
|
||||
|
||||
axios@1.14.0:
|
||||
resolution: {integrity: sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==}
|
||||
|
||||
b4a@1.7.3:
|
||||
resolution: {integrity: sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==}
|
||||
peerDependencies:
|
||||
@@ -9272,6 +9262,9 @@ packages:
|
||||
lodash@4.17.23:
|
||||
resolution: {integrity: sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==}
|
||||
|
||||
lodash@4.18.1:
|
||||
resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==}
|
||||
|
||||
log-symbols@4.1.0:
|
||||
resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -10572,6 +10565,10 @@ packages:
|
||||
proxy-from-env@1.1.0:
|
||||
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
||||
|
||||
proxy-from-env@2.1.0:
|
||||
resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
psl@1.15.0:
|
||||
resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==}
|
||||
|
||||
@@ -12791,6 +12788,11 @@ packages:
|
||||
peerDependencies:
|
||||
zod: ^3.25 || ^4
|
||||
|
||||
zod-to-json-schema@3.25.2:
|
||||
resolution: {integrity: sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==}
|
||||
peerDependencies:
|
||||
zod: ^3.25.28 || ^4
|
||||
|
||||
zod-validation-error@3.5.4:
|
||||
resolution: {integrity: sha512-+hEiRIiPobgyuFlEojnqjJnhFvg4r/i3cqgcm67eehZf/WBaK3g6cD02YU9mtdVxZjv8CzCA9n/Rhrs3yAAvAw==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
@@ -12872,7 +12874,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- babel-plugin-macros
|
||||
|
||||
'@ai-sdk/amazon-bedrock@4.0.83(zod@4.3.4)':
|
||||
'@ai-sdk/amazon-bedrock@4.0.87(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/anthropic': 3.0.64(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
@@ -12894,16 +12896,16 @@ snapshots:
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.6)
|
||||
zod: 4.3.6
|
||||
|
||||
'@ai-sdk/azure@3.0.49(zod@4.3.4)':
|
||||
'@ai-sdk/azure@3.0.50(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/openai': 3.0.48(zod@4.3.4)
|
||||
'@ai-sdk/openai': 3.0.49(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/cerebras@2.0.41(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/openai-compatible': 2.0.37(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible': 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
@@ -12920,17 +12922,18 @@ snapshots:
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/gateway@3.0.80(zod@4.3.4)':
|
||||
'@ai-sdk/gateway@3.0.85(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
'@vercel/oidc': 3.1.0
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/google-vertex@4.0.95(zod@4.3.4)':
|
||||
'@ai-sdk/google-vertex@4.0.98(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/anthropic': 3.0.64(zod@4.3.4)
|
||||
'@ai-sdk/google': 3.0.53(zod@4.3.4)
|
||||
'@ai-sdk/google': 3.0.55(patch_hash=61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959)(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible': 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
google-auth-library: 10.5.0
|
||||
@@ -12938,25 +12941,19 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@ai-sdk/google@3.0.43(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.19(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/google@3.0.53(zod@4.3.4)':
|
||||
'@ai-sdk/google@3.0.55(patch_hash=61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959)(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/google@3.0.53(zod@4.3.6)':
|
||||
'@ai-sdk/google@3.0.55(patch_hash=61e2f6fa9463b661654e527cf1a22d80f0852479b3c870fb8f1d5a4f9decb959)(zod@4.3.6)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.6)
|
||||
zod: 4.3.6
|
||||
|
||||
'@ai-sdk/groq@3.0.31(zod@4.3.4)':
|
||||
'@ai-sdk/groq@3.0.32(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
@@ -12964,7 +12961,7 @@ snapshots:
|
||||
|
||||
'@ai-sdk/huggingface@1.0.39(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/openai-compatible': 2.0.37(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible': 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
@@ -12975,31 +12972,25 @@ snapshots:
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/openai-compatible@2.0.35(patch_hash=75058a2443f9c0eb3d44e09a419a2c9720e51329bbb174019c772e57521843f1)(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.19(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/openai-compatible@2.0.37(zod@4.3.4)':
|
||||
'@ai-sdk/openai-compatible@2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/openai-compatible@2.0.37(zod@4.3.6)':
|
||||
'@ai-sdk/openai-compatible@2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.6)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.6)
|
||||
zod: 4.3.6
|
||||
|
||||
'@ai-sdk/openai@3.0.48(zod@4.3.4)':
|
||||
'@ai-sdk/openai@3.0.49(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/openai@3.0.48(zod@4.3.6)':
|
||||
'@ai-sdk/openai@3.0.49(zod@4.3.6)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.6)
|
||||
@@ -13011,13 +13002,6 @@ snapshots:
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/provider-utils@4.0.19(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@standard-schema/spec': 1.1.0
|
||||
eventsource-parser: 3.0.6
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/provider-utils@4.0.21(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
@@ -13045,14 +13029,14 @@ snapshots:
|
||||
|
||||
'@ai-sdk/togetherai@2.0.41(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/openai-compatible': 2.0.37(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible': 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@ai-sdk/xai@3.0.74(zod@4.3.4)':
|
||||
'@ai-sdk/xai@3.0.75(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/openai-compatible': 2.0.37(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible': 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
@@ -13823,7 +13807,7 @@ snapshots:
|
||||
openai: 6.15.0(ws@8.20.0)(zod@4.3.4)
|
||||
ws: 8.20.0
|
||||
zod: 4.3.4
|
||||
zod-to-json-schema: 3.25.1(zod@4.3.4)
|
||||
zod-to-json-schema: 3.25.2(zod@4.3.4)
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- encoding
|
||||
@@ -15201,7 +15185,7 @@ snapshots:
|
||||
|
||||
'@j178/prek@0.3.4':
|
||||
dependencies:
|
||||
axios: 1.13.6(debug@4.4.3)
|
||||
axios: 1.13.6
|
||||
axios-proxy-builder: 0.1.2
|
||||
console.table: 0.10.0
|
||||
detect-libc: 2.1.2
|
||||
@@ -15374,7 +15358,7 @@ snapshots:
|
||||
|
||||
'@larksuiteoapi/node-sdk@1.60.0':
|
||||
dependencies:
|
||||
axios: 1.13.6(debug@4.4.3)
|
||||
axios: 1.13.6
|
||||
lodash.identity: 3.0.0
|
||||
lodash.merge: 4.6.2
|
||||
lodash.pickby: 4.6.0
|
||||
@@ -15779,9 +15763,9 @@ snapshots:
|
||||
|
||||
'@open-draft/until@2.1.0': {}
|
||||
|
||||
'@openrouter/ai-sdk-provider@2.3.3(patch_hash=508e8e662b8547de93410cb7c3b1336077f34c6bf79c520ef5273962ea777c52)(ai@6.0.138(zod@4.3.4))(zod@4.3.4)':
|
||||
'@openrouter/ai-sdk-provider@2.3.3(patch_hash=508e8e662b8547de93410cb7c3b1336077f34c6bf79c520ef5273962ea777c52)(ai@6.0.143(zod@4.3.4))(zod@4.3.4)':
|
||||
dependencies:
|
||||
ai: 6.0.138(zod@4.3.4)
|
||||
ai: 6.0.143(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
'@opentelemetry/api-logs@0.200.0':
|
||||
@@ -15890,7 +15874,7 @@ snapshots:
|
||||
|
||||
'@opeoginni/github-copilot-openai-compatible@1.0.0(patch_hash=4bea0e526136ed32d0be4849ec5cbb41bd5de7b7418dd6920598357438cfef25)(zod@4.3.4)':
|
||||
dependencies:
|
||||
'@ai-sdk/openai-compatible': 2.0.35(patch_hash=75058a2443f9c0eb3d44e09a419a2c9720e51329bbb174019c772e57521843f1)(zod@4.3.4)
|
||||
'@ai-sdk/openai-compatible': 2.0.37(patch_hash=d24ef2c45b84eab205e51894a90c5c36e93e6e0b17f56533aa37145129539a1a)(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
transitivePeerDependencies:
|
||||
@@ -18517,9 +18501,9 @@ snapshots:
|
||||
dependencies:
|
||||
humanize-ms: 1.2.1
|
||||
|
||||
ai@6.0.138(zod@4.3.4):
|
||||
ai@6.0.143(zod@4.3.4):
|
||||
dependencies:
|
||||
'@ai-sdk/gateway': 3.0.80(zod@4.3.4)
|
||||
'@ai-sdk/gateway': 3.0.85(zod@4.3.4)
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
'@opentelemetry/api': 1.9.0
|
||||
@@ -18847,7 +18831,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
axios@1.13.6(debug@4.4.3):
|
||||
axios@1.13.6:
|
||||
dependencies:
|
||||
follow-redirects: 1.15.11(debug@4.4.3)
|
||||
form-data: 4.0.5
|
||||
@@ -18855,6 +18839,14 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
axios@1.14.0(debug@4.4.3):
|
||||
dependencies:
|
||||
follow-redirects: 1.15.11(debug@4.4.3)
|
||||
form-data: 4.0.5
|
||||
proxy-from-env: 2.1.0
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
b4a@1.7.3: {}
|
||||
|
||||
bail@1.0.5: {}
|
||||
@@ -20222,7 +20214,7 @@ snapshots:
|
||||
'@electron/asar': 3.4.1
|
||||
debug: 4.4.3
|
||||
fs-extra: 7.0.1
|
||||
lodash: 4.17.23
|
||||
lodash: 4.18.1
|
||||
temp: 0.9.4
|
||||
optionalDependencies:
|
||||
'@electron/windows-sign': 1.2.2
|
||||
@@ -21614,7 +21606,7 @@ snapshots:
|
||||
'@types/debug': 4.1.13
|
||||
'@types/node': 18.19.130
|
||||
'@types/tough-cookie': 4.0.5
|
||||
axios: 1.13.6(debug@4.4.3)
|
||||
axios: 1.14.0(debug@4.4.3)
|
||||
camelcase: 6.3.0
|
||||
debug: 4.4.3
|
||||
dotenv: 16.6.1
|
||||
@@ -21624,7 +21616,7 @@ snapshots:
|
||||
isstream: 0.1.2
|
||||
jsonwebtoken: 9.0.3
|
||||
mime-types: 2.1.35
|
||||
retry-axios: 2.6.0(axios@1.13.6(debug@4.4.3))
|
||||
retry-axios: 2.6.0(axios@1.14.0(debug@4.4.3))
|
||||
tough-cookie: 4.1.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@@ -22282,6 +22274,8 @@ snapshots:
|
||||
|
||||
lodash@4.17.23: {}
|
||||
|
||||
lodash@4.18.1: {}
|
||||
|
||||
log-symbols@4.1.0:
|
||||
dependencies:
|
||||
chalk: 4.1.2
|
||||
@@ -23345,11 +23339,11 @@ snapshots:
|
||||
node-ensure: 0.0.0
|
||||
rimraf: 5.0.10
|
||||
|
||||
ollama-ai-provider-v2@3.3.1(patch_hash=8aceca32b8ea722ca9955177622f35735676b9c573fa7347f7d9b28e6210d3bb)(ai@6.0.138(zod@4.3.4))(zod@4.3.4):
|
||||
ollama-ai-provider-v2@3.3.1(patch_hash=8aceca32b8ea722ca9955177622f35735676b9c573fa7347f7d9b28e6210d3bb)(ai@6.0.143(zod@4.3.4))(zod@4.3.4):
|
||||
dependencies:
|
||||
'@ai-sdk/provider': 3.0.8
|
||||
'@ai-sdk/provider-utils': 4.0.21(zod@4.3.4)
|
||||
ai: 6.0.138(zod@4.3.4)
|
||||
ai: 6.0.143(zod@4.3.4)
|
||||
zod: 4.3.4
|
||||
|
||||
ollama@0.5.18:
|
||||
@@ -23975,6 +23969,8 @@ snapshots:
|
||||
|
||||
proxy-from-env@1.1.0: {}
|
||||
|
||||
proxy-from-env@2.1.0: {}
|
||||
|
||||
psl@1.15.0:
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
@@ -24842,9 +24838,9 @@ snapshots:
|
||||
onetime: 5.1.2
|
||||
signal-exit: 3.0.7
|
||||
|
||||
retry-axios@2.6.0(axios@1.13.6(debug@4.4.3)):
|
||||
retry-axios@2.6.0(axios@1.14.0(debug@4.4.3)):
|
||||
dependencies:
|
||||
axios: 1.13.6(debug@4.4.3)
|
||||
axios: 1.14.0(debug@4.4.3)
|
||||
|
||||
retry@0.12.0: {}
|
||||
|
||||
@@ -26575,6 +26571,10 @@ snapshots:
|
||||
dependencies:
|
||||
zod: 4.3.4
|
||||
|
||||
zod-to-json-schema@3.25.2(zod@4.3.4):
|
||||
dependencies:
|
||||
zod: 4.3.4
|
||||
|
||||
zod-validation-error@3.5.4(zod@4.3.4):
|
||||
dependencies:
|
||||
zod: 4.3.4
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
formatAzureOpenAIApiHost,
|
||||
formatOllamaApiHost,
|
||||
isAnthropicProvider,
|
||||
isAzureOpenAIProvider,
|
||||
@@ -54,7 +53,7 @@ export async function formatProviderApiHost(provider: Provider): Promise<Provide
|
||||
{ match: isPerplexityProvider, format: (p) => formatApiHost(p.apiHost, false) },
|
||||
{ match: isOllamaProvider, format: (p) => formatOllamaApiHost(p.apiHost) },
|
||||
{ match: isGeminiProvider, format: (p, av) => formatApiHost(p.apiHost, av, 'v1beta') },
|
||||
{ match: isAzureOpenAIProvider, format: (p) => formatAzureOpenAIApiHost(p.apiHost) },
|
||||
{ match: isAzureOpenAIProvider, format: (p) => formatApiHost(p.apiHost, false) },
|
||||
{ match: isVertexProvider, format: (p) => formatVertexApiHost(p.apiHost) }
|
||||
]
|
||||
|
||||
|
||||
@@ -129,25 +129,35 @@ class ClaudeCodeService implements AgentServiceInterface {
|
||||
})
|
||||
return aiStream
|
||||
}
|
||||
if (
|
||||
modelInfo.provider?.type !== 'anthropic' &&
|
||||
(modelInfo.provider?.anthropicApiHost === undefined || modelInfo.provider.anthropicApiHost.trim() === '')
|
||||
) {
|
||||
const provider = modelInfo.provider
|
||||
if (!provider) {
|
||||
aiStream.emit('data', {
|
||||
type: 'error',
|
||||
error: new Error('Provider not found for model')
|
||||
})
|
||||
return aiStream
|
||||
}
|
||||
|
||||
const isAzureOpenAI = provider.type === 'azure-openai'
|
||||
const isAnthropicType = provider.type === 'anthropic'
|
||||
const hasAnthropicHost = provider.anthropicApiHost?.trim()
|
||||
|
||||
if (!isAnthropicType && !isAzureOpenAI && !hasAnthropicHost) {
|
||||
logger.error('Anthropic provider configuration is missing', {
|
||||
modelInfo
|
||||
})
|
||||
|
||||
aiStream.emit('data', {
|
||||
type: 'error',
|
||||
error: new Error(`Invalid provider type '${modelInfo.provider?.type}'. Expected 'anthropic' provider type.`)
|
||||
error: new Error(`Invalid provider type '${provider.type}'. Expected 'anthropic' provider type.`)
|
||||
})
|
||||
return aiStream
|
||||
}
|
||||
|
||||
// Providers like Ollama and LM Studio don't require real API keys,
|
||||
// but the Claude Agent SDK needs a non-empty placeholder value
|
||||
if (!modelInfo.provider.apiKey) {
|
||||
modelInfo.provider.apiKey = modelInfo.provider.id
|
||||
if (!provider.apiKey) {
|
||||
provider.apiKey = provider.id
|
||||
}
|
||||
|
||||
const apiConfig = await apiConfigService.get()
|
||||
@@ -160,9 +170,15 @@ class ClaudeCodeService implements AgentServiceInterface {
|
||||
// Claude Agent SDK builds the final endpoint as `${ANTHROPIC_BASE_URL}/v1/messages`.
|
||||
// To avoid malformed URLs like `/v1/v1/messages`, we normalize the provider host
|
||||
// by stripping any trailing API version (e.g. `/v1`).
|
||||
const anthropicBaseUrl = withoutTrailingApiVersion(
|
||||
modelInfo.provider.anthropicApiHost?.trim() || modelInfo.provider.apiHost
|
||||
)
|
||||
// For Azure OpenAI providers, the Anthropic endpoint lives under /anthropic.
|
||||
const resolveAnthropicBaseUrl = (): string => {
|
||||
if (isAzureOpenAI) {
|
||||
const host = withoutTrailingApiVersion(provider.apiHost).replace(/\/openai$/, '')
|
||||
return `${host}/anthropic`
|
||||
}
|
||||
return withoutTrailingApiVersion(provider.anthropicApiHost?.trim() || provider.apiHost)
|
||||
}
|
||||
const anthropicBaseUrl = resolveAnthropicBaseUrl()
|
||||
|
||||
const env = {
|
||||
...loginShellEnv,
|
||||
@@ -173,8 +189,8 @@ class ClaudeCodeService implements AgentServiceInterface {
|
||||
// ANTHROPIC_API_KEY: apiConfig.apiKey,
|
||||
// ANTHROPIC_AUTH_TOKEN: apiConfig.apiKey,
|
||||
// ANTHROPIC_BASE_URL: `http://${apiConfig.host}:${apiConfig.port}/${modelInfo.provider.id}`,
|
||||
ANTHROPIC_API_KEY: modelInfo.provider.apiKey,
|
||||
ANTHROPIC_AUTH_TOKEN: modelInfo.provider.apiKey,
|
||||
ANTHROPIC_API_KEY: provider.apiKey,
|
||||
ANTHROPIC_AUTH_TOKEN: provider.apiKey,
|
||||
ANTHROPIC_BASE_URL: anthropicBaseUrl,
|
||||
ANTHROPIC_MODEL: modelInfo.modelId,
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: modelInfo.modelId,
|
||||
|
||||
@@ -374,7 +374,7 @@ describe('formatProviderApiHost', () => {
|
||||
})
|
||||
|
||||
describe('Azure OpenAI provider', () => {
|
||||
it('strips /v1 and appends /openai', () => {
|
||||
it('normalizes apiHost without appending version (deferred to build phase)', () => {
|
||||
const provider = makeProvider({
|
||||
id: 'azure-openai',
|
||||
type: 'azure-openai',
|
||||
@@ -383,9 +383,21 @@ describe('formatProviderApiHost', () => {
|
||||
|
||||
const result = formatProviderApiHost(provider)
|
||||
|
||||
// formatAzureOpenAIApiHost strips /v1 and /openai then re-appends /openai
|
||||
// Azure now defers /openai suffix to buildAzureConfig; formatProviderApiHost only normalizes
|
||||
expect(result.apiHost).toBe('https://example.openai.azure.com/openai')
|
||||
})
|
||||
|
||||
it('does not append /v1 to bare Azure host', () => {
|
||||
const provider = makeProvider({
|
||||
id: 'azure-openai',
|
||||
type: 'azure-openai',
|
||||
apiHost: 'https://example.openai.azure.com'
|
||||
})
|
||||
|
||||
const result = formatProviderApiHost(provider)
|
||||
|
||||
expect(result.apiHost).toBe('https://example.openai.azure.com')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Vertex provider', () => {
|
||||
@@ -793,7 +805,7 @@ describe('providerToAiSdkConfig', () => {
|
||||
expect(config.providerId).toBe('cherryin')
|
||||
const settings = config.providerSettings as CherryInProviderSettings
|
||||
expect(settings.anthropicBaseURL).toBe('https://anthropic.cherryin.com/v1')
|
||||
expect(settings.geminiBaseURL).toBe('https://api.cherryin.com/v1beta/models')
|
||||
expect(settings.geminiBaseURL).toBe('https://api.cherryin.com/v1beta')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -898,7 +910,7 @@ describe('providerToAiSdkConfig', () => {
|
||||
makeModel('gpt-4', provider.id)
|
||||
)) as ProviderConfig<'openai-compatible'>
|
||||
|
||||
const settings = config.providerSettings as OpenAICompatibleProviderSettings
|
||||
const settings = config.providerSettings
|
||||
expect(settings.headers).toBeDefined()
|
||||
expect(settings.headers!['HTTP-Referer']).toBe('https://cherry-ai.com')
|
||||
expect(settings.headers!['X-Title']).toBe('Cherry Studio')
|
||||
@@ -917,7 +929,7 @@ describe('providerToAiSdkConfig', () => {
|
||||
makeModel('gpt-4', provider.id)
|
||||
)) as ProviderConfig<'openai-compatible'>
|
||||
|
||||
const settings = config.providerSettings as OpenAICompatibleProviderSettings
|
||||
const settings = config.providerSettings
|
||||
expect(settings.headers).toBeDefined()
|
||||
expect(settings.headers!['X-Custom']).toBe('custom-value')
|
||||
})
|
||||
|
||||
@@ -14,7 +14,6 @@ import store from '@renderer/store'
|
||||
import { type Model, type Provider, SystemProviderIds } from '@renderer/types'
|
||||
import {
|
||||
formatApiHost,
|
||||
formatAzureOpenAIApiHost,
|
||||
formatOllamaApiHost,
|
||||
formatVertexApiHost,
|
||||
isWithTrailingSharp,
|
||||
@@ -25,6 +24,7 @@ import {
|
||||
isAzureOpenAIProvider,
|
||||
isCherryAIProvider,
|
||||
isGeminiProvider,
|
||||
isNewApiProvider,
|
||||
isOllamaProvider,
|
||||
isPerplexityProvider,
|
||||
isSupportStreamOptionsProvider,
|
||||
@@ -85,9 +85,10 @@ export function formatProviderApiHost(provider: Provider): Provider {
|
||||
},
|
||||
{ match: isCherryAIProvider, format: (p) => formatApiHost(p.apiHost, false) },
|
||||
{ match: isPerplexityProvider, format: (p) => formatApiHost(p.apiHost, false) },
|
||||
{ match: isNewApiProvider, format: (p) => formatApiHost(p.apiHost, false) },
|
||||
{ match: isOllamaProvider, format: (p) => formatOllamaApiHost(p.apiHost) },
|
||||
{ match: isGeminiProvider, format: (p, av) => formatApiHost(p.apiHost, av, 'v1beta') },
|
||||
{ match: isAzureOpenAIProvider, format: (p) => formatAzureOpenAIApiHost(p.apiHost) },
|
||||
{ match: isAzureOpenAIProvider, format: (p) => formatApiHost(p.apiHost, false) },
|
||||
{ match: isVertexProvider, format: (p) => formatVertexApiHost(p as Parameters<typeof formatVertexApiHost>[0]) }
|
||||
]
|
||||
|
||||
@@ -258,7 +259,7 @@ function buildCherryinConfig(ctx: BuilderContext): ProviderConfig<'cherryin'> {
|
||||
...ctx.baseConfig,
|
||||
endpointType: ctx.model.endpoint_type,
|
||||
anthropicBaseURL: cherryinProvider ? cherryinProvider.anthropicApiHost + '/v1' : undefined,
|
||||
geminiBaseURL: cherryinProvider ? cherryinProvider.apiHost + '/v1beta/models' : undefined,
|
||||
geminiBaseURL: cherryinProvider ? cherryinProvider.apiHost + '/v1beta' : undefined,
|
||||
headers: { ...defaultAppHeaders(), ...ctx.actualProvider.extra_headers }
|
||||
}
|
||||
}
|
||||
@@ -285,6 +286,13 @@ async function buildCherryAIConfig(ctx: BuilderContext): Promise<ProviderConfig<
|
||||
}
|
||||
}
|
||||
|
||||
function formatAzureBaseURL(baseURL: string, forAnthropic: boolean): string {
|
||||
// Normalize: strip trailing /v1 and /openai that user may have included
|
||||
const normalized = baseURL.replace(/\/v1$/, '').replace(/\/openai$/, '')
|
||||
// Azure OpenAI endpoints need /openai suffix; Azure Anthropic does not
|
||||
return forAnthropic ? normalized : normalized + '/openai'
|
||||
}
|
||||
|
||||
function buildAzureConfig(
|
||||
ctx: BuilderContext
|
||||
): ProviderConfig<'azure'> | ProviderConfig<'azure-responses'> | ProviderConfig<'azure-anthropic'> {
|
||||
@@ -295,6 +303,7 @@ function buildAzureConfig(
|
||||
endpoint: ctx.endpoint,
|
||||
providerSettings: {
|
||||
...ctx.baseConfig,
|
||||
baseURL: formatAzureBaseURL(ctx.baseConfig.baseURL, true),
|
||||
headers: { ...defaultAppHeaders(), ...ctx.actualProvider.extra_headers }
|
||||
}
|
||||
}
|
||||
@@ -305,6 +314,7 @@ function buildAzureConfig(
|
||||
|
||||
const providerSettings: ProviderConfig<'azure'>['providerSettings'] = {
|
||||
...ctx.baseConfig,
|
||||
baseURL: formatAzureBaseURL(ctx.baseConfig.baseURL, false),
|
||||
headers: { ...defaultAppHeaders(), ...ctx.actualProvider.extra_headers }
|
||||
}
|
||||
|
||||
@@ -374,12 +384,26 @@ function buildAiHubMixConfig(ctx: BuilderContext): ProviderConfig<'aihubmix'> {
|
||||
}
|
||||
}
|
||||
|
||||
function formatNewApiBaseURL(baseURL: string, endpointType?: string): string {
|
||||
switch (endpointType) {
|
||||
case 'gemini':
|
||||
return formatApiHost(baseURL, true, 'v1beta')
|
||||
case 'anthropic':
|
||||
return formatApiHost(baseURL, false)
|
||||
default:
|
||||
return formatApiHost(baseURL, true)
|
||||
}
|
||||
}
|
||||
|
||||
function buildNewApiConfig(ctx: BuilderContext): ProviderConfig<'newapi'> {
|
||||
const baseURL = formatNewApiBaseURL(ctx.baseConfig.baseURL, ctx.model.endpoint_type)
|
||||
|
||||
return {
|
||||
providerId: 'newapi',
|
||||
endpoint: ctx.endpoint,
|
||||
providerSettings: {
|
||||
...ctx.baseConfig,
|
||||
baseURL,
|
||||
endpointType: ctx.model.endpoint_type,
|
||||
headers: { ...defaultAppHeaders(), ...ctx.actualProvider.extra_headers }
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ const togetherFetcher: ModelFetcher = {
|
||||
}
|
||||
|
||||
const newApiFetcher: ModelFetcher = {
|
||||
match: (p) => p.id === SystemProviderIds['new-api'] || p.type === 'new-api',
|
||||
match: (p) => p.id === SystemProviderIds['new-api'] || p.type === 'new-api' || p.id === SystemProviderIds.cherryin,
|
||||
fetch: async (provider, signal) => {
|
||||
const baseUrl = formatApiHost(provider.apiHost)
|
||||
const response = await getFromApi({
|
||||
|
||||
@@ -101,8 +101,10 @@ export const NewApiModelsResponseSchema = z.object({
|
||||
created: z.number().optional(),
|
||||
owned_by: z.string().optional(),
|
||||
supported_endpoint_types: z
|
||||
.array(z.enum(['openai', 'anthropic', 'gemini', 'openai-response', 'image-generation']))
|
||||
.array(z.string())
|
||||
.nullable()
|
||||
.optional()
|
||||
.transform((v) => v ?? undefined)
|
||||
})
|
||||
),
|
||||
object: z.literal('list').optional()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ActionIconButton } from '@renderer/components/Buttons'
|
||||
import type { QuickPanelListItem } from '@renderer/components/QuickPanel'
|
||||
import { QuickPanelReservedSymbol, useQuickPanel } from '@renderer/components/QuickPanel'
|
||||
import { isGeminiModel } from '@renderer/config/models'
|
||||
import { isGemini3Model, isGeminiModel } from '@renderer/config/models'
|
||||
import { useAssistant } from '@renderer/hooks/useAssistant'
|
||||
import { useMCPServers } from '@renderer/hooks/useMCPServers'
|
||||
import { useTimer } from '@renderer/hooks/useTimer'
|
||||
@@ -162,7 +162,8 @@ const MCPToolsButton: FC<Props> = ({ quickPanel, setInputValue, resizeTextArea,
|
||||
window.toast.warning(t('chat.mcp.warning.url_context'))
|
||||
update.enableUrlContext = false
|
||||
}
|
||||
if (isGeminiWebSearchProvider(provider) && assistant.enableWebSearch) {
|
||||
// Gemini 3+ supports combining built-in tools with function calling
|
||||
if (isGeminiWebSearchProvider(provider) && assistant.enableWebSearch && !isGemini3Model(model)) {
|
||||
window.toast.warning(t('chat.mcp.warning.gemini_web_search'))
|
||||
update.enableWebSearch = false
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
import type { QuickPanelListItem } from '@renderer/components/QuickPanel'
|
||||
import { QuickPanelReservedSymbol } from '@renderer/components/QuickPanel'
|
||||
import {
|
||||
isGemini3Model,
|
||||
isGeminiModel,
|
||||
isGPT5SeriesReasoningModel,
|
||||
isOpenAIWebSearchModel,
|
||||
@@ -111,9 +112,11 @@ export const useWebSearchPanelController = (assistantId: string, quickPanelContr
|
||||
window.toast.error(t('error.model.not_exists'))
|
||||
return
|
||||
}
|
||||
// Gemini 3+ supports combining built-in tools with function calling
|
||||
if (
|
||||
isGeminiWebSearchProvider(provider) &&
|
||||
isGeminiModel(model) &&
|
||||
!isGemini3Model(model) &&
|
||||
isToolUseModeFunction(assistant) &&
|
||||
update.enableWebSearch &&
|
||||
getEffectiveMcpMode(assistant) !== 'disabled'
|
||||
|
||||
@@ -160,7 +160,7 @@ const PopupContainer: React.FC<Props> = ({ providerId, resolve }) => {
|
||||
centered: true,
|
||||
onOk: () => {
|
||||
if (isNewApiProvider(provider)) {
|
||||
if (models.every(isValidNewApiModel)) {
|
||||
if (wouldAddModel.every(isValidNewApiModel)) {
|
||||
wouldAddModel.forEach(onAddModel)
|
||||
} else {
|
||||
void NewApiBatchAddModelPopup.show({
|
||||
|
||||
Reference in New Issue
Block a user