diff --git a/.env.example b/.env.example index 9d986c02b873..14f902edaa69 100644 --- a/.env.example +++ b/.env.example @@ -104,6 +104,10 @@ OPENAI_API_KEY=sk-xxxxxxxxx # MINIMAX_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +### DeepSeek AI #### + +# DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx + ######################################## ############ Market Service ############ ######################################## diff --git a/Dockerfile b/Dockerfile index 91e08f1b65f2..c604543b6ab0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -129,4 +129,7 @@ ENV TOGETHERAI_API_KEY "" # Minimax ENV MINIMAX_API_KEY "" +# DeepSeek +ENV DEEPSEEK_API_KEY "" + CMD ["node", "server.js"] diff --git a/README.md b/README.md index cc170044b928..3c740e3dc99a 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ We have implemented support for the following model service providers: - **ChatGLM**: Added the **ChatGLM** series models from Zhipuai (GLM-4/GLM-4-vision/GLM-3-turbo), providing users with another efficient conversation model choice. [Learn more](https://www.zhipuai.cn/) - **Moonshot AI (Dark Side of the Moon)**: Integrated with the Moonshot series models, an innovative AI startup from China, aiming to provide deeper conversation understanding. [Learn more](https://www.moonshot.cn/) - **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/) +- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/) At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284). diff --git a/README.zh-CN.md b/README.zh-CN.md index 92cbd4389c1a..0aa23d706164 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -129,6 +129,8 @@ - **Groq**:接入了 Groq 的 AI 模型,高效处理消息序列,生成回应,胜任多轮对话及单次交互任务。[了解更多](https://groq.com/) - **OpenRouter**:其支持包括 **Claude 3**,**Gemma**,**Mistral**,**Llama2**和**Cohere**等模型路由,支持智能路由优化,提升使用效率,开放且灵活。[了解更多](https://openrouter.ai/) - **Minimax**: 接入了 Minimax 的 AI 模型,包括 MoE 模型 **abab6**,提供了更多的选择空间。[了解更多](https://www.minimaxi.com/) +- **DeepSeek**: 接入了 DeepSeek 的 AI 模型,包括最新的 **DeepSeek-V2**,提供兼顾性能与价格的模型。[了解更多](https://www.deepseek.com/) + 同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。 diff --git a/docs/self-hosting/environment-variables/model-provider.mdx b/docs/self-hosting/environment-variables/model-provider.mdx index a23b940b4202..be64cfddedf8 100644 --- a/docs/self-hosting/environment-variables/model-provider.mdx +++ b/docs/self-hosting/environment-variables/model-provider.mdx @@ -146,6 +146,15 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Default: `us-east-1` - Example: `us-east-1` +## DeepSeek AI + +### `DEEPSEEK_API_KEY` + +- Type: Required +- Description: This is the API key you applied for in the DeepSeek AI service +- Default: - +- Example: `sk-xxxxxx...xxxxxx` + ## OpenRouter AI ### `OPENROUTER_API_KEY` @@ -153,7 +162,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied for in the OpenRouter AI service - Default: - -- Example: `sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=` +- Example: `sk-or-v1-xxxxxx...xxxxxx=` ### `OPENROUTER_MODEL_LIST` @@ -169,7 +178,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied for in the TogetherAI service - Default: - -- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- Example: `xxxxxx...xxxxxx` ### `TOGETHERAI_MODEL_LIST` @@ -210,7 +219,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied from Perplexity AI - Default: - -- Example: `pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- Example: `pplx-xxxxxx...xxxxxx` ## Minimax AI @@ -219,7 +228,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied for in the Minimax AI service - Default: - -- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- Example: `xxxxxx...xxxxxx` ## Mistral AI @@ -228,7 +237,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied for in the Mistral AI service - Default: - -- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=` +- Example: `xxxxxx...xxxxxx=` ## Groq AI @@ -237,7 +246,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied from Groq AI - Default: - -- Example: `gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- Example: `gsk_xxxxxx...xxxxxx` ## ZHIPU AI @@ -255,6 +264,6 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Type: Required - Description: This is the API key you applied for in the 01.AI service - Default: - -- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- 示例:`xxxxxx...xxxxxx` [model-list]: /docs/self-hosting/advanced/model-list diff --git a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx index 0e716da21fe7..c2c9a86cef1a 100644 --- a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx @@ -144,6 +144,15 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 默认值:`us-east-1` - 示例:`us-east-1` +## DeepSeek AI + +### `DEEPSEEK_API_KEY` + +- 类型:必选 +- 描述:这是你在 DeepSeek AI 服务中申请的 API 密钥 +- 默认值:- +- 示例:`sk-xxxxxx...xxxxxx` + ## OpenRouter AI ### `OPENROUTER_API_KEY` @@ -151,7 +160,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在 OpenRouter AI 服务中申请的 API 密钥 - 默认值:- -- 示例:`sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=` +- 示例:`sk-or-v1-xxxxxx...xxxxxx=` ### `OPENROUTER_MODEL_LIST` @@ -167,7 +176,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在 TogetherAI 服务中申请的 API 密钥 - 默认值:- -- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- 示例:`xxxxxx...xxxxxx` ### `TOGETHERAI_MODEL_LIST` @@ -208,7 +217,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在 Perplexity AI 服务中申请的 API 密钥 - 默认值:- -- 示例:`pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- 示例:`pplx-xxxxxx...xxxxxx` ## Minimax AI @@ -217,7 +226,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在 Minimax AI 服务中申请的 API 密钥 - 默认值:- -- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- 示例:`xxxxxx...xxxxxx` ## Mistral AI @@ -226,7 +235,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在 Mistral AI 服务中申请的 API 密钥 - 默认值:- -- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=` +- 示例:`xxxxxx...xxxxxx=` ## Groq AI @@ -235,7 +244,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在 Groq AI 服务中申请的 API 密钥 - 默认值:- -- 示例:`gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- 示例:`gsk_xxxxxx...xxxxxx` ## 智谱 AI @@ -253,6 +262,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 类型:必选 - 描述:这是你在零一万物服务中申请的 API 密钥 - 默认值:- -- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +- 示例:`xxxxxx...xxxxxx` [model-list]: /docs/self-hosting/advanced/model-list diff --git a/docs/usage/features/multi-ai-providers.mdx b/docs/usage/features/multi-ai-providers.mdx index 92951c42a7fa..e2939cc9442c 100644 --- a/docs/usage/features/multi-ai-providers.mdx +++ b/docs/usage/features/multi-ai-providers.mdx @@ -45,6 +45,7 @@ We have implemented support for the following model service providers: - **01.AI (Yi Model)**: Integrated the 01.AI models, with series of APIs featuring fast inference speed, which not only shortened the processing time, but also maintained excellent model performance. [Learn more](https://01.ai/) - **Together.ai**: Over 100 leading open-source Chat, Language, Image, Code, and Embedding models are available through the Together Inference API. For these models you pay just for what you use. [Learn more](https://www.together.ai/) - **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/) +- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/) At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284). diff --git a/docs/usage/features/multi-ai-providers.zh-CN.mdx b/docs/usage/features/multi-ai-providers.zh-CN.mdx index 388ef8731b9b..c6b143347713 100644 --- a/docs/usage/features/multi-ai-providers.zh-CN.mdx +++ b/docs/usage/features/multi-ai-providers.zh-CN.mdx @@ -45,6 +45,7 @@ tags: - **Groq**:接入了 Groq 的 AI 模型,高效处理消息序列,生成回应,胜任多轮对话及单次交互任务。[了解更多](https://groq.com/) - **OpenRouter**:其支持包括 **Claude 3**,**Gemma**,**Mistral**,**Llama2**和**Cohere**等模型路由,支持智能路由优化,提升使用效率,开放且灵活。[了解更多](https://openrouter.ai/) - **Minimax**: 接入了 Minimax 的 AI 模型,包括 MoE 模型 **abab6**,提供了更多的选择空间。[了解更多](https://www.minimaxi.com/) +- **DeepSeek**: 接入了 DeepSeek 的 AI 模型,包括最新的 **DeepSeek-V2**,提供兼顾性能与价格的模型。[了解更多](https://www.deepseek.com/) 同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。 diff --git a/locales/ar/error.json b/locales/ar/error.json index d6b02f38459d..8166378adfa7 100644 --- a/locales/ar/error.json +++ b/locales/ar/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "خطأ في طلب خدمة Anthropic AI، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "AzureBizError": "حدث خطأ في طلب خدمة Azure AI، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "BedrockBizError": "حدث خطأ في طلب خدمة Bedrock، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", + "DeepSeekBizError": "خطأ في طلب خدمة DeepSeek، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "GoogleBizError": "حدث خطأ في طلب خدمة Google، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "GroqBizError": "حدث خطأ في خدمة Groq ، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "InvalidAccessCode": "كلمة المرور غير صحيحة أو فارغة، يرجى إدخال كلمة مرور الوصول الصحيحة أو إضافة مفتاح API مخصص", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "مفتاح Azure API غير صحيح أو فارغ، يرجى التحقق من مفتاح Azure API وإعادة المحاولة", "InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة", "InvalidClerkUser": "عذرًا، لم تقم بتسجيل الدخول بعد، يرجى تسجيل الدخول أو التسجيل للمتابعة", + "InvalidDeepSeekAPIKey": "مفتاح DeepSeek API غير صحيح أو فارغ، يرجى التحقق من مفتاح DeepSeek API وإعادة المحاولة", "InvalidGoogleAPIKey": "مفتاح Google API غير صحيح أو فارغ، يرجى التحقق من مفتاح Google API وإعادة المحاولة", "InvalidGroqAPIKey": "مفتاح Groq API غير صحيح أو فارغ، يرجى التحقق من مفتاح Groq API وإعادة المحاولة", "InvalidMinimaxAPIKey": "مفتاح Minimax API غير صحيح أو فارغ، يرجى التحقق من مفتاح Minimax API وإعادة المحاولة", diff --git a/locales/ar/modelProvider.json b/locales/ar/modelProvider.json index 63cc3f6c8606..2f5983287d13 100644 --- a/locales/ar/modelProvider.json +++ b/locales/ar/modelProvider.json @@ -61,6 +61,18 @@ "title": "استخدام معلومات المصادقة الخاصة بـ Bedrock المخصصة" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "أدخل مفتاح API الخاص بـ DeepSeek", + "placeholder": "مفتاح API DeepSeek", + "title": "مفتاح API" + }, + "unlock": { + "description": "قم بإدخال مفتاح API DeepSeek الخاص بك لبدء الجلسة. لن يتم تسجيل مفتاح الـ API الخاص بك", + "title": "استخدام مفتاح API خاص بـ DeepSeek" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/bg-BG/error.json b/locales/bg-BG/error.json index e1ced5a2057c..c8556d849558 100644 --- a/locales/bg-BG/error.json +++ b/locales/bg-BG/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Грешка при заявка към услугата Anthropic. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.", "AzureBizError": "Грешка при заявка към услугата Azure AI. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.", "BedrockBizError": "Грешка при заявка към услугата Bedrock. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.", + "DeepSeekBizError": "Грешка при заявка към услугата DeepSeek. Моля, проверете информацията по-долу и опитайте отново.", "GoogleBizError": "Грешка при заявка към услугата Google. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.", "GroqBizError": "Възникна грешка при заявка към услугата Groq. Моля, отстранете неизправностите въз основа на следната информация или опитайте отново.", "InvalidAccessCode": "Невалиден или празен код за достъп. Моля, въведете правилния код за достъп или добавете персонализиран API ключ.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "API ключът на Azure е неправилен или празен. Моля, проверете API ключа на Azure и опитайте отново.", "InvalidBedrockCredentials": "Удостоверяването на Bedrock е неуспешно. Моля, проверете AccessKeyId/SecretAccessKey и опитайте отново.", "InvalidClerkUser": "很抱歉,你当前尚未登录,请先登录或注册账号后继续操作", + "InvalidDeepSeekAPIKey": "Невалиден ключ за достъп до DeepSeek API или е празен. Моля, проверете ключа за достъп до DeepSeek API и опитайте отново.", "InvalidGoogleAPIKey": "API ключът на Google е неправилен или празен. Моля, проверете API ключа на Google и опитайте отново.", "InvalidGroqAPIKey": "API ключът на Groq е неправилен или празен. Моля, проверете API ключа на Groq и опитайте отново.", "InvalidMinimaxAPIKey": "Невалиден или липсващ ключ за Minimax API, моля проверете ключа за Minimax API и опитайте отново", diff --git a/locales/bg-BG/modelProvider.json b/locales/bg-BG/modelProvider.json index 62352423b824..14506b038b46 100644 --- a/locales/bg-BG/modelProvider.json +++ b/locales/bg-BG/modelProvider.json @@ -61,6 +61,18 @@ "title": "Използване на персонализирана информация за удостоверяване на Bedrock" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Въведете API ключ от DeepSeek", + "placeholder": "API ключ на DeepSeek", + "title": "API ключ" + }, + "unlock": { + "description": "Само въведете вашия API ключ от DeepSeek, за да започнете сесията. Приложението няма да запази вашия API ключ", + "title": "Използване на персонализиран API ключ от DeepSeek" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/de-DE/error.json b/locales/de-DE/error.json index e52ae37253e7..9d9d40cef10c 100644 --- a/locales/de-DE/error.json +++ b/locales/de-DE/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Fehler beim Anfordern des Anthropic AI-Dienstes. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", "AzureBizError": "Es ist ein Fehler bei der Anforderung des Azure AI-Dienstes aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", "BedrockBizError": "Es ist ein Fehler bei der Anforderung des Bedrock-Dienstes aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", + "DeepSeekBizError": "Fehler bei der Anforderung des DeepSeek-Dienstes. Bitte überprüfen Sie die folgenden Informationen und versuchen Sie es erneut.", "GoogleBizError": "Es ist ein Fehler bei der Anforderung des Google-Dienstes aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", "GroqBizError": "Die Anfrage an den Groq-Dienst ist fehlgeschlagen. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", "InvalidAccessCode": "Das Passwort ist ungültig oder leer. Bitte geben Sie das richtige Zugangspasswort ein oder fügen Sie einen benutzerdefinierten API-Schlüssel hinzu.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Der Azure API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Azure API-Schlüssel und versuchen Sie es erneut.", "InvalidBedrockCredentials": "Die Bedrock-Authentifizierung ist fehlgeschlagen. Bitte überprüfen Sie AccessKeyId/SecretAccessKey und versuchen Sie es erneut.", "InvalidClerkUser": "Entschuldigung, du bist derzeit nicht angemeldet. Bitte melde dich an oder registriere ein Konto, um fortzufahren.", + "InvalidDeepSeekAPIKey": "DeepSeek-API-Schlüssel ungültig oder leer. Bitte überprüfen Sie den DeepSeek-API-Schlüssel und versuchen Sie es erneut.", "InvalidGoogleAPIKey": "Der Google API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Google API-Schlüssel und versuchen Sie es erneut.", "InvalidGroqAPIKey": "Der Groq API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Groq API-Schlüssel und versuchen Sie es erneut.", "InvalidMinimaxAPIKey": "Ungültiger oder leerer Minimax-API-Schlüssel. Bitte überprüfen Sie den Minimax-API-Schlüssel und versuchen Sie es erneut.", diff --git a/locales/de-DE/modelProvider.json b/locales/de-DE/modelProvider.json index 2d54eb5033a2..ac8f891dd34d 100644 --- a/locales/de-DE/modelProvider.json +++ b/locales/de-DE/modelProvider.json @@ -61,6 +61,18 @@ "title": "Verwenden Sie benutzerdefinierte Bedrock-Authentifizierungsinformationen" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Geben Sie Ihren API-Schlüssel von DeepSeek ein", + "placeholder": "DeepSeek API-Schlüssel", + "title": "API-Schlüssel" + }, + "unlock": { + "description": "Geben Sie Ihren DeepSeek API-Schlüssel ein, um die Sitzung zu starten. Die App speichert Ihren API-Schlüssel nicht.", + "title": "Verwenden Sie einen benutzerdefinierten DeepSeek API-Schlüssel" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/en-US/error.json b/locales/en-US/error.json index f98a5e13db43..ecb4cf737cbb 100644 --- a/locales/en-US/error.json +++ b/locales/en-US/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Error requesting Anthropic service. Please troubleshoot or retry based on the following information.", "AzureBizError": "Error requesting Azure AI service. Please troubleshoot or retry based on the following information.", "BedrockBizError": "Error requesting Bedrock service. Please troubleshoot or retry based on the following information.", + "DeepSeekBizError": "Error requesting DeepSeek service, please troubleshoot or retry based on the following information", "GoogleBizError": "Error requesting Google service. Please troubleshoot or retry based on the following information.", "GroqBizError": "Error occurred while requesting Groq service. Please troubleshoot based on the following information or retry.", "InvalidAccessCode": "Invalid access code or empty. Please enter the correct access code or add a custom API Key.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Azure API Key is incorrect or empty. Please check the Azure API Key and retry.", "InvalidBedrockCredentials": "Bedrock authentication failed. Please check the AccessKeyId/SecretAccessKey and retry.", "InvalidClerkUser": "Sorry, you are not currently logged in. Please log in or register an account to continue.", + "InvalidDeepSeekAPIKey": "The DeepSeek API Key is incorrect or empty, please check the DeepSeek API Key and try again", "InvalidGoogleAPIKey": "Google API Key is incorrect or empty. Please check the Google API Key and retry.", "InvalidGroqAPIKey": "Groq API Key is incorrect or empty. Please check the Groq API Key and retry.", "InvalidMinimaxAPIKey": "Incorrect or empty Minimax API Key, please check the Minimax API Key and try again", diff --git a/locales/en-US/modelProvider.json b/locales/en-US/modelProvider.json index 7884fffc30d4..6bfe4bb68567 100644 --- a/locales/en-US/modelProvider.json +++ b/locales/en-US/modelProvider.json @@ -61,6 +61,18 @@ "title": "Use Custom Bedrock Authentication Information" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Enter your API Key from DeepSeek", + "placeholder": "DeepSeek API Key", + "title": "API Key" + }, + "unlock": { + "description": "Enter your DeepSeek API Key to start the session. The app will not store your API Key.", + "title": "Use Custom DeepSeek API Key" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/es-ES/error.json b/locales/es-ES/error.json index 433aa233234e..d4567aad9f1f 100644 --- a/locales/es-ES/error.json +++ b/locales/es-ES/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Se ha producido un error al solicitar el servicio de inteligencia artificial de Anthropic. Por favor, revisa la siguiente información o inténtalo de nuevo.", "AzureBizError": "Se produjo un error al solicitar el servicio de Azure AI, por favor, verifica la siguiente información o inténtalo de nuevo", "BedrockBizError": "Se produjo un error al solicitar el servicio de Bedrock, por favor, verifica la siguiente información o inténtalo de nuevo", + "DeepSeekBizError": "Error al solicitar el servicio de DeepSeek. Por favor, revisa la siguiente información e inténtalo de nuevo.", "GoogleBizError": "Se produjo un error al solicitar el servicio de Google, por favor, verifica la siguiente información o inténtalo de nuevo", "GroqBizError": "Se produjo un error al solicitar el servicio Groq. Por favor, revise la siguiente información o inténtelo de nuevo", "InvalidAccessCode": "La contraseña no es válida o está vacía. Por favor, introduce una contraseña de acceso válida o añade una clave API personalizada", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "La clave de API de Azure es incorrecta o está vacía, por favor, verifica la clave de API de Azure e inténtalo de nuevo", "InvalidBedrockCredentials": "La autenticación de Bedrock no se ha completado con éxito, por favor, verifica AccessKeyId/SecretAccessKey e inténtalo de nuevo", "InvalidClerkUser": "Lo siento mucho, actualmente no has iniciado sesión. Por favor, inicia sesión o regístrate antes de continuar.", + "InvalidDeepSeekAPIKey": "La clave de API de DeepSeek no es válida o está vacía. Por favor, revisa la clave de API de DeepSeek e inténtalo de nuevo.", "InvalidGoogleAPIKey": "La clave de API de Google es incorrecta o está vacía, por favor, verifica la clave de API de Google e inténtalo de nuevo", "InvalidGroqAPIKey": "La clave de API de Groq es incorrecta o está vacía. Por favor, revisa la clave de API de Groq e inténtalo de nuevo.", "InvalidMinimaxAPIKey": "Clave de API de Minimax incorrecta o vacía, por favor, revise la clave de API de Minimax e inténtelo de nuevo", diff --git a/locales/es-ES/modelProvider.json b/locales/es-ES/modelProvider.json index 5dc1106e2723..f4df5100b372 100644 --- a/locales/es-ES/modelProvider.json +++ b/locales/es-ES/modelProvider.json @@ -61,6 +61,18 @@ "title": "Usar información de autenticación de Bedrock personalizada" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Introduce tu clave de API de DeepSeek", + "placeholder": "Clave de API de DeepSeek", + "title": "Clave de API" + }, + "unlock": { + "description": "Ingresa tu clave de API de DeepSeek para comenzar la sesión. La aplicación no guardará tu clave de API", + "title": "Usar clave de API personalizada de DeepSeek" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/fr-FR/error.json b/locales/fr-FR/error.json index 159eeb0c33d6..5a72bdb23f95 100644 --- a/locales/fr-FR/error.json +++ b/locales/fr-FR/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Erreur commerciale lors de la demande de service Anthropic AI. Veuillez vérifier les informations ci-dessous ou réessayer.", "AzureBizError": "Erreur lors de la demande de service Azure AI, veuillez vérifier les informations ci-dessous ou réessayer", "BedrockBizError": "Erreur lors de la demande de service Bedrock, veuillez vérifier les informations ci-dessous ou réessayer", + "DeepSeekBizError": "Erreur commerciale lors de la demande de service DeepSeek, veuillez suivre les informations ci-dessous pour dépanner ou réessayer", "GoogleBizError": "Erreur lors de la demande de service Google, veuillez vérifier les informations ci-dessous ou réessayer", "GroqBizError": "Une erreur s'est produite lors de la demande de service Groq. Veuillez vérifier les informations ci-dessous ou réessayer.", "InvalidAccessCode": "Le mot de passe est incorrect ou vide. Veuillez saisir le mot de passe d'accès correct ou ajouter une clé API personnalisée.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Clé API Azure incorrecte ou vide, veuillez vérifier la clé API Azure et réessayer", "InvalidBedrockCredentials": "L'authentification Bedrock a échoué, veuillez vérifier AccessKeyId/SecretAccessKey et réessayer", "InvalidClerkUser": "Désolé, vous n'êtes pas actuellement connecté. Veuillez vous connecter ou vous inscrire avant de continuer.", + "InvalidDeepSeekAPIKey": "Clé d'API DeepSeek incorrecte ou manquante, veuillez vérifier la clé d'API DeepSeek et réessayer", "InvalidGoogleAPIKey": "Clé API Google incorrecte ou vide, veuillez vérifier la clé API Google et réessayer", "InvalidGroqAPIKey": "Clé API Groq incorrecte ou vide, veuillez vérifier la clé API Groq et réessayer", "InvalidMinimaxAPIKey": "Clé API Minimax incorrecte ou vide, veuillez vérifier la clé API Minimax et réessayer", diff --git a/locales/fr-FR/modelProvider.json b/locales/fr-FR/modelProvider.json index aaf3915152b9..33363e9b89a7 100644 --- a/locales/fr-FR/modelProvider.json +++ b/locales/fr-FR/modelProvider.json @@ -61,6 +61,18 @@ "title": "Utiliser des informations d'authentification Bedrock personnalisées" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Enter your API Key from DeepSeek", + "placeholder": "DeepSeek API Key", + "title": "API Key" + }, + "unlock": { + "description": "Enter your DeepSeek API Key to start the session. The app will not store your API Key.", + "title": "Use Custom DeepSeek API Key" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/it-IT/error.json b/locales/it-IT/error.json index c805656c03a9..6c75e5b509b3 100644 --- a/locales/it-IT/error.json +++ b/locales/it-IT/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Si è verificato un errore durante la richiesta del servizio Anthropic AI. Si prega di controllare le informazioni seguenti o riprovare.", "AzureBizError": "Errore nella richiesta del servizio Azure AI, controlla le informazioni seguenti o riprova", "BedrockBizError": "Errore nella richiesta del servizio Bedrock, controlla le informazioni seguenti o riprova", + "DeepSeekBizError": "Errore di business DeepSeek, controlla le informazioni seguenti o riprova", "GoogleBizError": "Errore nella richiesta del servizio Google, controlla le informazioni seguenti o riprova", "GroqBizError": "Errore del servizio Groq, controlla le informazioni seguenti o riprova", "InvalidAccessCode": "Password incorrect or empty, please enter the correct access password, or add a custom API Key", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Chiave API Azure non corretta o vuota, controlla la chiave API Azure e riprova", "InvalidBedrockCredentials": "Autenticazione Bedrock non riuscita, controlla AccessKeyId/SecretAccessKey e riprova", "InvalidClerkUser": "Spiacenti, al momento non hai effettuato l'accesso. Per favore, effettua l'accesso o registrati prima di continuare.", + "InvalidDeepSeekAPIKey": "Chiave API DeepSeek non valida o vuota, controlla la chiave API DeepSeek e riprova", "InvalidGoogleAPIKey": "Chiave API Google non corretta o vuota, controlla la chiave API Google e riprova", "InvalidGroqAPIKey": "Chiave API Groq non valida o vuota, controlla la chiave API Groq e riprova", "InvalidMinimaxAPIKey": "Chiave API Minimax non valida o vuota, controllare la chiave API Minimax e riprovare", diff --git a/locales/it-IT/modelProvider.json b/locales/it-IT/modelProvider.json index d70fb02bc25e..77e1875ec074 100644 --- a/locales/it-IT/modelProvider.json +++ b/locales/it-IT/modelProvider.json @@ -61,6 +61,18 @@ "title": "Usa le informazioni di autenticazione Bedrock personalizzate" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Inserisci la chiave API di DeepSeek", + "placeholder": "Chiave API di DeepSeek", + "title": "Chiave API" + }, + "unlock": { + "description": "Inserisci la tua chiave API di DeepSeek per avviare la sessione. L'applicazione non memorizzerà la tua chiave API.", + "title": "Usa una chiave API personalizzata di DeepSeek" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/ja-JP/error.json b/locales/ja-JP/error.json index 5771b7f27e59..31dfb70a2b4d 100644 --- a/locales/ja-JP/error.json +++ b/locales/ja-JP/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Anthropic AIサービスのリクエストでエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再度お試しください。", "AzureBizError": "Azure AIサービスのリクエストでエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再試行してください。", "BedrockBizError": "Bedrockサービスのリクエストでエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再試行してください。", + "DeepSeekBizError": "DeepSeekサービスのリクエスト中にエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再度お試しください。", "GoogleBizError": "Googleサービスのリクエストでエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再試行してください。", "GroqBizError": "Groqサービスのリクエストでエラーが発生しました。以下の情報を確認して再試行してください。", "InvalidAccessCode": "パスワードが正しくないか空です。正しいアクセスパスワードを入力するか、カスタムAPIキーを追加してください", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Azure APIキーが正しくないか空です。Azure APIキーを確認してから再試行してください。", "InvalidBedrockCredentials": "Bedrockの認証に失敗しました。AccessKeyId/SecretAccessKeyを確認してから再試行してください。", "InvalidClerkUser": "申し訳ありませんが、現在ログインしていません。続行するにはログインまたはアカウント登録を行ってください", + "InvalidDeepSeekAPIKey": "DeepSeek APIキーが正しくないか空です。DeepSeek APIキーを確認してからもう一度お試しください。", "InvalidGoogleAPIKey": "Google APIキーが正しくないか空です。Google APIキーを確認してから再試行してください。", "InvalidGroqAPIKey": "Groq APIキーが正しくないか空です。Groq APIキーを確認して再試行してください。", "InvalidMinimaxAPIKey": "Minimax APIキーが正しくないか空です。Minimax APIキーを確認して再試行してください。", diff --git a/locales/ja-JP/modelProvider.json b/locales/ja-JP/modelProvider.json index a56953f6d2ca..865eee2edfe8 100644 --- a/locales/ja-JP/modelProvider.json +++ b/locales/ja-JP/modelProvider.json @@ -61,6 +61,18 @@ "title": "使用カスタム Bedrock 認証情報" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "DeepSeek の API キーを入力してください", + "placeholder": "DeepSeek API キー", + "title": "API キー" + }, + "unlock": { + "description": "DeepSeek の API キーを入力するとセッションが開始されます。アプリは API キーを記録しません", + "title": "カスタム DeepSeek API キーを使用" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/ko-KR/error.json b/locales/ko-KR/error.json index 86d315017d45..44e2a7ce1b4f 100644 --- a/locales/ko-KR/error.json +++ b/locales/ko-KR/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Anthropic AI 서비스 요청 중 오류가 발생했습니다. 다음 정보를 확인하고 다시 시도하십시오.", "AzureBizError": "Azure AI 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.", "BedrockBizError": "Bedrock 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.", + "DeepSeekBizError": "DeepSeek 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.", "GoogleBizError": "Google 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.", "GroqBizError": "Groq 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도해주세요.", "InvalidAccessCode": "액세스 코드가 잘못되었거나 비어 있습니다. 올바른 액세스 코드를 입력하거나 사용자 지정 API 키를 추가하십시오.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "잘못된 또는 비어 있는 Azure API Key입니다. Azure API Key를 확인한 후 다시 시도하십시오.", "InvalidBedrockCredentials": "Bedrock 인증에 실패했습니다. AccessKeyId/SecretAccessKey를 확인한 후 다시 시도하십시오.", "InvalidClerkUser": "죄송합니다. 현재 로그인되어 있지 않습니다. 계속하려면 먼저 로그인하거나 계정을 등록해주세요.", + "InvalidDeepSeekAPIKey": "DeepSeek API 키가 잘못되었거나 비어 있습니다. DeepSeek API 키를 확인한 후 다시 시도하십시오.", "InvalidGoogleAPIKey": "잘못된 또는 비어 있는 Google API Key입니다. Google API Key를 확인한 후 다시 시도하십시오.", "InvalidGroqAPIKey": "잘못된 또는 비어 있는 Groq API Key입니다. Groq API Key를 확인한 후 다시 시도하십시오.", "InvalidMinimaxAPIKey": "잘못된 Minimax API 키이거나 비어 있습니다. Minimax API 키를 확인한 후 다시 시도해주세요.", diff --git a/locales/ko-KR/modelProvider.json b/locales/ko-KR/modelProvider.json index 210993cc1673..87f36cf35af2 100644 --- a/locales/ko-KR/modelProvider.json +++ b/locales/ko-KR/modelProvider.json @@ -61,6 +61,18 @@ "title": "사용자 정의 Bedrock 인증 정보 사용" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "DeepSeek의 API 키를 입력하세요", + "placeholder": "DeepSeek API 키", + "title": "API 키" + }, + "unlock": { + "description": "DeepSeek API 키를 입력하면 세션을 시작할 수 있습니다. 애플리케이션은 API 키를 기록하지 않습니다.", + "title": "사용자 정의 DeepSeek API 키 사용" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/nl-NL/error.json b/locales/nl-NL/error.json index 6a391f746e28..64254344fddf 100644 --- a/locales/nl-NL/error.json +++ b/locales/nl-NL/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Er is een fout opgetreden bij het aanvragen van de Anthropic AI-service. Controleer de onderstaande informatie en probeer het opnieuw.", "AzureBizError": "Error requesting Azure AI service, please troubleshoot or retry based on the following information", "BedrockBizError": "Error requesting Bedrock service, please troubleshoot or retry based on the following information", + "DeepSeekBizError": "Er is een fout opgetreden bij het aanvragen van de DeepSeek-service. Controleer de volgende informatie en probeer het opnieuw.", "GoogleBizError": "Error requesting Google service, please troubleshoot or retry based on the following information", "GroqBizError": "Er is een fout opgetreden bij het aanroepen van de Groq-service. Controleer de onderstaande informatie of probeer het opnieuw.", "InvalidAccessCode": "Ongeldige toegangscode: het wachtwoord is onjuist of leeg. Voer de juiste toegangscode in of voeg een aangepaste API-sleutel toe.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Incorrect or empty Azure API Key, please check the Azure API Key and retry", "InvalidBedrockCredentials": "Bedrock authentication failed, please check AccessKeyId/SecretAccessKey and retry", "InvalidClerkUser": "Sorry, you are not currently logged in. Please log in or register an account to continue.", + "InvalidDeepSeekAPIKey": "DeepSeek API-sleutel is onjuist of leeg. Controleer de DeepSeek API-sleutel en probeer het opnieuw.", "InvalidGoogleAPIKey": "Incorrect or empty Google API Key, please check the Google API Key and retry", "InvalidGroqAPIKey": "Groq API Key is onjuist of leeg. Controleer de Groq API Key en probeer het opnieuw.", "InvalidMinimaxAPIKey": "Ongeldige of lege Minimax API-sleutel. Controleer de Minimax API-sleutel en probeer het opnieuw.", diff --git a/locales/nl-NL/modelProvider.json b/locales/nl-NL/modelProvider.json index b1b8f86f5cb3..3fa11a39bf59 100644 --- a/locales/nl-NL/modelProvider.json +++ b/locales/nl-NL/modelProvider.json @@ -61,6 +61,18 @@ "title": "Gebruik aangepaste Bedrock-verificatiegegevens" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Fill in your API Key from DeepSeek", + "placeholder": "DeepSeek API Key", + "title": "API Key" + }, + "unlock": { + "description": "Enter your DeepSeek API Key to start the session. The app will not store your API Key.", + "title": "Use Custom DeepSeek API Key" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/pl-PL/error.json b/locales/pl-PL/error.json index e9f28ce22f35..0a7be2267cd2 100644 --- a/locales/pl-PL/error.json +++ b/locales/pl-PL/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Wystąpił błąd biznesowy podczas żądania usługi Anthropic AI. Sprawdź poniższe informacje i spróbuj ponownie.", "AzureBizError": "Wystąpił błąd żądania usługi Azure AI, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.", "BedrockBizError": "Wystąpił błąd żądania usługi Bedrock, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.", + "DeepSeekBizError": "Błąd biznesowy podczas żądania usługi DeepSeek. Sprawdź poniższe informacje lub spróbuj ponownie.", "GoogleBizError": "Wystąpił błąd żądania usługi Google, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.", "GroqBizError": "Wystąpił błąd usługi Groq. Sprawdź poniższe informacje lub spróbuj ponownie.", "InvalidAccessCode": "Nieprawidłowy kod dostępu: Hasło jest nieprawidłowe lub puste. Proszę wprowadzić poprawne hasło dostępu lub dodać niestandardowy klucz API.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Nieprawidłowy lub pusty klucz API Azure, prosimy sprawdzić klucz API Azure i spróbować ponownie.", "InvalidBedrockCredentials": "Uwierzytelnienie Bedrock nie powiodło się, prosimy sprawdzić AccessKeyId/SecretAccessKey i spróbować ponownie.", "InvalidClerkUser": "Przepraszamy, nie jesteś obecnie zalogowany. Proszę najpierw zalogować się lub zarejestrować, aby kontynuować.", + "InvalidDeepSeekAPIKey": "Klucz API DeepSeek jest nieprawidłowy lub pusty. Sprawdź klucz API DeepSeek i spróbuj ponownie.", "InvalidGoogleAPIKey": "Nieprawidłowy lub pusty klucz API Google, prosimy sprawdzić klucz API Google i spróbować ponownie.", "InvalidGroqAPIKey": "Nieprawidłowy klucz API Groq, prosimy sprawdzić klucz API Groq i spróbować ponownie.", "InvalidMinimaxAPIKey": "Nieprawidłowy lub pusty klucz API Minimax, proszę sprawdzić klucz API Minimax i spróbować ponownie", diff --git a/locales/pl-PL/modelProvider.json b/locales/pl-PL/modelProvider.json index 4b8343511899..5219db1e2747 100644 --- a/locales/pl-PL/modelProvider.json +++ b/locales/pl-PL/modelProvider.json @@ -61,6 +61,18 @@ "title": "Użyj niestandardowych informacji uwierzytelniających Bedrock" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Wprowadź klucz API DeepSeek", + "placeholder": "Klucz API DeepSeek", + "title": "Klucz API" + }, + "unlock": { + "description": "Wprowadź swój klucz API DeepSeek, aby rozpocząć sesję. Aplikacja nie zapisuje Twojego klucza API.", + "title": "Użyj niestandardowego klucza API DeepSeek" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/pt-BR/error.json b/locales/pt-BR/error.json index 073e4c63d412..108bac269691 100644 --- a/locales/pt-BR/error.json +++ b/locales/pt-BR/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Erro de negócios ao solicitar o serviço Anthropic AI. Por favor, verifique as informações abaixo ou tente novamente.", "AzureBizError": "Erro ao solicitar o serviço Azure AI, por favor, verifique as informações abaixo ou tente novamente", "BedrockBizError": "Erro ao solicitar o serviço Bedrock, por favor, verifique as informações abaixo ou tente novamente", + "DeepSeekBizError": "Erro de negócio ao solicitar o serviço DeepSeek, por favor, verifique as informações abaixo ou tente novamente", "GoogleBizError": "Erro ao solicitar o serviço Google, por favor, verifique as informações abaixo ou tente novamente", "GroqBizError": "O serviço Groq encontrou um erro. Por favor, verifique as informações abaixo ou tente novamente.", "InvalidAccessCode": "Senha de acesso inválida ou em branco. Por favor, insira a senha de acesso correta ou adicione uma Chave de API personalizada.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Chave de API Azure incorreta ou vazia, por favor, verifique a chave de API Azure e tente novamente", "InvalidBedrockCredentials": "Credenciais Bedrock inválidas, por favor, verifique AccessKeyId/SecretAccessKey e tente novamente", "InvalidClerkUser": "Desculpe, você ainda não fez login. Por favor, faça login ou registre uma conta antes de continuar.", + "InvalidDeepSeekAPIKey": "Chave da API DeepSeek inválida ou em branco, por favor, verifique a chave da API DeepSeek e tente novamente", "InvalidGoogleAPIKey": "Chave de API Google incorreta ou vazia, por favor, verifique a chave de API Google e tente novamente", "InvalidGroqAPIKey": "Chave de API Groq AI inválida ou em branco, verifique a chave de API Groq e tente novamente", "InvalidMinimaxAPIKey": "Chave de API Minimax inválida ou em branco, verifique a chave de API Minimax e tente novamente", diff --git a/locales/pt-BR/modelProvider.json b/locales/pt-BR/modelProvider.json index 8e98cc9a99b2..04e49aec24a1 100644 --- a/locales/pt-BR/modelProvider.json +++ b/locales/pt-BR/modelProvider.json @@ -61,6 +61,18 @@ "title": "Usar informações de autenticação Bedrock personalizadas" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Insira a chave da API do DeepSeek", + "placeholder": "Chave da API do DeepSeek", + "title": "Chave da API" + }, + "unlock": { + "description": "Digite sua chave da API do DeepSeek para iniciar a sessão. O aplicativo não irá armazenar sua chave da API", + "title": "Usar chave da API personalizada do DeepSeek" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/ru-RU/error.json b/locales/ru-RU/error.json index db12738664f8..54508fd535c6 100644 --- a/locales/ru-RU/error.json +++ b/locales/ru-RU/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Ошибка запроса к сервису Anthropic AI. Пожалуйста, проверьте информацию ниже или повторите попытку", "AzureBizError": "Ошибка запроса службы Azure AI, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией", "BedrockBizError": "Ошибка запроса службы Bedrock, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией", + "DeepSeekBizError": "Ошибка обращения к сервису DeepSeek. Пожалуйста, проверьте информацию ниже и повторите попытку", "GoogleBizError": "Ошибка запроса службы Google, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией", "GroqBizError": "Ошибка обращения к сервису Groq. Пожалуйста, проверьте следующую информацию или повторите попытку", "InvalidAccessCode": "Неверный код доступа: введите правильный код доступа или добавьте пользовательский ключ API", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Неверный или пустой ключ API Azure, пожалуйста, проверьте ключ API Azure и повторите попытку", "InvalidBedrockCredentials": "Аутентификация Bedrock не прошла, пожалуйста, проверьте AccessKeyId/SecretAccessKey и повторите попытку", "InvalidClerkUser": "Извините, вы еще не вошли в систему. Пожалуйста, войдите или зарегистрируйтесь, прежде чем продолжить", + "InvalidDeepSeekAPIKey": "Неверный или пустой ключ DeepSeek API. Пожалуйста, проверьте ключ DeepSeek API и повторите попытку", "InvalidGoogleAPIKey": "Неверный или пустой ключ API Google, пожалуйста, проверьте ключ API Google и повторите попытку", "InvalidGroqAPIKey": "Неверный или пустой ключ API Groq, пожалуйста, проверьте ключ API Groq и повторите попытку", "InvalidMinimaxAPIKey": "Неверный или пустой ключ Minimax API. Пожалуйста, проверьте ключ Minimax API и повторите попытку", diff --git a/locales/ru-RU/modelProvider.json b/locales/ru-RU/modelProvider.json index 74f931d0589a..05673bb60d89 100644 --- a/locales/ru-RU/modelProvider.json +++ b/locales/ru-RU/modelProvider.json @@ -61,6 +61,18 @@ "title": "Использовать пользовательскую информацию аутентификации Bedrock" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "填入来自 DeepSeek 的 API Key", + "placeholder": "DeepSeek API Key", + "title": "API Key" + }, + "unlock": { + "description": "输入你的 DeepSeek API Key 即可开始会话。应用不会记录你的 API Key", + "title": "使用自定义 DeepSeek API Key" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/tr-TR/error.json b/locales/tr-TR/error.json index 45f4ed12b1aa..26a51e5f8e3f 100644 --- a/locales/tr-TR/error.json +++ b/locales/tr-TR/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Anthropic AI hizmetine yönelik istek hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin", "AzureBizError": "Azure AI servisi isteği hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin", "BedrockBizError": "Bedrock servisi isteği hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin", + "DeepSeekBizError": "DeepSeek hizmetine yapılan istekte hata oluştu, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin", "GoogleBizError": "Google servisi isteği hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin", "GroqBizError": "Groq hizmeti isteği sırasında bir hata oluştu. Lütfen aşağıdaki bilgilere göre sorunu giderin veya tekrar deneyin", "InvalidAccessCode": "Geçersiz Erişim Kodu: Geçersiz veya boş bir şifre girdiniz. Lütfen doğru erişim şifresini girin veya özel API Anahtarı ekleyin.", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Azure API Anahtarı yanlış veya boş, lütfen Azure API Anahtarınızı kontrol edip tekrar deneyin", "InvalidBedrockCredentials": "Bedrock kimlik doğrulaması geçersiz, lütfen AccessKeyId/SecretAccessKey bilgilerinizi kontrol edip tekrar deneyin", "InvalidClerkUser": "Üzgünüz, şu anda giriş yapmadınız. Lütfen işlemlere devam etmeden önce giriş yapın veya hesap oluşturun", + "InvalidDeepSeekAPIKey": "DeepSeek API Anahtarı geçersiz veya boş, lütfen DeepSeek API Anahtarınızı kontrol edip tekrar deneyin", "InvalidGoogleAPIKey": "Google API Anahtarı yanlış veya boş, lütfen Google API Anahtarınızı kontrol edip tekrar deneyin", "InvalidGroqAPIKey": "Groq API Anahtarı yanlış veya boş, lütfen Groq API Anahtarınızı kontrol edip tekrar deneyin", "InvalidMinimaxAPIKey": "Minimax API Anahtarı geçersiz veya boş, lütfen Minimax API Anahtarınızı kontrol edip tekrar deneyin", diff --git a/locales/tr-TR/modelProvider.json b/locales/tr-TR/modelProvider.json index eedd099be1db..051f33904a77 100644 --- a/locales/tr-TR/modelProvider.json +++ b/locales/tr-TR/modelProvider.json @@ -61,6 +61,18 @@ "title": "Özel Bedrock Kimlik Bilgilerini Kullan" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "DeepSeek 的 API Anahtarını girin", + "placeholder": "DeepSeek API Anahtarı", + "title": "API Anahtarı" + }, + "unlock": { + "description": "Oturumu başlatmak için DeepSeek API Anahtarınızı girin. Uygulama API Anahtarınızı kaydetmez", + "title": "Özel DeepSeek API Anahtarını Kullan" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/vi-VN/error.json b/locales/vi-VN/error.json index 042ddd7b5ff5..c4ef6b748124 100644 --- a/locales/vi-VN/error.json +++ b/locales/vi-VN/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "Yêu cầu dịch vụ AI Anthropic gặp lỗi, vui lòng kiểm tra thông tin dưới đây hoặc thử lại", "AzureBizError": "Yêu cầu dịch vụ Azure AI gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây", "BedrockBizError": "Yêu cầu dịch vụ Bedrock gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây", + "DeepSeekBizError": "Yêu cầu dịch vụ DeepSeek gặp lỗi, vui lòng kiểm tra thông tin dưới đây hoặc thử lại", "GoogleBizError": "Yêu cầu dịch vụ Google gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây", "GroqBizError": "Yêu cầu dịch vụ Groq gặp sự cố, vui lòng kiểm tra thông tin bên dưới hoặc thử lại", "InvalidAccessCode": "Mật khẩu truy cập không hợp lệ hoặc trống, vui lòng nhập mật khẩu truy cập đúng hoặc thêm Khóa API tùy chỉnh", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Khóa API Azure không chính xác hoặc trống, vui lòng kiểm tra lại Khóa API Azure và thử lại", "InvalidBedrockCredentials": "Xác thực Bedrock không thành công, vui lòng kiểm tra AccessKeyId/SecretAccessKey và thử lại", "InvalidClerkUser": "Xin lỗi, bạn chưa đăng nhập. Vui lòng đăng nhập hoặc đăng ký tài khoản trước khi tiếp tục.", + "InvalidDeepSeekAPIKey": "Khóa API DeepSeek không hợp lệ hoặc trống, vui lòng kiểm tra lại và thử lại", "InvalidGoogleAPIKey": "Khóa API Google không chính xác hoặc trống, vui lòng kiểm tra lại Khóa API Google và thử lại", "InvalidGroqAPIKey": "Khóa API Groq không hợp lệ hoặc trống, vui lòng kiểm tra lại Khóa API Groq và thử lại", "InvalidMinimaxAPIKey": "Khóa API Minimax không hợp lệ hoặc trống, vui lòng kiểm tra lại Khóa API Minimax và thử lại", diff --git a/locales/vi-VN/modelProvider.json b/locales/vi-VN/modelProvider.json index 6fd3ea5ca863..9fa98660bdbd 100644 --- a/locales/vi-VN/modelProvider.json +++ b/locales/vi-VN/modelProvider.json @@ -61,6 +61,18 @@ "title": "Sử dụng Thông tin Xác thực Bedrock tùy chỉnh" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "Nhập API Key từ DeepSeek", + "placeholder": "Khóa API DeepSeek", + "title": "API Key" + }, + "unlock": { + "description": "Nhập API Key của bạn từ DeepSeek để bắt đầu phiên làm việc. Ứng dụng sẽ không lưu trữ API Key của bạn", + "title": "Sử dụng API Key DeepSeek tùy chỉnh" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/zh-CN/error.json b/locales/zh-CN/error.json index e9335d653a83..57ec43bbdae6 100644 --- a/locales/zh-CN/error.json +++ b/locales/zh-CN/error.json @@ -78,6 +78,8 @@ "InvalidGoogleAPIKey": "Google API Key 不正确或为空,请检查 Google API Key 后重试", "InvalidBedrockCredentials": "Bedrock 鉴权未通过,请检查 AccessKeyId/SecretAccessKey 后重试", "BedrockBizError": "请求 Bedrock 服务出错,请根据以下信息排查或重试", + "InvalidDeepSeekAPIKey": "DeepSeek API Key 不正确或为空,请检查 DeepSeek API Key 后重试", + "DeepSeekBizError": "请求 DeepSeek 服务出错,请根据以下信息排查或重试", "InvalidAzureAPIKey": "Azure API Key 不正确或为空,请检查 Azure API Key 后重试", "AzureBizError": "请求 Azure AI 服务出错,请根据以下信息排查或重试", "InvalidPerplexityAPIKey": "Perplexity API Key 不正确或为空,请检查 Perplexity API Key 后重试", diff --git a/locales/zh-CN/modelProvider.json b/locales/zh-CN/modelProvider.json index 624993ad2907..3c13da0cc199 100644 --- a/locales/zh-CN/modelProvider.json +++ b/locales/zh-CN/modelProvider.json @@ -61,6 +61,18 @@ "title": "使用自定义 Bedrock 鉴权信息" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "填入来自 DeepSeek 的 API Key", + "placeholder": "DeepSeek API Key", + "title": "API Key" + }, + "unlock": { + "description": "输入你的 DeepSeek API Key 即可开始会话。应用不会记录你的 API Key", + "title": "使用自定义 DeepSeek API Key" + } + }, "google": { "title": "Google", "token": { diff --git a/locales/zh-TW/error.json b/locales/zh-TW/error.json index a22454f8e1f2..cd42e21ad063 100644 --- a/locales/zh-TW/error.json +++ b/locales/zh-TW/error.json @@ -55,6 +55,7 @@ "AnthropicBizError": "請求 Anthropic AI 服務出錯,請根據以下信息排查或重試", "AzureBizError": "請求 Azure AI 服務出錯,請根據以下信息排查或重試", "BedrockBizError": "請求 Bedrock 服務出錯,請根據以下信息排查或重試", + "DeepSeekBizError": "請求 DeepSeek 服務出錯,請根據以下資訊排查或重試", "GoogleBizError": "請求 Google 服務出錯,請根據以下信息排查或重試", "GroqBizError": "請求 Groq 服務出錯,請根據以下信息排查或重試", "InvalidAccessCode": "密碼不正確或為空,請輸入正確的訪問密碼,或添加自定義 API 金鑰", @@ -62,6 +63,7 @@ "InvalidAzureAPIKey": "Azure API Key 不正確或為空,請檢查 Azure API Key 後重試", "InvalidBedrockCredentials": "Bedrock 驗證未通過,請檢查 AccessKeyId/SecretAccessKey 後重試", "InvalidClerkUser": "很抱歉,你當前尚未登錄,請先登錄或註冊帳號後繼續操作", + "InvalidDeepSeekAPIKey": "DeepSeek API 金鑰不正確或為空,請檢查 DeepSeek API 金鑰後重試", "InvalidGoogleAPIKey": "Google API Key 不正確或為空,請檢查 Google API Key 後重試", "InvalidGroqAPIKey": "Groq API 金鑰不正確或為空,請檢查 Groq API 金鑰後重試", "InvalidMinimaxAPIKey": "Minimax API 金鑰不正確或為空,請檢查 Minimax API 金鑰後重試", diff --git a/locales/zh-TW/modelProvider.json b/locales/zh-TW/modelProvider.json index f4992e9ca449..0a8f7185f7a4 100644 --- a/locales/zh-TW/modelProvider.json +++ b/locales/zh-TW/modelProvider.json @@ -61,6 +61,18 @@ "title": "使用自定義 Bedrock 驗證資訊" } }, + "deepseek": { + "title": "DeepSeek", + "token": { + "desc": "填入來自 DeepSeek 的 API 金鑰", + "placeholder": "DeepSeek API 金鑰", + "title": "API 金鑰" + }, + "unlock": { + "description": "輸入你的 DeepSeek API 金鑰即可開始會話。應用程式不會記錄你的 API 金鑰", + "title": "使用自訂 DeepSeek API 金鑰" + } + }, "google": { "title": "Google", "token": { diff --git a/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx b/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx index 106334b6bfe9..75f68fadc314 100644 --- a/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +++ b/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx @@ -3,7 +3,6 @@ import { ActionIcon, Avatar, ChatHeaderTitle } from '@lobehub/ui'; import { Skeleton } from 'antd'; import { PanelLeftClose, PanelLeftOpen } from 'lucide-react'; -import Link from 'next/link'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; @@ -45,20 +44,19 @@ const Main = memo(() => { ) : ( { - - { - const currentShowSessionPanel = useGlobalStore.getState().preference.showSessionPanel; - useGlobalStore.getState().updatePreference({ - sessionsWidth: currentShowSessionPanel ? 0 : 320, - showSessionPanel: !currentShowSessionPanel, - }); - }} - size="large" - title={t('agentsAndConversations')} - /> - + { + const currentShowSessionPanel = useGlobalStore.getState().preference.showSessionPanel; + useGlobalStore.getState().updatePreference({ + sessionsWidth: currentShowSessionPanel ? 0 : 320, + showSessionPanel: !currentShowSessionPanel, + }); + }} + size="large" + title={t('agentsAndConversations')} + /> } { + return ( + } + /> + ); +}); + +export default DeepSeekProvider; diff --git a/src/app/(main)/settings/llm/index.tsx b/src/app/(main)/settings/llm/index.tsx index 727dcc059307..68cc4f6401cf 100644 --- a/src/app/(main)/settings/llm/index.tsx +++ b/src/app/(main)/settings/llm/index.tsx @@ -5,6 +5,7 @@ import { Flexbox } from 'react-layout-kit'; import Anthropic from './Anthropic'; import Azure from './Azure'; import Bedrock from './Bedrock'; +import DeepSeek from './DeepSeek'; import Google from './Google'; import Groq from './Groq'; import Minimax from './Minimax'; @@ -28,6 +29,7 @@ const Page = () => { + diff --git a/src/app/api/chat/agentRuntime.test.ts b/src/app/api/chat/agentRuntime.test.ts index 87ea783f2af1..7386e50fef61 100644 --- a/src/app/api/chat/agentRuntime.test.ts +++ b/src/app/api/chat/agentRuntime.test.ts @@ -16,6 +16,7 @@ import { LobeOpenRouterAI, LobePerplexityAI, LobeRuntimeAI, + LobeDeepSeekAI, LobeTogetherAI, LobeZeroOneAI, LobeZhipuAI, @@ -42,6 +43,7 @@ vi.mock('@/config/server', () => ({ AWS_REGION: 'test-aws-region', OLLAMA_PROXY_URL: 'https://test-ollama-url.local', PERPLEXITY_API_KEY: 'test-perplexity-key', + DEEPSEEK_API_KEY: 'test-deepseek-key', ANTHROPIC_API_KEY: 'test-anthropic-key', MINIMAX_API_KEY: 'test-minimax-key', MISTRAL_API_KEY: 'test-mistral-key', @@ -153,6 +155,13 @@ describe('initAgentRuntimeWithUserPayload method', () => { expect(runtime['_runtime']).toBeInstanceOf(LobeOpenRouterAI); }); + it('DeepSeek AI provider: with apikey', async () => { + const jwtPayload: JWTPayload = { apiKey: 'user-deepseek-key' }; + const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.DeepSeek, jwtPayload); + expect(runtime).toBeInstanceOf(AgentRuntime); + expect(runtime['_runtime']).toBeInstanceOf(LobeDeepSeekAI); + }); + it('Together AI provider: with apikey', async () => { const jwtPayload: JWTPayload = { apiKey: 'user-togetherai-key' }; const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.TogetherAI, jwtPayload); @@ -279,6 +288,14 @@ describe('initAgentRuntimeWithUserPayload method', () => { expect(runtime['_runtime']).toBeInstanceOf(LobeOpenRouterAI); }); + it('DeepSeek AI provider: without apikey', async () => { + const jwtPayload = {}; + const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.DeepSeek, jwtPayload); + + // 假设 LobeDeepSeekAI 是 DeepSeek 提供者的实现类 + expect(runtime['_runtime']).toBeInstanceOf(LobeDeepSeekAI); + }); + it('Together AI provider: without apikey', async () => { const jwtPayload = {}; const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.TogetherAI, jwtPayload); diff --git a/src/app/api/chat/agentRuntime.ts b/src/app/api/chat/agentRuntime.ts index 57649b764c1a..84c5243ed202 100644 --- a/src/app/api/chat/agentRuntime.ts +++ b/src/app/api/chat/agentRuntime.ts @@ -137,6 +137,11 @@ const getLlmOptionsFromPayload = (provider: string, payload: JWTPayload) => { return { apiKey }; } + case ModelProvider.DeepSeek: { + const { DEEPSEEK_API_KEY } = getServerConfig(); + const apiKey = apiKeyManager.pick(payload?.apiKey || DEEPSEEK_API_KEY); + return { apiKey }; + } case ModelProvider.TogetherAI: { const { TOGETHERAI_API_KEY } = getServerConfig(); diff --git a/src/app/api/errorResponse.test.ts b/src/app/api/errorResponse.test.ts index 8c243c187ec8..1bf2c7a379fe 100644 --- a/src/app/api/errorResponse.test.ts +++ b/src/app/api/errorResponse.test.ts @@ -132,6 +132,12 @@ describe('createErrorResponse', () => { const response = createErrorResponse(errorType); expect(response.status).toBe(485); }); + + it('returns a 486 status for DeepSeekBizError error type', () => { + const errorType = AgentRuntimeErrorType.DeepSeekBizError; + const response = createErrorResponse(errorType); + expect(response.status).toBe(486); + }); }); // 测试状态码不在200-599范围内的情况 diff --git a/src/app/api/errorResponse.ts b/src/app/api/errorResponse.ts index c0fb5ac45718..880241f48e4e 100644 --- a/src/app/api/errorResponse.ts +++ b/src/app/api/errorResponse.ts @@ -65,6 +65,9 @@ const getStatus = (errorType: ILobeAgentRuntimeErrorType | ErrorType) => { case AgentRuntimeErrorType.MinimaxBizError: { return 485; } + case AgentRuntimeErrorType.DeepSeekBizError: { + return 486; + } } return errorType as number; }; diff --git a/src/components/ModelIcon/index.tsx b/src/components/ModelIcon/index.tsx index 889ddc123198..932e93519065 100644 --- a/src/components/ModelIcon/index.tsx +++ b/src/components/ModelIcon/index.tsx @@ -9,6 +9,7 @@ import { Claude, Cohere, Dbrx, + DeepSeek, FishAudio, Gemini, Gemma, @@ -46,6 +47,7 @@ const ModelIcon = memo(({ model: originModel, size = 12 if (model.includes('gpt-3')) return ; if (model.includes('gpt-4')) return ; if (model.startsWith('glm') || model.includes('chatglm')) return ; + if (model.includes('deepseek')) return ; if (model.includes('claude')) return ; if (model.includes('titan')) return ; if (model.includes('llama')) return ; diff --git a/src/components/ModelProviderIcon/index.tsx b/src/components/ModelProviderIcon/index.tsx index e905f86e43c6..39473f554d94 100644 --- a/src/components/ModelProviderIcon/index.tsx +++ b/src/components/ModelProviderIcon/index.tsx @@ -2,6 +2,7 @@ import { Anthropic, Azure, Bedrock, + DeepSeek, Google, Groq, Minimax, @@ -34,6 +35,10 @@ const ModelProviderIcon = memo(({ provider }) => { return ; } + case ModelProvider.DeepSeek: { + return ; + } + case ModelProvider.Google: { return (
diff --git a/src/components/ModelTag/ModelIcon.tsx b/src/components/ModelTag/ModelIcon.tsx index 6d74e08f7018..6465ff9c5bed 100644 --- a/src/components/ModelTag/ModelIcon.tsx +++ b/src/components/ModelTag/ModelIcon.tsx @@ -9,6 +9,7 @@ import { Claude, Cohere, Dbrx, + DeepSeek, FishAudio, Gemini, Gemma, @@ -43,6 +44,7 @@ const ModelIcon = memo(({ model, size = 12 }) => { if (model.startsWith('gpt')) return ; if (model.startsWith('glm') || model.includes('chatglm')) return ; if (model.includes('claude')) return ; + if (model.includes('deepseek')) return ; if (model.includes('titan')) return ; if (model.includes('llama')) return ; if (model.includes('llava')) return ; diff --git a/src/config/modelProviders/deepseek.ts b/src/config/modelProviders/deepseek.ts new file mode 100644 index 000000000000..b9f4a46751e2 --- /dev/null +++ b/src/config/modelProviders/deepseek.ts @@ -0,0 +1,23 @@ +import { ModelProviderCard } from '@/types/llm'; + +const DeepSeek: ModelProviderCard = { + chatModels: [ + { + description: '擅长通用对话任务', + displayName: 'DeepSeek-V2', + enabled: true, + id: 'deepseek-chat', + tokens: 32_768, + }, + { + description: '擅长编程场景', + displayName: 'DeepSeek-coder', + enabled: true, + id: 'deepseek-coder', + tokens: 16_384, + }, + ], + id: 'deepseek', +}; + +export default DeepSeek; \ No newline at end of file diff --git a/src/config/modelProviders/index.ts b/src/config/modelProviders/index.ts index 450c321a5fd7..20f9793880ff 100644 --- a/src/config/modelProviders/index.ts +++ b/src/config/modelProviders/index.ts @@ -3,6 +3,7 @@ import { ChatModelCard, ModelProviderCard } from '@/types/llm'; import AnthropicProvider from './anthropic'; import AzureProvider from './azure'; import BedrockProvider from './bedrock'; +import DeepSeekProvider from './deepseek'; import GoogleProvider from './google'; import GroqProvider from './groq'; import MinimaxProvider from './minimax'; @@ -20,6 +21,7 @@ export const LOBE_DEFAULT_MODEL_LIST: ChatModelCard[] = [ OpenAIProvider.chatModels, ZhiPuProvider.chatModels, BedrockProvider.chatModels, + DeepSeekProvider.chatModels, GoogleProvider.chatModels, GroqProvider.chatModels, MinimaxProvider.chatModels, @@ -38,6 +40,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [ { ...AzureProvider, chatModels: [] }, OllamaProvider, AnthropicProvider, + DeepSeekProvider, GoogleProvider, OpenRouterProvider, TogetherAIProvider, @@ -58,6 +61,7 @@ export const filterEnabledModels = (provider: ModelProviderCard) => { export { default as AnthropicProviderCard } from './anthropic'; export { default as AzureProviderCard } from './azure'; export { default as BedrockProviderCard } from './bedrock'; +export { default as DeepSeekProviderCard } from './deepseek'; export { default as GoogleProviderCard } from './google'; export { default as GroqProviderCard } from './groq'; export { default as MinimaxProviderCard } from './minimax'; diff --git a/src/config/server/provider.ts b/src/config/server/provider.ts index 28b43e91873d..4c6b8cafd4c9 100644 --- a/src/config/server/provider.ts +++ b/src/config/server/provider.ts @@ -19,6 +19,10 @@ declare global { AZURE_ENDPOINT?: string; AZURE_API_VERSION?: string; + // DeepSeek Provider + ENABLED_DEEPSEEK?: string; + DEEPSEEK_API_KEY?: string; + // ZhiPu Provider ENABLED_ZHIPU?: string; ZHIPU_API_KEY?: string; @@ -105,8 +109,11 @@ export const getProviderConfig = () => { const AZURE_API_KEY = process.env.AZURE_API_KEY || ''; const ZHIPU_API_KEY = process.env.ZHIPU_API_KEY || ''; + const AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID || ''; + const DEEPSEEK_API_KEY = process.env.DEEPSEEK_API_KEY || ''; + const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY || ''; const MOONSHOT_API_KEY = process.env.MOONSHOT_API_KEY || ''; @@ -168,6 +175,9 @@ export const getProviderConfig = () => { ENABLED_ZHIPU: !!ZHIPU_API_KEY, ZHIPU_API_KEY, + ENABLED_DEEPSEEK: !!DEEPSEEK_API_KEY, + DEEPSEEK_API_KEY, + ENABLED_GOOGLE: !!GOOGLE_API_KEY, GOOGLE_API_KEY, GOOGLE_PROXY_URL: process.env.GOOGLE_PROXY_URL, diff --git a/src/const/settings/index.ts b/src/const/settings/index.ts index ee2330de4050..77d233dfee30 100644 --- a/src/const/settings/index.ts +++ b/src/const/settings/index.ts @@ -1,6 +1,7 @@ import { AnthropicProviderCard, BedrockProviderCard, + DeepSeekProviderCard, GoogleProviderCard, GroqProviderCard, MinimaxProviderCard, @@ -81,6 +82,11 @@ export const DEFAULT_LLM_CONFIG: GlobalLLMConfig = { region: 'us-east-1', secretAccessKey: '', }, + deepseek: { + apiKey: '', + enabled: false, + enabledModels: filterEnabledModels(DeepSeekProviderCard), + }, google: { apiKey: '', enabled: false, diff --git a/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx b/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx index 60f3216807cd..d332f54a0ee8 100644 --- a/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx +++ b/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx @@ -1,5 +1,6 @@ import { Anthropic, + DeepSeek, Google, Groq, Minimax, @@ -53,6 +54,10 @@ const ProviderAvatar = memo(({ provider }) => { return ; } + case ModelProvider.DeepSeek: { + return ; + } + case ModelProvider.Groq: { return ; } diff --git a/src/features/Conversation/Error/APIKeyForm/index.tsx b/src/features/Conversation/Error/APIKeyForm/index.tsx index 6529dce127cd..c6fac5869f7b 100644 --- a/src/features/Conversation/Error/APIKeyForm/index.tsx +++ b/src/features/Conversation/Error/APIKeyForm/index.tsx @@ -43,6 +43,10 @@ const APIKeyForm = memo(({ id, provider }) => { return 'gsk_*****************************'; } + case ModelProvider.DeepSeek: { + return 'sk_******************************'; + } + default: { return '*********************************'; } diff --git a/src/features/Conversation/Error/index.tsx b/src/features/Conversation/Error/index.tsx index e41528991dec..0ac0ad4e9fdf 100644 --- a/src/features/Conversation/Error/index.tsx +++ b/src/features/Conversation/Error/index.tsx @@ -73,6 +73,7 @@ const ErrorMessageExtra = memo<{ data: ChatMessage }>(({ data }) => { } case AgentRuntimeErrorType.InvalidBedrockCredentials: + case AgentRuntimeErrorType.InvalidDeepSeekAPIKey: case AgentRuntimeErrorType.InvalidZhipuAPIKey: case AgentRuntimeErrorType.InvalidMinimaxAPIKey: case AgentRuntimeErrorType.InvalidMistralAPIKey: diff --git a/src/libs/agent-runtime/AgentRuntime.ts b/src/libs/agent-runtime/AgentRuntime.ts index 599e188a28a6..bec176eb5c93 100644 --- a/src/libs/agent-runtime/AgentRuntime.ts +++ b/src/libs/agent-runtime/AgentRuntime.ts @@ -6,6 +6,7 @@ import { LobeRuntimeAI } from './BaseAI'; import { LobeAnthropicAI } from './anthropic'; import { LobeAzureOpenAI } from './azureOpenai'; import { LobeBedrockAI, LobeBedrockAIParams } from './bedrock'; +import { LobeDeepSeekAI } from './deepseek'; import { LobeGoogleAI } from './google'; import { LobeGroq } from './groq'; import { LobeMinimaxAI } from './minimax'; @@ -101,6 +102,7 @@ class AgentRuntime { anthropic: Partial; azure: { apiVersion?: string; apikey?: string; endpoint?: string }; bedrock: Partial; + deepseek: Partial; google: { apiKey?: string; baseURL?: string }; groq: Partial; minimax: Partial; @@ -169,6 +171,11 @@ class AgentRuntime { break; } + case ModelProvider.DeepSeek: { + runtimeModel = new LobeDeepSeekAI(params.deepseek ?? {}); + break; + } + case ModelProvider.Minimax: { runtimeModel = new LobeMinimaxAI(params.minimax ?? {}); break; diff --git a/src/libs/agent-runtime/deepseek/index.test.ts b/src/libs/agent-runtime/deepseek/index.test.ts new file mode 100644 index 000000000000..0769a296c4dd --- /dev/null +++ b/src/libs/agent-runtime/deepseek/index.test.ts @@ -0,0 +1,254 @@ +// @vitest-environment node +import OpenAI from 'openai'; +import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; + +import { + ChatStreamCallbacks, + LobeOpenAICompatibleRuntime, + ModelProvider, +} from '@/libs/agent-runtime'; + +import * as debugStreamModule from '../utils/debugStream'; +import { LobeDeepSeekAI } from './index'; + +const provider = ModelProvider.DeepSeek; +const defaultBaseURL = 'https://api.deepseek.com/v1'; +const bizErrorType = 'DeepSeekBizError'; +const invalidErrorType = 'InvalidDeepSeekAPIKey'; + +// Mock the console.error to avoid polluting test output +vi.spyOn(console, 'error').mockImplementation(() => {}); + +let instance: LobeOpenAICompatibleRuntime; + +beforeEach(() => { + instance = new LobeDeepSeekAI({ apiKey: 'test' }); + + // 使用 vi.spyOn 来模拟 chat.completions.create 方法 + vi.spyOn(instance['client'].chat.completions, 'create').mockResolvedValue( + new ReadableStream() as any, + ); +}); + +afterEach(() => { + vi.clearAllMocks(); +}); + +describe('LobeDeepSeekAI', () => { + describe('init', () => { + it('should correctly initialize with an API key', async () => { + const instance = new LobeDeepSeekAI({ apiKey: 'test_api_key' }); + expect(instance).toBeInstanceOf(LobeDeepSeekAI); + expect(instance.baseURL).toEqual(defaultBaseURL); + }); + }); + + describe('chat', () => { + describe('Error', () => { + it('should return OpenAIBizError with an openai error response when OpenAI.APIError is thrown', async () => { + // Arrange + const apiError = new OpenAI.APIError( + 400, + { + status: 400, + error: { + message: 'Bad Request', + }, + }, + 'Error message', + {}, + ); + + vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(apiError); + + // Act + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'deepseek-chat', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + endpoint: defaultBaseURL, + error: { + error: { message: 'Bad Request' }, + status: 400, + }, + errorType: bizErrorType, + provider, + }); + } + }); + + it('should throw AgentRuntimeError with NoOpenAIAPIKey if no apiKey is provided', async () => { + try { + new LobeDeepSeekAI({}); + } catch (e) { + expect(e).toEqual({ errorType: invalidErrorType }); + } + }); + + it('should return OpenAIBizError with the cause when OpenAI.APIError is thrown with cause', async () => { + // Arrange + const errorInfo = { + stack: 'abc', + cause: { + message: 'api is undefined', + }, + }; + const apiError = new OpenAI.APIError(400, errorInfo, 'module error', {}); + + vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(apiError); + + // Act + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'deepseek-chat', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + endpoint: defaultBaseURL, + error: { + cause: { message: 'api is undefined' }, + stack: 'abc', + }, + errorType: bizErrorType, + provider, + }); + } + }); + + it('should return OpenAIBizError with an cause response with desensitize Url', async () => { + // Arrange + const errorInfo = { + stack: 'abc', + cause: { message: 'api is undefined' }, + }; + const apiError = new OpenAI.APIError(400, errorInfo, 'module error', {}); + + instance = new LobeDeepSeekAI({ + apiKey: 'test', + + baseURL: 'https://api.abc.com/v1', + }); + + vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(apiError); + + // Act + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'deepseek-chat', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + endpoint: 'https://api.***.com/v1', + error: { + cause: { message: 'api is undefined' }, + stack: 'abc', + }, + errorType: bizErrorType, + provider, + }); + } + }); + + it('should throw an InvalidDeepSeekAPIKey error type on 401 status code', async () => { + // Mock the API call to simulate a 401 error + const error = new Error('Unauthorized') as any; + error.status = 401; + vi.mocked(instance['client'].chat.completions.create).mockRejectedValue(error); + + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'deepseek-chat', + temperature: 0, + }); + } catch (e) { + // Expect the chat method to throw an error with InvalidDeepSeekAPIKey + expect(e).toEqual({ + endpoint: defaultBaseURL, + error: new Error('Unauthorized'), + errorType: invalidErrorType, + provider, + }); + } + }); + + it('should return AgentRuntimeError for non-OpenAI errors', async () => { + // Arrange + const genericError = new Error('Generic Error'); + + vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(genericError); + + // Act + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'deepseek-chat', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + endpoint: defaultBaseURL, + errorType: 'AgentRuntimeError', + provider, + error: { + name: genericError.name, + cause: genericError.cause, + message: genericError.message, + stack: genericError.stack, + }, + }); + } + }); + }); + + describe('DEBUG', () => { + it('should call debugStream and return StreamingTextResponse when DEBUG_DEEPSEEK_CHAT_COMPLETION is 1', async () => { + // Arrange + const mockProdStream = new ReadableStream() as any; // 模拟的 prod 流 + const mockDebugStream = new ReadableStream({ + start(controller) { + controller.enqueue('Debug stream content'); + controller.close(); + }, + }) as any; + mockDebugStream.toReadableStream = () => mockDebugStream; // 添加 toReadableStream 方法 + + // 模拟 chat.completions.create 返回值,包括模拟的 tee 方法 + (instance['client'].chat.completions.create as Mock).mockResolvedValue({ + tee: () => [mockProdStream, { toReadableStream: () => mockDebugStream }], + }); + + // 保存原始环境变量值 + const originalDebugValue = process.env.DEBUG_DEEPSEEK_CHAT_COMPLETION; + + // 模拟环境变量 + process.env.DEBUG_DEEPSEEK_CHAT_COMPLETION = '1'; + vi.spyOn(debugStreamModule, 'debugStream').mockImplementation(() => Promise.resolve()); + + // 执行测试 + // 运行你的测试函数,确保它会在条件满足时调用 debugStream + // 假设的测试函数调用,你可能需要根据实际情况调整 + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'deepseek-chat', + stream: true, + temperature: 0, + }); + + // 验证 debugStream 被调用 + expect(debugStreamModule.debugStream).toHaveBeenCalled(); + + // 恢复原始环境变量值 + process.env.DEBUG_DEEPSEEK_CHAT_COMPLETION = originalDebugValue; + }); + }); + }); +}); diff --git a/src/libs/agent-runtime/deepseek/index.ts b/src/libs/agent-runtime/deepseek/index.ts new file mode 100644 index 000000000000..4bd92dfb6f4f --- /dev/null +++ b/src/libs/agent-runtime/deepseek/index.ts @@ -0,0 +1,15 @@ +import { AgentRuntimeErrorType } from '../error'; +import { ModelProvider } from '../types'; +import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory'; + +export const LobeDeepSeekAI = LobeOpenAICompatibleFactory({ + baseURL: 'https://api.deepseek.com/v1', + debug: { + chatCompletion: () => process.env.DEBUG_DEEPSEEK_CHAT_COMPLETION === '1', + }, + errorType: { + bizError: AgentRuntimeErrorType.DeepSeekBizError, + invalidAPIKey: AgentRuntimeErrorType.InvalidDeepSeekAPIKey, + }, + provider: ModelProvider.DeepSeek, +}); diff --git a/src/libs/agent-runtime/error.ts b/src/libs/agent-runtime/error.ts index 4f29049f9d55..cef141d40fea 100644 --- a/src/libs/agent-runtime/error.ts +++ b/src/libs/agent-runtime/error.ts @@ -49,6 +49,9 @@ export const AgentRuntimeErrorType = { InvalidMinimaxAPIKey: 'InvalidMinimaxAPIKey', MinimaxBizError: 'MinimaxBizError', + + InvalidDeepSeekAPIKey: 'InvalidDeepSeekAPIKey', + DeepSeekBizError: 'DeepSeekBizError', } as const; export type ILobeAgentRuntimeErrorType = diff --git a/src/libs/agent-runtime/index.ts b/src/libs/agent-runtime/index.ts index 419e21160c53..7431cbbd546c 100644 --- a/src/libs/agent-runtime/index.ts +++ b/src/libs/agent-runtime/index.ts @@ -3,6 +3,7 @@ export { LobeAnthropicAI } from './anthropic'; export { LobeAzureOpenAI } from './azureOpenai'; export * from './BaseAI'; export { LobeBedrockAI } from './bedrock'; +export { LobeDeepSeekAI } from './deepseek'; export * from './error'; export { LobeGoogleAI } from './google'; export { LobeGroq } from './groq'; diff --git a/src/libs/agent-runtime/types/type.ts b/src/libs/agent-runtime/types/type.ts index e718358171fc..a6025e0ff7bb 100644 --- a/src/libs/agent-runtime/types/type.ts +++ b/src/libs/agent-runtime/types/type.ts @@ -26,6 +26,7 @@ export enum ModelProvider { Azure = 'azure', Bedrock = 'bedrock', ChatGLM = 'chatglm', + DeepSeek = 'deepseek', Google = 'google', Groq = 'groq', Minimax = 'minimax', diff --git a/src/locales/default/error.ts b/src/locales/default/error.ts index ed92e47431ff..ec1d5b4c6389 100644 --- a/src/locales/default/error.ts +++ b/src/locales/default/error.ts @@ -92,6 +92,9 @@ export default { InvalidBedrockCredentials: 'Bedrock 鉴权未通过,请检查 AccessKeyId/SecretAccessKey 后重试', BedrockBizError: '请求 Bedrock 服务出错,请根据以下信息排查或重试', + InvalidDeepSeekAPIKey: 'DeepSeek API Key 不正确或为空,请检查 DeepSeek API Key 后重试', + DeepSeekBizError: '请求 DeepSeek 服务出错,请根据以下信息排查或重试', + InvalidAzureAPIKey: 'Azure API Key 不正确或为空,请检查 Azure API Key 后重试', AzureBizError: '请求 Azure AI 服务出错,请根据以下信息排查或重试', diff --git a/src/locales/default/modelProvider.ts b/src/locales/default/modelProvider.ts index 0b5d2fd6d2f4..858db3aeaa04 100644 --- a/src/locales/default/modelProvider.ts +++ b/src/locales/default/modelProvider.ts @@ -62,6 +62,18 @@ export default { title: '使用自定义 Bedrock 鉴权信息', }, }, + deepseek: { + title: 'DeepSeek', + token: { + desc: '填入来自 DeepSeek 的 API Key', + placeholder: 'DeepSeek API Key', + title: 'API Key', + }, + unlock: { + description: '输入你的 DeepSeek API Key 即可开始会话。应用不会记录你的 API Key', + title: '使用自定义 DeepSeek API Key', + }, + }, google: { title: 'Google', token: { diff --git a/src/migrations/FromV3ToV4/types/v3.ts b/src/migrations/FromV3ToV4/types/v3.ts index b0d2b7eaf026..8eecdf196e06 100644 --- a/src/migrations/FromV3ToV4/types/v3.ts +++ b/src/migrations/FromV3ToV4/types/v3.ts @@ -22,20 +22,12 @@ export interface V3LegacyConfig { } export interface V3LLMConfig { - anthropic: V3GeneralConfig; bedrock: any; google: V3GeneralConfig; - groq: V3GeneralConfig; - minimax: V3GeneralConfig; - mistral: V3GeneralConfig; - moonshot: V3GeneralConfig; ollama: V3LegacyConfig; openAI: V3OpenAIConfig; openrouter: V3LegacyConfig; - perplexity: V3GeneralConfig; togetherai: V3LegacyConfig; - zeroone: V3GeneralConfig; - zhipu: V3GeneralConfig; } /** diff --git a/src/server/globalConfig/index.ts b/src/server/globalConfig/index.ts index f95d36f14654..c062be939a31 100644 --- a/src/server/globalConfig/index.ts +++ b/src/server/globalConfig/index.ts @@ -23,6 +23,7 @@ export const getServerGlobalConfig = () => { ENABLED_AWS_BEDROCK, ENABLED_GOOGLE, ENABLED_GROQ, + ENABLED_DEEPSEEK, ENABLED_PERPLEXITY, ENABLED_ANTHROPIC, ENABLED_MINIMAX, @@ -63,6 +64,7 @@ export const getServerGlobalConfig = () => { }), }, bedrock: { enabled: ENABLED_AWS_BEDROCK }, + deepseek: { enabled: ENABLED_DEEPSEEK }, google: { enabled: ENABLED_GOOGLE }, groq: { enabled: ENABLED_GROQ }, minimax: { enabled: ENABLED_MINIMAX }, diff --git a/src/services/__tests__/chat.test.ts b/src/services/__tests__/chat.test.ts index 376a89ab9859..a6349562acf2 100644 --- a/src/services/__tests__/chat.test.ts +++ b/src/services/__tests__/chat.test.ts @@ -10,6 +10,7 @@ import { LobeBedrockAI, LobeGoogleAI, LobeGroq, + LobeDeepSeekAI, LobeMistralAI, LobeMoonshotAI, LobeOllamaAI, @@ -873,6 +874,21 @@ describe('AgentRuntimeOnClient', () => { expect(runtime['_runtime']).toBeInstanceOf(LobeGroq); }); + it('DeepSeek provider: with apiKey', async () => { + merge(initialSettingsState, { + settings: { + languageModel: { + deepseek: { + apiKey: 'user-deepseek-key', + }, + }, + }, + } as UserSettingsState) as unknown as UserStore; + const runtime = await initializeWithClientStore(ModelProvider.DeepSeek, {}); + expect(runtime).toBeInstanceOf(AgentRuntime); + expect(runtime['_runtime']).toBeInstanceOf(LobeDeepSeekAI); + }); + /** * Should not have a unknown provider in client, but has * similar cases in server side diff --git a/src/services/chat.ts b/src/services/chat.ts index 316a39dd1b8a..b5ba0fdf0263 100644 --- a/src/services/chat.ts +++ b/src/services/chat.ts @@ -139,6 +139,9 @@ export function initializeWithClientStore(provider: string, payload: any) { case ModelProvider.Groq: { break; } + case ModelProvider.DeepSeek: { + break; + } case ModelProvider.OpenRouter: { break; } diff --git a/src/store/user/slices/settings/actions/llm.ts b/src/store/user/slices/settings/actions/llm.ts index 8c0a21d275b1..9a0dfb3d00e4 100644 --- a/src/store/user/slices/settings/actions/llm.ts +++ b/src/store/user/slices/settings/actions/llm.ts @@ -5,6 +5,7 @@ import { AnthropicProviderCard, AzureProviderCard, BedrockProviderCard, + DeepSeekProviderCard, GoogleProviderCard, GroqProviderCard, MinimaxProviderCard, @@ -109,6 +110,7 @@ export const llmSettingsSlice: StateCreator< chatModels: mergeModels('togetherai', TogetherAIProviderCard.chatModels), }, BedrockProviderCard, + DeepSeekProviderCard, PerplexityProviderCard, MinimaxProviderCard, MistralProviderCard, diff --git a/src/types/settings/modelProvider.ts b/src/types/settings/modelProvider.ts index 98dd9c117539..bdcdb6e5d032 100644 --- a/src/types/settings/modelProvider.ts +++ b/src/types/settings/modelProvider.ts @@ -44,6 +44,7 @@ export interface GlobalLLMConfig { anthropic: GeneralModelProviderConfig; azure: AzureOpenAIConfig; bedrock: AWSBedrockConfig; + deepseek: GeneralModelProviderConfig; google: GeneralModelProviderConfig; groq: GeneralModelProviderConfig; minimax: GeneralModelProviderConfig;