mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-07-14 00:41:38 +08:00
feat: expand AI provider support and update descriptions
- Updated AIProviderBase and AIProviderUpdate to support new API formats: 'anthropic' and 'ollama'. - Added SVG icons for Anthropic, Azure, Ollama, and Z.ai providers. - Updated AI provider payload interface to include new formats. - Enhanced English and Chinese localization for new providers and updated descriptions for OpenAI and Anthropic. - Added new provider templates for Azure OpenAI, Anthropic, Z.ai, and Ollama in the settings tab. - Updated the API format selection in the settings tab to include new options.
This commit is contained in:
@@ -6,7 +6,7 @@ export interface AIProviderPayload {
|
||||
name: string;
|
||||
identifier: string;
|
||||
provider_type?: string | null;
|
||||
api_format: 'openai' | 'gemini';
|
||||
api_format: 'openai' | 'gemini' | 'anthropic' | 'ollama';
|
||||
base_url?: string | null;
|
||||
api_key?: string | null;
|
||||
logo_url?: string | null;
|
||||
|
||||
@@ -415,7 +415,7 @@
|
||||
"Custom Provider": "Custom Provider",
|
||||
"Custom Provider Description": "Bring your own endpoint compatible with OpenAI or Gemini formats.",
|
||||
"OpenAI Provider": "OpenAI",
|
||||
"OpenAI Provider Description": "Access GPT-4o, GPT-4.1, GPT-3.5 and more models from OpenAI.",
|
||||
"OpenAI Provider Description": "Access GPT-4o, GPT-4.1, GPT-5 and more models from OpenAI.",
|
||||
"Azure OpenAI Provider": "Azure OpenAI",
|
||||
"Azure OpenAI Provider Description": "Use OpenAI models deployed on Microsoft Azure.",
|
||||
"Google AI Provider": "Google AI",
|
||||
@@ -425,13 +425,15 @@
|
||||
"OpenRouter Provider": "OpenRouter",
|
||||
"OpenRouter Provider Description": "Connect to multiple AI providers through a single OpenAI-style endpoint.",
|
||||
"Anthropic Provider": "Anthropic",
|
||||
"Anthropic Provider Description": "Claude 3 family models exposed through the Claude API.",
|
||||
"Anthropic Provider Description": "Claude 4 family models exposed through the Claude API.",
|
||||
"Z.ai Provider": "Z.ai",
|
||||
"Z.ai Provider Description": "Z.ai models served via BigModel Open Platform (OpenAI-style).",
|
||||
"DeepSeek Provider": "DeepSeek",
|
||||
"DeepSeek Provider Description": "DeepSeek language models via OpenAI-compatible API.",
|
||||
"Grok Provider": "Grok (xAI)",
|
||||
"Grok Provider Description": "Grok models powered by xAI with OpenAI-style routes.",
|
||||
"Ollama Provider": "Ollama",
|
||||
"Ollama Provider Description": "Self-host and run models locally with Ollama's OpenAI bridge.",
|
||||
"Ollama Provider Description": "Self-host and run models locally with Ollama's native HTTP API.",
|
||||
"Voyage Provider": "Voyage AI",
|
||||
"Voyage Provider Description": "High-quality embeddings and rerankers from Voyage AI.",
|
||||
"Delete provider?": "Delete provider?",
|
||||
|
||||
@@ -411,15 +411,23 @@
|
||||
"Added {count} models": "已添加 {count} 个模型",
|
||||
"Custom Provider": "自定义提供商",
|
||||
"Custom Provider Description": "自定义兼容 OpenAI 或 Gemini 标准的 API 端点。",
|
||||
"OpenAI Provider Description": "访问 OpenAI 的 GPT-4o、GPT-4.1、GPT-3.5 等模型。",
|
||||
"OpenAI Provider": "OpenAI",
|
||||
"OpenAI Provider Description": "访问 OpenAI 的 GPT-4o、GPT-4.1、GPT-5 等模型。",
|
||||
"Azure OpenAI Provider": "Azure OpenAI",
|
||||
"Azure OpenAI Provider Description": "使用托管在微软 Azure 上的 OpenAI 模型。",
|
||||
"Google AI Provider": "Google AI",
|
||||
"Google AI Provider Description": "Google AI 平台提供的 Gemini 系列模型。",
|
||||
"SiliconFlow Provider": "硅基流动",
|
||||
"SiliconFlow Provider Description": "硅基流动高性能推理平台,兼容 OpenAI 接口。",
|
||||
"OpenRouter Provider Description": "通过一个 OpenAI 风格入口接入多家 AI 提供商。",
|
||||
"Anthropic Provider Description": "通过 Claude API 使用 Claude 3 系列模型。",
|
||||
"Anthropic Provider": "Anthropic",
|
||||
"Anthropic Provider Description": "通过 Claude API 使用 Claude 4 系列模型。",
|
||||
"Z.ai Provider": "Z.ai",
|
||||
"Z.ai Provider Description": "通过智谱开放平台接入(OpenAI 风格接口)。",
|
||||
"DeepSeek Provider": "DeepSeek",
|
||||
"DeepSeek Provider Description": "DeepSeek 语言模型,支持 OpenAI 兼容接口。",
|
||||
"Grok Provider Description": "xAI 的 Grok 模型,提供 OpenAI 风格接口。",
|
||||
"Ollama Provider": "Ollama",
|
||||
"Ollama Provider Description": "使用 Ollama 在本地运行并管理大模型。",
|
||||
"Voyage Provider Description": "Voyage AI 提供的高质量嵌入与重排序模型。",
|
||||
"Delete provider?": "确认删除该提供商?",
|
||||
|
||||
@@ -80,7 +80,7 @@ interface ProviderTemplate {
|
||||
key: string;
|
||||
nameKey: string;
|
||||
descriptionKey: string;
|
||||
api_format: 'openai' | 'gemini';
|
||||
api_format: AIProviderPayload['api_format'];
|
||||
identifier: string;
|
||||
base_url?: string;
|
||||
logo_url?: string;
|
||||
@@ -150,6 +150,28 @@ const providerTemplates: ProviderTemplate[] = [
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://platform.openai.com/docs/api-reference',
|
||||
},
|
||||
{
|
||||
key: 'azure-openai',
|
||||
nameKey: 'Azure OpenAI Provider',
|
||||
descriptionKey: 'Azure OpenAI Provider Description',
|
||||
api_format: 'openai',
|
||||
identifier: 'azure-openai',
|
||||
base_url: 'https://{resource-name}.openai.azure.com/openai/deployments/{deployment-name}',
|
||||
logo_url: '/icon/azure-color.svg',
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://learn.microsoft.com/en-us/azure/ai-services/openai/reference',
|
||||
},
|
||||
{
|
||||
key: 'anthropic',
|
||||
nameKey: 'Anthropic Provider',
|
||||
descriptionKey: 'Anthropic Provider Description',
|
||||
api_format: 'anthropic',
|
||||
identifier: 'anthropic',
|
||||
base_url: 'https://api.anthropic.com/v1',
|
||||
logo_url: '/icon/anthropic.svg',
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://docs.anthropic.com/claude/reference/messages_post',
|
||||
},
|
||||
{
|
||||
key: 'google-ai',
|
||||
nameKey: 'Google AI Provider',
|
||||
@@ -161,6 +183,17 @@ const providerTemplates: ProviderTemplate[] = [
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://ai.google.dev/api/rest',
|
||||
},
|
||||
{
|
||||
key: 'zai',
|
||||
nameKey: 'Z.ai Provider',
|
||||
descriptionKey: 'Z.ai Provider Description',
|
||||
api_format: 'openai',
|
||||
identifier: 'zai',
|
||||
base_url: 'https://open.bigmodel.cn/api/paas/v4',
|
||||
logo_url: '/icon/zai.svg',
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://open.bigmodel.cn/dev/api',
|
||||
},
|
||||
{
|
||||
key: 'siliconflow',
|
||||
nameKey: 'SiliconFlow Provider',
|
||||
@@ -183,6 +216,17 @@ const providerTemplates: ProviderTemplate[] = [
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://platform.deepseek.com/api-docs',
|
||||
},
|
||||
{
|
||||
key: 'ollama',
|
||||
nameKey: 'Ollama Provider',
|
||||
descriptionKey: 'Ollama Provider Description',
|
||||
api_format: 'ollama',
|
||||
identifier: 'ollama',
|
||||
base_url: 'http://localhost:11434',
|
||||
logo_url: '/icon/ollama.svg',
|
||||
provider_type: 'builtin',
|
||||
doc_url: 'https://github.com/ollama/ollama/blob/main/docs/api.md',
|
||||
},
|
||||
];
|
||||
|
||||
const abilityTagColor: Record<AIAbility, string> = {
|
||||
@@ -1071,14 +1115,16 @@ export default function AiSettingsTab() {
|
||||
label={t('API Format')}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Select
|
||||
disabled={!allowFormatChange}
|
||||
options={[
|
||||
{ value: 'openai', label: 'OpenAI Compatible' },
|
||||
{ value: 'gemini', label: 'Gemini Compatible' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Select
|
||||
disabled={!allowFormatChange}
|
||||
options={[
|
||||
{ value: 'openai', label: 'OpenAI Compatible' },
|
||||
{ value: 'gemini', label: 'Gemini Compatible' },
|
||||
{ value: 'anthropic', label: 'Anthropic Native' },
|
||||
{ value: 'ollama', label: 'Ollama Native' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="base_url" label={t('Base URL')} rules={[{ required: true, message: t('Enter base url') }]}>
|
||||
<Input placeholder="https://" />
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user