Skip to content

Commit c3e39da

Browse files
committed
fix: update API host URLs in localization and configuration files
- Changed the host placeholder in English and Chinese localization files to reflect the new API endpoint for DeepSeek. - Updated the host URLs for various AI providers in the configuration file to remove the specific endpoint paths, ensuring compatibility with the latest API structure.
1 parent ccb50fc commit c3e39da

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

packages/aipex-react/src/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"aiHost": "AI Host",
2323
"aiToken": "API Key",
2424
"aiModel": "AI Model",
25-
"hostPlaceholder": "https://api.deepseek.com/chat/completions",
25+
"hostPlaceholder": "https://api.deepseek.com/v1",
2626
"tokenPlaceholder": "Enter your API token",
2727
"modelPlaceholder": "deepseek-chat",
2828
"saveSuccess": "Settings saved successfully!",

packages/aipex-react/src/i18n/locales/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"aiHost": "AI 服务地址",
2323
"aiToken": "API 密钥",
2424
"aiModel": "AI 模型",
25-
"hostPlaceholder": "https://api.deepseek.com/chat/completions",
25+
"hostPlaceholder": "https://api.deepseek.com/v1",
2626
"tokenPlaceholder": "请输入您的 API 令牌",
2727
"modelPlaceholder": "deepseek-chat",
2828
"saveSuccess": "设置保存成功!",

packages/core/src/config/ai-providers.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const AI_PROVIDERS = {
2323
openai: {
2424
name: "OpenAI",
2525
icon: "🤖",
26-
host: "https://api.openai.com/v1/chat/completions",
26+
host: "https://api.openai.com/v1",
2727
models: ["gpt-4o", "gpt-4-turbo", "gpt-4", "gpt-3.5-turbo"] as const,
2828
tokenPlaceholder: "sk-...",
2929
docs: "https://platform.openai.com/api-keys",
@@ -32,7 +32,7 @@ export const AI_PROVIDERS = {
3232
anthropic: {
3333
name: "Anthropic",
3434
icon: "🧠",
35-
host: "https://api.anthropic.com/v1/messages",
35+
host: "https://api.anthropic.com",
3636
models: [
3737
"claude-sonnet-4-20250514",
3838
"claude-3-5-sonnet-20241022",
@@ -57,7 +57,7 @@ export const AI_PROVIDERS = {
5757
openrouter: {
5858
name: "OpenRouter",
5959
icon: "🔀",
60-
host: "https://openrouter.ai/api/v1/chat/completions",
60+
host: "https://openrouter.ai/api/v1",
6161
models: [
6262
"anthropic/claude-3.5-sonnet",
6363
"openai/gpt-4o",
@@ -72,7 +72,7 @@ export const AI_PROVIDERS = {
7272
deepseek: {
7373
name: "DeepSeek",
7474
icon: "🔍",
75-
host: "https://api.deepseek.com/v1/chat/completions",
75+
host: "https://api.deepseek.com/v1",
7676
models: ["deepseek-chat", "deepseek-coder"] as const,
7777
tokenPlaceholder: "sk-...",
7878
docs: "https://platform.deepseek.com/api_keys",
@@ -81,7 +81,7 @@ export const AI_PROVIDERS = {
8181
groq: {
8282
name: "Groq",
8383
icon: "⚡",
84-
host: "https://api.groq.com/openai/v1/chat/completions",
84+
host: "https://api.groq.com/openai/v1",
8585
models: [
8686
"llama-3.3-70b-versatile",
8787
"llama-3.1-8b-instant",
@@ -94,7 +94,7 @@ export const AI_PROVIDERS = {
9494
together: {
9595
name: "Together AI",
9696
icon: "🤝",
97-
host: "https://api.together.xyz/v1/chat/completions",
97+
host: "https://api.together.xyz/v1",
9898
models: [
9999
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
100100
"mistralai/Mixtral-8x7B-Instruct-v0.1",
@@ -107,7 +107,7 @@ export const AI_PROVIDERS = {
107107
mistral: {
108108
name: "Mistral AI",
109109
icon: "🌬️",
110-
host: "https://api.mistral.ai/v1/chat/completions",
110+
host: "https://api.mistral.ai/v1",
111111
models: [
112112
"mistral-large-latest",
113113
"mistral-medium-latest",
@@ -120,7 +120,7 @@ export const AI_PROVIDERS = {
120120
cohere: {
121121
name: "Cohere",
122122
icon: "🔗",
123-
host: "https://api.cohere.ai/v1/chat",
123+
host: "https://api.cohere.ai/v1",
124124
models: ["command-r-plus", "command-r", "command"] as const,
125125
tokenPlaceholder: "...",
126126
docs: "https://dashboard.cohere.com/api-keys",
@@ -129,7 +129,7 @@ export const AI_PROVIDERS = {
129129
perplexity: {
130130
name: "Perplexity",
131131
icon: "🔎",
132-
host: "https://api.perplexity.ai/chat/completions",
132+
host: "https://api.perplexity.ai",
133133
models: [
134134
"llama-3.1-sonar-large-128k-online",
135135
"llama-3.1-sonar-small-128k-online",
@@ -141,7 +141,7 @@ export const AI_PROVIDERS = {
141141
fireworks: {
142142
name: "Fireworks AI",
143143
icon: "🎆",
144-
host: "https://api.fireworks.ai/inference/v1/chat/completions",
144+
host: "https://api.fireworks.ai/inference/v1",
145145
models: [
146146
"accounts/fireworks/models/llama-v3p1-70b-instruct",
147147
"accounts/fireworks/models/mixtral-8x7b-instruct",
@@ -153,7 +153,7 @@ export const AI_PROVIDERS = {
153153
replicate: {
154154
name: "Replicate",
155155
icon: "🔁",
156-
host: "https://api.replicate.com/v1/models",
156+
host: "https://api.replicate.com/v1",
157157
models: [
158158
"meta/llama-2-70b-chat",
159159
"mistralai/mixtral-8x7b-instruct-v0.1",
@@ -165,7 +165,7 @@ export const AI_PROVIDERS = {
165165
azure: {
166166
name: "Azure OpenAI",
167167
icon: "☁️",
168-
host: "https://YOUR-RESOURCE.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT/chat/completions?api-version=2024-02-15-preview",
168+
host: "https://YOUR-RESOURCE.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT",
169169
models: ["gpt-4", "gpt-35-turbo"] as const,
170170
tokenPlaceholder: "YOUR-API-KEY",
171171
docs: "https://portal.azure.com",

0 commit comments

Comments
 (0)