mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
refactor(presets): render presets in array order and prioritize partners
Remove the category-based grouping logic from ProviderPresetSelector, letting the array position in each preset config file be the single source of truth for display order. Move partner presets (PatewayAI, 火山Agentplan, BytePlus, DouBaoSeed) right after Shengsuanyun across all 6 config files so they appear earlier in the UI.
This commit is contained in:
@@ -395,25 +395,6 @@ export function ClaudeDesktopProviderForm({
|
||||
[],
|
||||
);
|
||||
|
||||
const groupedPresets = useMemo(
|
||||
() =>
|
||||
presetEntries.reduce<Record<string, PresetEntry[]>>((acc, entry) => {
|
||||
const cat = entry.preset.category ?? "others";
|
||||
if (!acc[cat]) acc[cat] = [];
|
||||
acc[cat].push(entry);
|
||||
return acc;
|
||||
}, {}),
|
||||
[presetEntries],
|
||||
);
|
||||
|
||||
const categoryKeys = useMemo(
|
||||
() =>
|
||||
Object.keys(groupedPresets).filter(
|
||||
(key) => key !== "custom" && groupedPresets[key]?.length,
|
||||
),
|
||||
[groupedPresets],
|
||||
);
|
||||
|
||||
const presetCategoryLabels: Record<string, string> = useMemo(
|
||||
() => ({
|
||||
official: t("providerForm.categoryOfficial", { defaultValue: "官方" }),
|
||||
@@ -777,8 +758,7 @@ export function ClaudeDesktopProviderForm({
|
||||
{!initialData && (
|
||||
<ProviderPresetSelector
|
||||
selectedPresetId={selectedPresetId}
|
||||
groupedPresets={groupedPresets}
|
||||
categoryKeys={categoryKeys}
|
||||
presetEntries={presetEntries}
|
||||
presetCategoryLabels={presetCategoryLabels}
|
||||
onPresetChange={handlePresetChange}
|
||||
category={activePreset?.category}
|
||||
|
||||
@@ -1251,23 +1251,6 @@ function ProviderFormFull({
|
||||
await onSubmit(payload);
|
||||
};
|
||||
|
||||
const groupedPresets = useMemo(() => {
|
||||
return presetEntries.reduce<Record<string, PresetEntry[]>>((acc, entry) => {
|
||||
const category = entry.preset.category ?? "others";
|
||||
if (!acc[category]) {
|
||||
acc[category] = [];
|
||||
}
|
||||
acc[category].push(entry);
|
||||
return acc;
|
||||
}, {});
|
||||
}, [presetEntries]);
|
||||
|
||||
const categoryKeys = useMemo(() => {
|
||||
return Object.keys(groupedPresets).filter(
|
||||
(key) => key !== "custom" && groupedPresets[key]?.length,
|
||||
);
|
||||
}, [groupedPresets]);
|
||||
|
||||
const shouldShowSpeedTest =
|
||||
category !== "official" && category !== "cloud_provider";
|
||||
|
||||
@@ -1553,8 +1536,7 @@ function ProviderFormFull({
|
||||
{!initialData && (
|
||||
<ProviderPresetSelector
|
||||
selectedPresetId={selectedPresetId}
|
||||
groupedPresets={groupedPresets}
|
||||
categoryKeys={categoryKeys}
|
||||
presetEntries={presetEntries}
|
||||
presetCategoryLabels={presetCategoryLabels}
|
||||
onPresetChange={handlePresetChange}
|
||||
onUniversalPresetSelect={onUniversalPresetSelect}
|
||||
|
||||
@@ -6,6 +6,9 @@ import type { ProviderPreset } from "@/config/claudeProviderPresets";
|
||||
import type { CodexProviderPreset } from "@/config/codexProviderPresets";
|
||||
import type { GeminiProviderPreset } from "@/config/geminiProviderPresets";
|
||||
import type { ClaudeDesktopProviderPreset } from "@/config/claudeDesktopProviderPresets";
|
||||
import type { OpenCodeProviderPreset } from "@/config/opencodeProviderPresets";
|
||||
import type { OpenClawProviderPreset } from "@/config/openclawProviderPresets";
|
||||
import type { HermesProviderPreset } from "@/config/hermesProviderPresets";
|
||||
import type { ProviderCategory } from "@/types";
|
||||
import {
|
||||
universalProviderPresets,
|
||||
@@ -17,7 +20,10 @@ type AnyPreset =
|
||||
| ProviderPreset
|
||||
| CodexProviderPreset
|
||||
| GeminiProviderPreset
|
||||
| ClaudeDesktopProviderPreset;
|
||||
| ClaudeDesktopProviderPreset
|
||||
| OpenCodeProviderPreset
|
||||
| OpenClawProviderPreset
|
||||
| HermesProviderPreset;
|
||||
|
||||
type PresetEntry = {
|
||||
id: string;
|
||||
@@ -26,8 +32,7 @@ type PresetEntry = {
|
||||
|
||||
interface ProviderPresetSelectorProps {
|
||||
selectedPresetId: string | null;
|
||||
groupedPresets: Record<string, PresetEntry[]>;
|
||||
categoryKeys: string[];
|
||||
presetEntries: PresetEntry[];
|
||||
presetCategoryLabels: Record<string, string>;
|
||||
onPresetChange: (value: string) => void;
|
||||
onUniversalPresetSelect?: (preset: UniversalProviderPreset) => void;
|
||||
@@ -37,8 +42,7 @@ interface ProviderPresetSelectorProps {
|
||||
|
||||
export function ProviderPresetSelector({
|
||||
selectedPresetId,
|
||||
groupedPresets,
|
||||
categoryKeys,
|
||||
presetEntries,
|
||||
presetCategoryLabels,
|
||||
onPresetChange,
|
||||
onUniversalPresetSelect,
|
||||
@@ -140,35 +144,33 @@ export function ProviderPresetSelector({
|
||||
{t("providerPreset.custom")}
|
||||
</button>
|
||||
|
||||
{categoryKeys.map((category) => {
|
||||
const entries = groupedPresets[category];
|
||||
if (!entries || entries.length === 0) return null;
|
||||
return entries.map((entry) => {
|
||||
const isSelected = selectedPresetId === entry.id;
|
||||
const isPartner = entry.preset.isPartner;
|
||||
return (
|
||||
<button
|
||||
key={entry.id}
|
||||
type="button"
|
||||
onClick={() => onPresetChange(entry.id)}
|
||||
className={`${getPresetButtonClass(isSelected, entry.preset)} relative`}
|
||||
style={getPresetButtonStyle(isSelected, entry.preset)}
|
||||
title={
|
||||
presetCategoryLabels[category] ?? t("providerPreset.other")
|
||||
}
|
||||
>
|
||||
{renderPresetIcon(entry.preset)}
|
||||
{entry.preset.nameKey
|
||||
? t(entry.preset.nameKey)
|
||||
: entry.preset.name}
|
||||
{isPartner && (
|
||||
<span className="absolute -top-1 -right-1 flex items-center gap-0.5 rounded-full bg-gradient-to-r from-amber-500 to-yellow-500 px-1.5 py-0.5 text-[10px] font-bold text-white shadow-md">
|
||||
<Star className="h-2.5 w-2.5 fill-current" />
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
});
|
||||
{presetEntries.map((entry) => {
|
||||
const isSelected = selectedPresetId === entry.id;
|
||||
const isPartner = entry.preset.isPartner;
|
||||
const presetCategory = entry.preset.category ?? "others";
|
||||
return (
|
||||
<button
|
||||
key={entry.id}
|
||||
type="button"
|
||||
onClick={() => onPresetChange(entry.id)}
|
||||
className={`${getPresetButtonClass(isSelected, entry.preset)} relative`}
|
||||
style={getPresetButtonStyle(isSelected, entry.preset)}
|
||||
title={
|
||||
presetCategoryLabels[presetCategory] ??
|
||||
t("providerPreset.other")
|
||||
}
|
||||
>
|
||||
{renderPresetIcon(entry.preset)}
|
||||
{entry.preset.nameKey
|
||||
? t(entry.preset.nameKey)
|
||||
: entry.preset.name}
|
||||
{isPartner && (
|
||||
<span className="absolute -top-1 -right-1 flex items-center gap-0.5 rounded-full bg-gradient-to-r from-amber-500 to-yellow-500 px-1.5 py-0.5 text-[10px] font-bold text-white shadow-md">
|
||||
<Star className="h-2.5 w-2.5 fill-current" />
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -148,6 +148,79 @@ export const claudeDesktopProviderPresets: ClaudeDesktopProviderPreset[] = [
|
||||
partnerPromotionKey: "shengsuanyun",
|
||||
icon: "shengsuanyun",
|
||||
},
|
||||
{
|
||||
name: "PatewayAI",
|
||||
websiteUrl: "https://pateway.ai",
|
||||
apiKeyUrl: "https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/",
|
||||
category: "third_party",
|
||||
baseUrl: "https://api.pateway.ai",
|
||||
mode: "direct",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: passthroughRoutes(),
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "patewayai",
|
||||
icon: "pateway",
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
category: "cn_official",
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/coding",
|
||||
mode: "proxy",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: brandedRoutes(
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
),
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
category: "cn_official",
|
||||
baseUrl: "https://ark.ap-southeast.bytepluses.com/api/coding",
|
||||
mode: "proxy",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: brandedRoutes(
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
),
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
category: "cn_official",
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/compatible",
|
||||
mode: "proxy",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: brandedRoutes(
|
||||
"doubao-seed-2-0-code-preview-latest",
|
||||
"doubao-seed-2-0-code-preview-latest",
|
||||
"doubao-seed-2-0-code-preview-latest",
|
||||
),
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "Gemini Native",
|
||||
websiteUrl: "https://ai.google.dev/gemini-api",
|
||||
@@ -398,66 +471,6 @@ export const claudeDesktopProviderPresets: ClaudeDesktopProviderPreset[] = [
|
||||
icon: "minimax",
|
||||
iconColor: "#FF6B6B",
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
category: "cn_official",
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/compatible",
|
||||
mode: "proxy",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: brandedRoutes(
|
||||
"doubao-seed-2-0-code-preview-latest",
|
||||
"doubao-seed-2-0-code-preview-latest",
|
||||
"doubao-seed-2-0-code-preview-latest",
|
||||
),
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
category: "cn_official",
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/coding",
|
||||
mode: "proxy",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: brandedRoutes(
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
),
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
category: "cn_official",
|
||||
baseUrl: "https://ark.ap-southeast.bytepluses.com/api/coding",
|
||||
mode: "proxy",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: brandedRoutes(
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
"ark-code-latest",
|
||||
),
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
},
|
||||
{
|
||||
name: "BaiLing",
|
||||
websiteUrl: "https://alipaytbox.yuque.com/sxs0ba/ling/get_started",
|
||||
@@ -547,19 +560,6 @@ export const claudeDesktopProviderPresets: ClaudeDesktopProviderPreset[] = [
|
||||
partnerPromotionKey: "packycode",
|
||||
icon: "packycode",
|
||||
},
|
||||
{
|
||||
name: "PatewayAI",
|
||||
websiteUrl: "https://pateway.ai",
|
||||
apiKeyUrl: "https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/",
|
||||
category: "third_party",
|
||||
baseUrl: "https://api.pateway.ai",
|
||||
mode: "direct",
|
||||
apiFormat: "anthropic",
|
||||
modelRoutes: passthroughRoutes(),
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "patewayai",
|
||||
icon: "pateway",
|
||||
},
|
||||
{
|
||||
name: "ClaudeAPI",
|
||||
websiteUrl: "https://claudeapi.com",
|
||||
|
||||
@@ -105,6 +105,90 @@ export const providerPresets: ProviderPreset[] = [
|
||||
partnerPromotionKey: "shengsuanyun",
|
||||
icon: "shengsuanyun",
|
||||
},
|
||||
{
|
||||
name: "PatewayAI",
|
||||
websiteUrl: "https://pateway.ai",
|
||||
apiKeyUrl: "https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/",
|
||||
apiKeyField: "ANTHROPIC_API_KEY",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://api.pateway.ai",
|
||||
ANTHROPIC_API_KEY: "",
|
||||
},
|
||||
},
|
||||
category: "third_party",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "patewayai",
|
||||
icon: "pateway",
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://ark.cn-beijing.volces.com/api/coding",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
ANTHROPIC_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: "ark-code-latest",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL:
|
||||
"https://ark.ap-southeast.bytepluses.com/api/coding",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
ANTHROPIC_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: "ark-code-latest",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://ark.cn-beijing.volces.com/api/compatible",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
API_TIMEOUT_MS: "3000000",
|
||||
ANTHROPIC_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "Gemini Native",
|
||||
websiteUrl: "https://ai.google.dev/gemini-api",
|
||||
@@ -411,73 +495,6 @@ export const providerPresets: ProviderPreset[] = [
|
||||
icon: "minimax",
|
||||
iconColor: "#FF6B6B",
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://ark.cn-beijing.volces.com/api/compatible",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
API_TIMEOUT_MS: "3000000",
|
||||
ANTHROPIC_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: "doubao-seed-2-0-code-preview-latest",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://ark.cn-beijing.volces.com/api/coding",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
ANTHROPIC_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: "ark-code-latest",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://ark.ap-southeast.bytepluses.com/api/coding",
|
||||
ANTHROPIC_AUTH_TOKEN: "",
|
||||
ANTHROPIC_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL: "ark-code-latest",
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: "ark-code-latest",
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
},
|
||||
{
|
||||
name: "BaiLing",
|
||||
websiteUrl: "https://alipaytbox.yuque.com/sxs0ba/ling/get_started",
|
||||
@@ -587,22 +604,6 @@ export const providerPresets: ProviderPreset[] = [
|
||||
partnerPromotionKey: "packycode", // 促销信息 i18n key
|
||||
icon: "packycode",
|
||||
},
|
||||
{
|
||||
name: "PatewayAI",
|
||||
websiteUrl: "https://pateway.ai",
|
||||
apiKeyUrl: "https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/",
|
||||
apiKeyField: "ANTHROPIC_API_KEY",
|
||||
settingsConfig: {
|
||||
env: {
|
||||
ANTHROPIC_BASE_URL: "https://api.pateway.ai",
|
||||
ANTHROPIC_API_KEY: "",
|
||||
},
|
||||
},
|
||||
category: "third_party",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "patewayai",
|
||||
icon: "pateway",
|
||||
},
|
||||
{
|
||||
name: "ClaudeAPI",
|
||||
websiteUrl: "https://claudeapi.com",
|
||||
|
||||
@@ -94,6 +94,22 @@ export const codexProviderPresets: CodexProviderPreset[] = [
|
||||
partnerPromotionKey: "shengsuanyun",
|
||||
icon: "shengsuanyun",
|
||||
},
|
||||
{
|
||||
name: "PatewayAI",
|
||||
websiteUrl: "https://pateway.ai",
|
||||
apiKeyUrl: "https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/",
|
||||
category: "third_party",
|
||||
auth: generateThirdPartyAuth(""),
|
||||
config: generateThirdPartyConfig(
|
||||
"patewayai",
|
||||
"https://api.pateway.ai/v1",
|
||||
"gpt-5.5",
|
||||
),
|
||||
endpointCandidates: ["https://api.pateway.ai/v1"],
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "patewayai",
|
||||
icon: "pateway",
|
||||
},
|
||||
{
|
||||
name: "Azure OpenAI",
|
||||
websiteUrl:
|
||||
@@ -170,22 +186,6 @@ requires_openai_auth = true`,
|
||||
partnerPromotionKey: "packycode", // 促销信息 i18n key
|
||||
icon: "packycode",
|
||||
},
|
||||
{
|
||||
name: "PatewayAI",
|
||||
websiteUrl: "https://pateway.ai",
|
||||
apiKeyUrl: "https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/",
|
||||
category: "third_party",
|
||||
auth: generateThirdPartyAuth(""),
|
||||
config: generateThirdPartyConfig(
|
||||
"patewayai",
|
||||
"https://api.pateway.ai/v1",
|
||||
"gpt-5.5",
|
||||
),
|
||||
endpointCandidates: ["https://api.pateway.ai/v1"],
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "patewayai",
|
||||
icon: "pateway",
|
||||
},
|
||||
{
|
||||
name: "ClaudeCN",
|
||||
websiteUrl: "https://claudecn.top",
|
||||
|
||||
@@ -148,6 +148,96 @@ export const hermesProviderPresets: HermesProviderPreset[] = [
|
||||
model: { default: "openai/gpt-5.4", provider: "shengsuanyun" },
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
name: "ark_agentplan",
|
||||
base_url: "https://ark.cn-beijing.volces.com/api/coding",
|
||||
api_key: "",
|
||||
api_mode: "anthropic_messages",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
default: "ark-code-latest",
|
||||
provider: "ark_agentplan",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
name: "byteplus",
|
||||
base_url: "https://ark.ap-southeast.bytepluses.com/api/coding",
|
||||
api_key: "",
|
||||
api_mode: "anthropic_messages",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
default: "ark-code-latest",
|
||||
provider: "byteplus",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
name: "doubao_seed",
|
||||
base_url: "https://ark.cn-beijing.volces.com/api/compatible",
|
||||
api_key: "",
|
||||
api_mode: "anthropic_messages",
|
||||
models: [
|
||||
{
|
||||
id: "doubao-seed-2-0-code-preview-latest",
|
||||
name: "Doubao Seed 2.0 Code Preview",
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
default: "doubao-seed-2-0-code-preview-latest",
|
||||
provider: "doubao_seed",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "OpenRouter",
|
||||
nameKey: "providerForm.presets.openrouter",
|
||||
@@ -531,96 +621,6 @@ export const hermesProviderPresets: HermesProviderPreset[] = [
|
||||
model: { default: "MiniMax-M2.7", provider: "minimax_en" },
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
name: "doubao_seed",
|
||||
base_url: "https://ark.cn-beijing.volces.com/api/compatible",
|
||||
api_key: "",
|
||||
api_mode: "anthropic_messages",
|
||||
models: [
|
||||
{
|
||||
id: "doubao-seed-2-0-code-preview-latest",
|
||||
name: "Doubao Seed 2.0 Code Preview",
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
default: "doubao-seed-2-0-code-preview-latest",
|
||||
provider: "doubao_seed",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
name: "ark_agentplan",
|
||||
base_url: "https://ark.cn-beijing.volces.com/api/coding",
|
||||
api_key: "",
|
||||
api_mode: "anthropic_messages",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
default: "ark-code-latest",
|
||||
provider: "ark_agentplan",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
name: "byteplus",
|
||||
base_url: "https://ark.ap-southeast.bytepluses.com/api/coding",
|
||||
api_key: "",
|
||||
api_mode: "anthropic_messages",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
default: "ark-code-latest",
|
||||
provider: "byteplus",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BaiLing",
|
||||
websiteUrl: "https://alipaytbox.yuque.com/sxs0ba/ling/get_started",
|
||||
|
||||
@@ -104,6 +104,118 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
contextWindow: 256000,
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: { primary: "ark_agentplan/ark-code-latest" },
|
||||
modelCatalog: {
|
||||
"ark_agentplan/ark-code-latest": { alias: "Ark Code" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
baseUrl: "https://ark.ap-southeast.bytepluses.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
contextWindow: 256000,
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: { primary: "byteplus/ark-code-latest" },
|
||||
modelCatalog: {
|
||||
"byteplus/ark-code-latest": { alias: "Ark Code" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/v3",
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "doubao-seed-2-0-code-preview-latest",
|
||||
name: "DouBao Seed Code Preview",
|
||||
contextWindow: 128000,
|
||||
cost: { input: 0.002, output: 0.006 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: { primary: "doubaoseed/doubao-seed-2-0-code-preview-latest" },
|
||||
modelCatalog: {
|
||||
"doubaoseed/doubao-seed-2-0-code-preview-latest": { alias: "DouBao" },
|
||||
},
|
||||
},
|
||||
},
|
||||
// ========== Chinese Officials ==========
|
||||
{
|
||||
name: "DeepSeek",
|
||||
@@ -589,118 +701,6 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
modelCatalog: { "longcat/LongCat-Flash-Chat": { alias: "LongCat" } },
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/v3",
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "doubao-seed-2-0-code-preview-latest",
|
||||
name: "DouBao Seed Code Preview",
|
||||
contextWindow: 128000,
|
||||
cost: { input: 0.002, output: 0.006 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: { primary: "doubaoseed/doubao-seed-2-0-code-preview-latest" },
|
||||
modelCatalog: {
|
||||
"doubaoseed/doubao-seed-2-0-code-preview-latest": { alias: "DouBao" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
contextWindow: 256000,
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: { primary: "ark_agentplan/ark-code-latest" },
|
||||
modelCatalog: {
|
||||
"ark_agentplan/ark-code-latest": { alias: "Ark Code" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
baseUrl: "https://ark.ap-southeast.bytepluses.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "ark-code-latest",
|
||||
name: "Ark Code Latest",
|
||||
contextWindow: 256000,
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: { primary: "byteplus/ark-code-latest" },
|
||||
modelCatalog: {
|
||||
"byteplus/ark-code-latest": { alias: "Ark Code" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BaiLing",
|
||||
websiteUrl: "https://alipaytbox.yuque.com/sxs0ba/ling/get_started",
|
||||
|
||||
@@ -326,6 +326,105 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
npm: "@ai-sdk/openai-compatible",
|
||||
name: "火山Agentplan",
|
||||
options: {
|
||||
baseURL: "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
setCacheKey: true,
|
||||
},
|
||||
models: {
|
||||
"ark-code-latest": {
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
npm: "@ai-sdk/openai-compatible",
|
||||
name: "BytePlus",
|
||||
options: {
|
||||
baseURL: "https://ark.ap-southeast.bytepluses.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
setCacheKey: true,
|
||||
},
|
||||
models: {
|
||||
"ark-code-latest": {
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
npm: "@ai-sdk/openai-compatible",
|
||||
name: "DouBaoSeed",
|
||||
options: {
|
||||
baseURL: "https://ark.cn-beijing.volces.com/api/v3",
|
||||
apiKey: "",
|
||||
setCacheKey: true,
|
||||
},
|
||||
models: {
|
||||
"doubao-seed-2-0-code-preview-latest": {
|
||||
name: "Doubao Seed Code Preview",
|
||||
},
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DeepSeek",
|
||||
websiteUrl: "https://platform.deepseek.com",
|
||||
@@ -783,105 +882,6 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DouBaoSeed",
|
||||
websiteUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
npm: "@ai-sdk/openai-compatible",
|
||||
name: "DouBaoSeed",
|
||||
options: {
|
||||
baseURL: "https://ark.cn-beijing.volces.com/api/v3",
|
||||
apiKey: "",
|
||||
setCacheKey: true,
|
||||
},
|
||||
models: {
|
||||
"doubao-seed-2-0-code-preview-latest": {
|
||||
name: "Doubao Seed Code Preview",
|
||||
},
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "doubaoseed",
|
||||
icon: "doubao",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "火山Agentplan",
|
||||
websiteUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.volcengine.com/activity/agentplan?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
npm: "@ai-sdk/openai-compatible",
|
||||
name: "火山Agentplan",
|
||||
options: {
|
||||
baseURL: "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
setCacheKey: true,
|
||||
},
|
||||
models: {
|
||||
"ark-code-latest": {
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "volcengine_agentplan",
|
||||
icon: "huoshan",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BytePlus",
|
||||
websiteUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
apiKeyUrl:
|
||||
"https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
|
||||
settingsConfig: {
|
||||
npm: "@ai-sdk/openai-compatible",
|
||||
name: "BytePlus",
|
||||
options: {
|
||||
baseURL: "https://ark.ap-southeast.bytepluses.com/api/coding/v3",
|
||||
apiKey: "",
|
||||
setCacheKey: true,
|
||||
},
|
||||
models: {
|
||||
"ark-code-latest": {
|
||||
name: "Ark Code Latest",
|
||||
},
|
||||
},
|
||||
},
|
||||
category: "cn_official",
|
||||
isPartner: true,
|
||||
partnerPromotionKey: "byteplus",
|
||||
icon: "byteplus",
|
||||
iconColor: "#3370FF",
|
||||
templateValues: {
|
||||
apiKey: {
|
||||
label: "API Key",
|
||||
placeholder: "",
|
||||
editorValue: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BaiLing",
|
||||
websiteUrl: "https://alipaytbox.yuque.com/sxs0ba/ling/get_started",
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Form } from "@/components/ui/form";
|
||||
import { ProviderPresetSelector } from "@/components/providers/forms/ProviderPresetSelector";
|
||||
|
||||
describe("ProviderPresetSelector", () => {
|
||||
it("按传入的预设数组顺序渲染,不按分类重新排序", () => {
|
||||
const Wrapper = () => {
|
||||
const form = useForm();
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<ProviderPresetSelector
|
||||
selectedPresetId="custom"
|
||||
presetEntries={[
|
||||
{
|
||||
id: "preset-0",
|
||||
preset: {
|
||||
name: "First",
|
||||
websiteUrl: "https://first.example.com",
|
||||
settingsConfig: {},
|
||||
category: "third_party",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "preset-1",
|
||||
preset: {
|
||||
name: "Second",
|
||||
websiteUrl: "https://second.example.com",
|
||||
settingsConfig: {},
|
||||
category: "official",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "preset-2",
|
||||
preset: {
|
||||
name: "Third",
|
||||
websiteUrl: "https://third.example.com",
|
||||
settingsConfig: {},
|
||||
category: "aggregator",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "preset-3",
|
||||
preset: {
|
||||
name: "Fourth",
|
||||
websiteUrl: "https://fourth.example.com",
|
||||
settingsConfig: {},
|
||||
category: "official",
|
||||
},
|
||||
},
|
||||
]}
|
||||
presetCategoryLabels={{
|
||||
official: "官方",
|
||||
aggregator: "聚合服务",
|
||||
third_party: "第三方",
|
||||
}}
|
||||
onPresetChange={vi.fn()}
|
||||
/>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
render(<Wrapper />);
|
||||
|
||||
expect(
|
||||
screen.getAllByRole("button").map((button) => button.textContent),
|
||||
).toEqual(["providerPreset.custom", "First", "Second", "Third", "Fourth"]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { providerPresets } from "@/config/claudeProviderPresets";
|
||||
import { claudeDesktopProviderPresets } from "@/config/claudeDesktopProviderPresets";
|
||||
import { codexProviderPresets } from "@/config/codexProviderPresets";
|
||||
import { opencodeProviderPresets } from "@/config/opencodeProviderPresets";
|
||||
import { openclawProviderPresets } from "@/config/openclawProviderPresets";
|
||||
import { hermesProviderPresets } from "@/config/hermesProviderPresets";
|
||||
|
||||
const namesOf = (presets: Array<{ name: string }>) =>
|
||||
presets.map((preset) => preset.name);
|
||||
|
||||
const expectInOrder = (names: string[], expected: string[]) => {
|
||||
const indexes = expected.map((name) => names.indexOf(name));
|
||||
|
||||
expect(indexes).not.toContain(-1);
|
||||
expect(indexes).toEqual(expected.map((_, index) => indexes[0] + index));
|
||||
};
|
||||
|
||||
describe("provider preset order", () => {
|
||||
it("Claude 预设按合作伙伴优先顺序排列", () => {
|
||||
expectInOrder(namesOf(providerPresets), [
|
||||
"Shengsuanyun",
|
||||
"PatewayAI",
|
||||
"火山Agentplan",
|
||||
"BytePlus",
|
||||
"DouBaoSeed",
|
||||
]);
|
||||
});
|
||||
|
||||
it("Claude Desktop 预设按合作伙伴优先顺序排列", () => {
|
||||
expectInOrder(namesOf(claudeDesktopProviderPresets), [
|
||||
"Shengsuanyun",
|
||||
"PatewayAI",
|
||||
"火山Agentplan",
|
||||
"BytePlus",
|
||||
"DouBaoSeed",
|
||||
]);
|
||||
});
|
||||
|
||||
it("Codex 预设把 PatewayAI 放在胜算云后面", () => {
|
||||
expectInOrder(namesOf(codexProviderPresets), ["Shengsuanyun", "PatewayAI"]);
|
||||
});
|
||||
|
||||
it("OpenCode 预设把火山、BytePlus、DouBaoSeed 放在胜算云后面", () => {
|
||||
expectInOrder(namesOf(opencodeProviderPresets), [
|
||||
"Shengsuanyun",
|
||||
"火山Agentplan",
|
||||
"BytePlus",
|
||||
"DouBaoSeed",
|
||||
]);
|
||||
});
|
||||
|
||||
it("OpenClaw 预设把火山、BytePlus、DouBaoSeed 放在胜算云后面", () => {
|
||||
expectInOrder(namesOf(openclawProviderPresets), [
|
||||
"Shengsuanyun",
|
||||
"火山Agentplan",
|
||||
"BytePlus",
|
||||
"DouBaoSeed",
|
||||
]);
|
||||
});
|
||||
|
||||
it("Hermes 预设把火山、BytePlus、DouBaoSeed 放在胜算云后面", () => {
|
||||
expectInOrder(namesOf(hermesProviderPresets), [
|
||||
"Shengsuanyun",
|
||||
"火山Agentplan",
|
||||
"BytePlus",
|
||||
"DouBaoSeed",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user