diff --git a/.env.example b/.env.example index 22df66287236..9d986c02b873 100644 --- a/.env.example +++ b/.env.example @@ -100,6 +100,9 @@ OPENAI_API_KEY=sk-xxxxxxxxx # MOONSHOT_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +### Minimax AI #### + +# MINIMAX_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ######################################## ############ Market Service ############ diff --git a/Dockerfile b/Dockerfile index b02ec524cbb4..13fa1eaf5380 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,4 +103,7 @@ ENV ZEROONE_API_KEY "" # TogetherAI ENV TOGETHERAI_API_KEY "" +# Minimax +ENV MINIMAX_API_KEY "" + CMD ["node", "server.js"] diff --git a/README.md b/README.md index ff70c2bb2e56..d7d7d8563477 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ We have implemented support for the following model service providers: - **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/) - **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/) 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 220015cc89bd..6b2f449d8c74 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -128,6 +128,7 @@ - **01.AI (零一万物)**:集成了零一万物模型,系列 API 具备较快的推理速度,这不仅缩短了处理时间,同时也保持了出色的模型效果。[了解更多](https://www.lingyiwanwu.com/) - **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/) 同时,我们也在计划支持更多的模型服务商,如 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 1e9175a86f6f..a23b940b4202 100644 --- a/docs/self-hosting/environment-variables/model-provider.mdx +++ b/docs/self-hosting/environment-variables/model-provider.mdx @@ -212,6 +212,15 @@ If you need to use Azure OpenAI to provide model services, you can refer to the - Default: - - Example: `pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +## Minimax AI + +### `MINIMAX_API_KEY` + +- Type: Required +- Description: This is the API key you applied for in the Minimax AI service +- Default: - +- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` + ## Mistral AI ### `MISTRAL_API_KEY` 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 adcc871f058d..0e716da21fe7 100644 --- a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx @@ -210,6 +210,15 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, - 默认值:- - 示例:`pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` +## Minimax AI + +### `MINIMAX_API_KEY` + +- 类型:必选 +- 描述:这是你在 Minimax AI 服务中申请的 API 密钥 +- 默认值:- +- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` + ## Mistral AI ### `MISTRAL_API_KEY` diff --git a/docs/usage/features/multi-ai-providers.mdx b/docs/usage/features/multi-ai-providers.mdx index f509b3623721..92951c42a7fa 100644 --- a/docs/usage/features/multi-ai-providers.mdx +++ b/docs/usage/features/multi-ai-providers.mdx @@ -44,6 +44,7 @@ We have implemented support for the following model service providers: - **OpenRouter**: Supports routing of models including **Claude 3**, **Gemma**, **Mistral**, **Llama2** and **Cohere**, with intelligent routing optimization to improve usage efficiency, open and flexible. [Learn more](https://openrouter.ai/) - **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/) 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 a66b10c69041..388ef8731b9b 100644 --- a/docs/usage/features/multi-ai-providers.zh-CN.mdx +++ b/docs/usage/features/multi-ai-providers.zh-CN.mdx @@ -44,6 +44,7 @@ tags: - **01.AI (零一万物)**:集成了零一万物模型,系列 API 具备较快的推理速度,这不仅缩短了处理时间,同时也保持了出色的模型效果。[了解更多](https://www.lingyiwanwu.com/) - **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/) 同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。 diff --git a/locales/ar/error.json b/locales/ar/error.json index f0cbafa456a4..0fbb78930f37 100644 --- a/locales/ar/error.json +++ b/locales/ar/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة", "InvalidGoogleAPIKey": "مفتاح Google API غير صحيح أو فارغ، يرجى التحقق من مفتاح Google API وإعادة المحاولة", "InvalidGroqAPIKey": "مفتاح Groq API غير صحيح أو فارغ، يرجى التحقق من مفتاح Groq API وإعادة المحاولة", + "InvalidMinimaxAPIKey": "مفتاح Minimax API غير صحيح أو فارغ، يرجى التحقق من مفتاح Minimax API وإعادة المحاولة", "InvalidMistralAPIKey": "مفتاح Mistral AI API غير صحيح أو فارغ، يرجى التحقق من مفتاح Mistral API وإعادة المحاولة", "InvalidMoonshotAPIKey": "مفتاح API لـ Moonshot AI غير صحيح أو فارغ، يرجى التحقق من مفتاح API لـ Moonshot وإعادة المحاولة", "InvalidOllamaArgs": "تكوين Ollama غير صحيح، يرجى التحقق من تكوين Ollama وإعادة المحاولة", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "مفتاح ZeroOne API غير صحيح أو فارغ، يرجى التحقق من مفتاح ZeroOne API وإعادة المحاولة", "InvalidZhipuAPIKey": "مفتاح Zhipu API غير صحيح أو فارغ، يرجى التحقق من مفتاح Zhipu API وإعادة المحاولة", "LocationNotSupportError": "عذرًا، لا يدعم موقعك الحالي خدمة هذا النموذج، قد يكون ذلك بسبب قيود المنطقة أو عدم توفر الخدمة. يرجى التحقق مما إذا كان الموقع الحالي يدعم استخدام هذه الخدمة، أو محاولة استخدام معلومات الموقع الأخرى.", + "MinimaxBizError": "حدث خطأ في طلب خدمة Minimax، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "MistralBizError": "طلب خدمة Mistral AI خاطئ، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", "MoonshotBizError": "حدث خطأ في خدمة جانب القمر، يرجى التحقق من المعلومات أدناه أو إعادة المحاولة", "NoOpenAIAPIKey": "مفتاح API الخاص بـ OpenAI فارغ، يرجى إضافة مفتاح API الخاص بـ OpenAI", diff --git a/locales/ar/modelProvider.json b/locales/ar/modelProvider.json index 811f4f8d216b..57c9517afd2f 100644 --- a/locales/ar/modelProvider.json +++ b/locales/ar/modelProvider.json @@ -95,6 +95,18 @@ "title": "استخدام مفتاح API الخاص بـ Groq المخصص" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "أدخل مفتاح API الخاص بـ Minimax", + "placeholder": "مفتاح API Minimax", + "title": "مفتاح API" + }, + "unlock": { + "description": "قم بإدخال مفتاح API Minimax الخاص بك لبدء الجلسة. لن يتم تسجيل مفتاح الـ API الخاص بك من قبل التطبيق", + "title": "استخدام مفتاح API Minimax المخصص" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/bg-BG/error.json b/locales/bg-BG/error.json index 2a2df5984434..e5ead67d192e 100644 --- a/locales/bg-BG/error.json +++ b/locales/bg-BG/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Удостоверяването на Bedrock е неуспешно. Моля, проверете AccessKeyId/SecretAccessKey и опитайте отново.", "InvalidGoogleAPIKey": "API ключът на Google е неправилен или празен. Моля, проверете API ключа на Google и опитайте отново.", "InvalidGroqAPIKey": "API ключът на Groq е неправилен или празен. Моля, проверете API ключа на Groq и опитайте отново.", + "InvalidMinimaxAPIKey": "Невалиден или липсващ ключ за Minimax API, моля проверете ключа за Minimax API и опитайте отново", "InvalidMistralAPIKey": "Неправилен или празен API ключ на Mistral AI. Моля, проверете вашия API ключ на Mistral и опитайте отново.", "InvalidMoonshotAPIKey": "API ключът на Moonshot AI е неправилен или празен, моля, проверете API ключа на Moonshot и опитайте отново.", "InvalidOllamaArgs": "Невалидна конфигурация на Ollama, моля, проверете конфигурацията на Ollama и опитайте отново", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "API ключът на 01-AI е неправилен или празен. Моля, проверете API ключа на 01-AI и опитайте отново.", "InvalidZhipuAPIKey": "API ключът на Zhipu е неправилен или празен. Моля, проверете API ключа на Zhipu и опитайте отново.", "LocationNotSupportError": "Съжаляваме, вашето текущо местоположение не поддържа тази услуга на модела. Това може да се дължи на регионални ограничения или на недостъпност на услугата. Моля, потвърдете дали текущото местоположение поддържа използването на тази услуга или опитайте да използвате друго местоположение.", + "MinimaxBizError": "Грешка при заявка към услугата Minimax, моля проверете информацията по-долу или опитайте отново", "MistralBizError": "Възникна грешка при заявка към услугата Mistral AI. Моля, отстранете неизправностите въз основа на следната информация или опитайте отново.", "MoonshotBizError": "Възникна грешка с услугата Moonshot, моля, отстранете неизправностите или опитайте отново въз основа на следната информация.", "NoOpenAIAPIKey": "API ключът на OpenAI е празен, моля, добавете персонализиран API ключ на OpenAI", diff --git a/locales/bg-BG/modelProvider.json b/locales/bg-BG/modelProvider.json index 7c3b5e8c84d5..c91ecd56def1 100644 --- a/locales/bg-BG/modelProvider.json +++ b/locales/bg-BG/modelProvider.json @@ -95,6 +95,18 @@ "title": "Използване на персонализиран Groq API ключ" } }, + "minimax": { + "title": "Минимакс", + "token": { + "desc": "Въведете API ключ от Минимакс", + "placeholder": "API ключ на Минимакс", + "title": "API ключ" + }, + "unlock": { + "description": "Само въведете вашия API ключ от Минимакс, за да започнете сесия. Приложението няма да запази вашия API ключ", + "title": "Използване на персонализиран API ключ от Минимакс" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/de-DE/error.json b/locales/de-DE/error.json index 2e91dfce7cae..696364ef6989 100644 --- a/locales/de-DE/error.json +++ b/locales/de-DE/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Die Bedrock-Authentifizierung ist fehlgeschlagen. Bitte überprüfen Sie AccessKeyId/SecretAccessKey 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.", "InvalidMistralAPIKey": "Der Mistral AI-API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Mistral-API-Schlüssel und versuchen Sie es erneut.", "InvalidMoonshotAPIKey": "Ungültiger oder leerer Moonshot AI API-Schlüssel. Bitte überprüfen Sie den Moonshot API-Schlüssel und versuchen Sie es erneut.", "InvalidOllamaArgs": "Ollama-Konfiguration ist ungültig. Bitte überprüfen Sie die Ollama-Konfiguration und versuchen Sie es erneut.", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "Ungültiger oder leerer ZeroOne-API-Schlüssel. Bitte überprüfen Sie den ZeroOne-API-Schlüssel und versuchen Sie es erneut.", "InvalidZhipuAPIKey": "Der Zhipu API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Zhipu API-Schlüssel und versuchen Sie es erneut.", "LocationNotSupportError": "Entschuldigung, Ihr Standort unterstützt diesen Modellservice möglicherweise aufgrund von regionalen Einschränkungen oder nicht aktivierten Diensten nicht. Bitte überprüfen Sie, ob der aktuelle Standort die Verwendung dieses Dienstes unterstützt, oder versuchen Sie, andere Standortinformationen zu verwenden.", + "MinimaxBizError": "Fehler beim Abrufen des Minimax-Dienstes. Bitte überprüfen Sie die folgenden Informationen und versuchen Sie es erneut.", "MistralBizError": "Beim Anfordern des Mistral AI-Dienstes ist ein Fehler aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", "MoonshotBizError": "Fehler beim Abrufen des Dark Side of the Moon-Services. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", "NoOpenAIAPIKey": "Der OpenAI-API-Schlüssel ist leer. Bitte fügen Sie einen benutzerdefinierten OpenAI-API-Schlüssel hinzu", diff --git a/locales/de-DE/modelProvider.json b/locales/de-DE/modelProvider.json index 0056f9ea115b..5fb4f32af92e 100644 --- a/locales/de-DE/modelProvider.json +++ b/locales/de-DE/modelProvider.json @@ -95,6 +95,18 @@ "title": "Verwenden Sie einen individuellen Groq-API-Schlüssel" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Geben Sie Ihren API-Schlüssel von Minimax ein", + "placeholder": "Minimax API-Schlüssel", + "title": "API-Schlüssel" + }, + "unlock": { + "description": "Geben Sie Ihren Minimax API-Schlüssel ein, um die Sitzung zu starten. Die Anwendung speichert Ihren API-Schlüssel nicht.", + "title": "Verwenden Sie einen benutzerdefinierten Minimax API-Schlüssel" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/en-US/error.json b/locales/en-US/error.json index e46e7b553d43..98ce152caae1 100644 --- a/locales/en-US/error.json +++ b/locales/en-US/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Bedrock authentication failed. Please check the AccessKeyId/SecretAccessKey and retry.", "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", "InvalidMistralAPIKey": "Incorrect or empty Mistral AI API Key. Please check your Mistral API Key and try again.", "InvalidMoonshotAPIKey": "The Moonshot AI API Key is incorrect or empty, please check the Moonshot API Key and try again.", "InvalidOllamaArgs": "Invalid Ollama configuration, please check Ollama configuration and try again", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "01-AI API Key is incorrect or empty. Please check the 01-AI API Key and retry.", "InvalidZhipuAPIKey": "Zhipu API Key is incorrect or empty. Please check the Zhipu API Key and retry.", "LocationNotSupportError": "We're sorry, your current location does not support this model service. This may be due to regional restrictions or the service not being available. Please confirm if the current location supports using this service, or try using a different location.", + "MinimaxBizError": "Error occurred while requesting Minimax service, please troubleshoot or retry based on the following information", "MistralBizError": "Error occurred while requesting Mistral AI service. Please troubleshoot based on the following information or retry.", "MoonshotBizError": "There was an error with the Moonshot service, please troubleshoot or retry based on the following information.", "NoOpenAIAPIKey": "OpenAI API Key is empty, please add a custom OpenAI API Key", diff --git a/locales/en-US/modelProvider.json b/locales/en-US/modelProvider.json index 708e60d64aeb..5eb0055fe7c7 100644 --- a/locales/en-US/modelProvider.json +++ b/locales/en-US/modelProvider.json @@ -95,6 +95,18 @@ "title": "Use Custom Groq API Key" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Enter your API Key from Minimax", + "placeholder": "Minimax API Key", + "title": "API Key" + }, + "unlock": { + "description": "Enter your Minimax API Key to start the session. The app will not store your API Key.", + "title": "Use Custom Minimax API Key" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/es-ES/error.json b/locales/es-ES/error.json index b18d3385b4a6..ef32f3eae26a 100644 --- a/locales/es-ES/error.json +++ b/locales/es-ES/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "La autenticación de Bedrock no se ha completado con éxito, por favor, verifica AccessKeyId/SecretAccessKey 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", "InvalidMistralAPIKey": "La clave de API de Mistral AI es incorrecta o está vacía. Por favor, revise la clave de API de Mistral y vuelva a intentarlo.", "InvalidMoonshotAPIKey": "La clave de API de Moonshot AI no es válida o está vacía. Por favor, revise la clave de API de Moonshot e inténtelo de nuevo.", "InvalidOllamaArgs": "La configuración de Ollama no es válida, por favor revisa la configuración de Ollama e inténtalo de nuevo", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "La clave de API de ZeroOneBiz es incorrecta o está vacía. Por favor, revise la clave de API de ZeroOneBiz e inténtelo de nuevo.", "InvalidZhipuAPIKey": "La clave de API de Zhipu es incorrecta o está vacía, por favor, verifica la clave de API de Zhipu e inténtalo de nuevo", "LocationNotSupportError": "Lo sentimos, tu ubicación actual no es compatible con este servicio de modelo, puede ser debido a restricciones geográficas o a que el servicio no está disponible. Por favor, verifica si tu ubicación actual es compatible con este servicio o intenta usar otra información de ubicación.", + "MinimaxBizError": "Error al solicitar el servicio Minimax, por favor, revise la siguiente información o inténtelo de nuevo", "MistralBizError": "Se produjo un error al solicitar el servicio Mistral AI. Por favor, revise la siguiente información o inténtelo de nuevo.", "MoonshotBizError": "Se produjo un error al solicitar el servicio de Moonshot en el lado oscuro de la luna. Por favor, revise la siguiente información o inténtelo de nuevo.", "NoOpenAIAPIKey": "La clave de API de OpenAI está vacía. Agregue una clave de API de OpenAI personalizada", diff --git a/locales/es-ES/modelProvider.json b/locales/es-ES/modelProvider.json index 52dea5ccb54f..ae3b47478ba5 100644 --- a/locales/es-ES/modelProvider.json +++ b/locales/es-ES/modelProvider.json @@ -95,6 +95,18 @@ "title": "Usar clave de API de Groq personalizada" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Introduce tu clave API de Minimax", + "placeholder": "Clave API de Minimax", + "title": "Clave API de Minimax" + }, + "unlock": { + "description": "Ingresa tu clave API de Minimax para comenzar la sesión. La aplicación no guardará tu clave API.", + "title": "Usar clave API personalizada de Minimax" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/fr-FR/error.json b/locales/fr-FR/error.json index 6bc1363c44ae..d109e758c0cb 100644 --- a/locales/fr-FR/error.json +++ b/locales/fr-FR/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "L'authentification Bedrock a échoué, veuillez vérifier AccessKeyId/SecretAccessKey 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", "InvalidMistralAPIKey": "Clé API Mistral AI incorrecte ou manquante. Veuillez vérifier la clé API Mistral et réessayer.", "InvalidMoonshotAPIKey": "Clé API Moonshot AI incorrecte ou manquante. Veuillez vérifier la clé API Moonshot et réessayer.", "InvalidOllamaArgs": "La configuration d'Ollama n'est pas valide, veuillez vérifier la configuration d'Ollama et réessayer", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "La clé d'API ZeroOne est incorrecte ou vide, veuillez vérifier la clé d'API ZeroOne et réessayer", "InvalidZhipuAPIKey": "Clé API Zhipu incorrecte ou vide, veuillez vérifier la clé API Zhipu et réessayer", "LocationNotSupportError": "Désolé, votre emplacement actuel ne prend pas en charge ce service de modèle, peut-être en raison de restrictions géographiques ou de services non disponibles. Veuillez vérifier si votre emplacement actuel prend en charge ce service ou essayer avec une autre localisation.", + "MinimaxBizError": "Erreur de service Minimax, veuillez vérifier les informations suivantes ou réessayer", "MistralBizError": "Erreur de service Mistral AI. Veuillez vérifier les informations ci-dessous ou réessayer.", "MoonshotBizError": "Erreur de service Moonshot : une erreur s'est produite lors de la demande du service Côté Obscur de la Lune. Veuillez vérifier les informations suivantes ou réessayer.", "NoOpenAIAPIKey": "La clé API OpenAI est vide. Veuillez ajouter une clé API OpenAI personnalisée", diff --git a/locales/fr-FR/modelProvider.json b/locales/fr-FR/modelProvider.json index bd8b4a281156..62c51f6e9f5a 100644 --- a/locales/fr-FR/modelProvider.json +++ b/locales/fr-FR/modelProvider.json @@ -95,6 +95,18 @@ "title": "Utiliser une clé API Groq personnalisée" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Entrez la clé API de Minimax", + "placeholder": "Clé API Minimax", + "title": "Clé API" + }, + "unlock": { + "description": "Entrez votre clé API Minimax pour commencer la session. L'application ne stockera pas votre clé API.", + "title": "Utiliser une clé API Minimax personnalisée" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/it-IT/error.json b/locales/it-IT/error.json index c09e44e24c12..7fca28189828 100644 --- a/locales/it-IT/error.json +++ b/locales/it-IT/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Autenticazione Bedrock non riuscita, controlla AccessKeyId/SecretAccessKey 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", "InvalidMistralAPIKey": "Chiave API Mistral AI non valida o vuota. Si prega di controllare la chiave API Mistral e riprovare.", "InvalidMoonshotAPIKey": "La chiave API di Moonshot AI non è corretta o è vuota, si prega di controllare la chiave API di Moonshot e riprovare", "InvalidOllamaArgs": "Configurazione Ollama non valida, controllare la configurazione di Ollama e riprovare", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "La chiave API ZeroOne non è corretta o è vuota, si prega di controllare la chiave API ZeroOne e riprovare", "InvalidZhipuAPIKey": "Chiave API Zhipu non corretta o vuota, controlla la chiave API Zhipu e riprova", "LocationNotSupportError": "Spiacenti, la tua posizione attuale non supporta questo servizio modello, potrebbe essere a causa di restrizioni geografiche o servizi non attivati. Verifica se la posizione attuale supporta l'uso di questo servizio o prova a utilizzare un'altra posizione.", + "MinimaxBizError": "Errore di servizio Minimax, controllare le informazioni seguenti o riprovare", "MistralBizError": "Errore di richiesta del servizio Mistral AI. Si prega di controllare le informazioni seguenti o riprovare.", "MoonshotBizError": "Si è verificato un errore nel servizio Moonshot, si prega di controllare le informazioni seguenti o riprovare", "NoOpenAIAPIKey": "La chiave API OpenAI è vuota. Aggiungi una chiave API personalizzata OpenAI", diff --git a/locales/it-IT/modelProvider.json b/locales/it-IT/modelProvider.json index 8c21fa645a66..e488b950c639 100644 --- a/locales/it-IT/modelProvider.json +++ b/locales/it-IT/modelProvider.json @@ -95,6 +95,18 @@ "title": "Usa una chiave API Groq personalizzata" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Inserisci la tua chiave API Minimax", + "placeholder": "Chiave API Minimax", + "title": "Chiave API" + }, + "unlock": { + "description": "Inserisci la tua chiave API Minimax per avviare la sessione. L'applicazione non memorizzerà la tua chiave API.", + "title": "Utilizza una chiave API Minimax personalizzata" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/ja-JP/error.json b/locales/ja-JP/error.json index 4c7958c7f126..b0c493633eff 100644 --- a/locales/ja-JP/error.json +++ b/locales/ja-JP/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Bedrockの認証に失敗しました。AccessKeyId/SecretAccessKeyを確認してから再試行してください。", "InvalidGoogleAPIKey": "Google APIキーが正しくないか空です。Google APIキーを確認してから再試行してください。", "InvalidGroqAPIKey": "Groq APIキーが正しくないか空です。Groq APIキーを確認して再試行してください。", + "InvalidMinimaxAPIKey": "Minimax APIキーが正しくないか空です。Minimax APIキーを確認して再試行してください。", "InvalidMistralAPIKey": "Mistral AI API キーが正しくないか空です。Mistral API キーを確認して再試行してください。", "InvalidMoonshotAPIKey": "Moonshot AI APIキーが正しくないか空です。Moonshot APIキーを確認して再試行してください。", "InvalidOllamaArgs": "Ollamaの設定が正しくありません。Ollamaの設定を確認してからもう一度お試しください", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "ZeroOne APIキーが正しくないか空です。ZeroOne APIキーを確認して再試行してください。", "InvalidZhipuAPIKey": "Zhipu APIキーが正しくないか空です。Zhipu APIキーを確認してから再試行してください。", "LocationNotSupportError": "申し訳ありませんが、お住まいの地域ではこのモデルサービスをサポートしていません。地域制限またはサービスが利用できない可能性があります。現在の位置がこのサービスをサポートしているかどうかを確認するか、他の位置情報を使用してみてください。", + "MinimaxBizError": "Minimaxサービスのリクエストでエラーが発生しました。以下の情報を確認して再試行してください。", "MistralBizError": "Mistral AI サービスのリクエストでエラーが発生しました。以下の情報を確認して再試行してください。", "MoonshotBizError": "月の裏側サービスのリクエストでエラーが発生しました。以下の情報を確認して再試行してください。", "NoOpenAIAPIKey": "OpenAI APIキーが空です。カスタムOpenAI APIキーを追加してください。", diff --git a/locales/ja-JP/modelProvider.json b/locales/ja-JP/modelProvider.json index 9add92183704..0fb9479dcf8b 100644 --- a/locales/ja-JP/modelProvider.json +++ b/locales/ja-JP/modelProvider.json @@ -95,6 +95,18 @@ "title": "使用カスタム Groq API Key" } }, + "minimax": { + "title": "ミニマックス", + "token": { + "desc": "ミニマックスからのAPIキーを入力してください", + "placeholder": "ミニマックスAPIキー", + "title": "APIキー" + }, + "unlock": { + "description": "ミニマックスAPIキーを入力するとセッションが開始されます。アプリはAPIキーを記録しません", + "title": "カスタムミニマックスAPIキーを使用" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/ko-KR/error.json b/locales/ko-KR/error.json index 63593ae69d70..60ff89c3f63e 100644 --- a/locales/ko-KR/error.json +++ b/locales/ko-KR/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Bedrock 인증에 실패했습니다. AccessKeyId/SecretAccessKey를 확인한 후 다시 시도하십시오.", "InvalidGoogleAPIKey": "잘못된 또는 비어 있는 Google API Key입니다. Google API Key를 확인한 후 다시 시도하십시오.", "InvalidGroqAPIKey": "잘못된 또는 비어 있는 Groq API Key입니다. Groq API Key를 확인한 후 다시 시도하십시오.", + "InvalidMinimaxAPIKey": "잘못된 Minimax API 키이거나 비어 있습니다. Minimax API 키를 확인한 후 다시 시도해주세요.", "InvalidMistralAPIKey": "Mistral AI API 키가 잘못되었거나 비어 있습니다. Mistral API 키를 확인한 후 다시 시도해주세요.", "InvalidMoonshotAPIKey": "Moonshot AI API 키가 잘못되었거나 비어 있습니다. Moonshot API 키를 확인한 후 다시 시도해주세요.", "InvalidOllamaArgs": "Ollama 구성이 잘못되었습니다. Ollama 구성을 확인한 후 다시 시도하십시오.", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "잘못된 또는 빈 제로원물 API 키입니다. 제로원물 API 키를 확인하고 다시 시도해주세요.", "InvalidZhipuAPIKey": "잘못된 또는 비어 있는 Zhipu API Key입니다. Zhipu API Key를 확인한 후 다시 시도하십시오.", "LocationNotSupportError": "죄송합니다. 귀하의 현재 위치는 해당 모델 서비스를 지원하지 않습니다. 지역 제한 또는 서비스 미개통으로 인한 것일 수 있습니다. 현재 위치가 해당 서비스를 지원하는지 확인하거나 다른 위치 정보를 사용해 보십시오.", + "MinimaxBizError": "Minimax 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하거나 다시 시도해주세요.", "MistralBizError": "Mistral AI 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도해주세요.", "MoonshotBizError": "요청한 문샷 비즈니스에 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도해주세요.", "NoOpenAIAPIKey": "OpenAI API 키가 비어 있습니다. 사용자 정의 OpenAI API 키를 추가해주세요.", diff --git a/locales/ko-KR/modelProvider.json b/locales/ko-KR/modelProvider.json index 16549136b67f..648344240538 100644 --- a/locales/ko-KR/modelProvider.json +++ b/locales/ko-KR/modelProvider.json @@ -95,6 +95,18 @@ "title": "사용자 정의 Groq API 키 사용" } }, + "minimax": { + "title": "최소화", + "token": { + "desc": "Minimax에서 가져온 API 키를 입력하십시오", + "placeholder": "Minimax API 키", + "title": "API 키" + }, + "unlock": { + "description": "Minimax API 키를 입력하면 세션을 시작할 수 있습니다. 애플리케이션은 API 키를 기록하지 않습니다", + "title": "사용자 정의 Minimax API 키 사용" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/nl-NL/error.json b/locales/nl-NL/error.json index e23f0e6caedd..4d3d69891017 100644 --- a/locales/nl-NL/error.json +++ b/locales/nl-NL/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Bedrock authentication failed, please check AccessKeyId/SecretAccessKey and retry", "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.", "InvalidMistralAPIKey": "Ongeldige of lege Mistral AI API-sleutel. Controleer de Mistral API-sleutel en probeer het opnieuw.", "InvalidMoonshotAPIKey": "Moonshot AI API密钥不正确或为空,请检查Moonshot API密钥后重试", "InvalidOllamaArgs": "Ollama-configuratie is onjuist, controleer de Ollama-configuratie en probeer het opnieuw", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "Ongeldige ZeroOneAPI-sleutel of leeg, controleer de ZeroOneAPI-sleutel en probeer het opnieuw", "InvalidZhipuAPIKey": "Incorrect or empty Zhipu API Key, please check the Zhipu API Key and retry", "LocationNotSupportError": "Sorry, your current location does not support this model service, possibly due to regional restrictions or service not being available. Please confirm if the current location supports using this service, or try using other location information.", + "MinimaxBizError": "Er is een fout opgetreden bij het aanroepen van de Minimax-service. Controleer de volgende informatie of probeer het opnieuw.", "MistralBizError": "Er is een fout opgetreden bij het aanroepen van de Mistral AI-service. Controleer de onderstaande informatie of probeer het opnieuw.", "MoonshotBizError": "Er is een fout opgetreden bij het aanroepen van de Moonshot-service. Controleer de volgende informatie of probeer het opnieuw.", "NoOpenAIAPIKey": "OpenAI API-sleutel ontbreekt. Voeg een aangepaste OpenAI API-sleutel toe", diff --git a/locales/nl-NL/modelProvider.json b/locales/nl-NL/modelProvider.json index 76a6e05380e0..b45609b70e43 100644 --- a/locales/nl-NL/modelProvider.json +++ b/locales/nl-NL/modelProvider.json @@ -95,6 +95,18 @@ "title": "Gebruik aangepaste Groq API-sleutel" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Voer de API Key van Minimax AI in", + "placeholder": "Minimax API Key", + "title": "API Key" + }, + "unlock": { + "description": "Voer uw Minimax AI API-sleutel in om een sessie te starten. De app zal uw API-sleutel niet opslaan", + "title": "Gebruik aangepaste Minimax AI API-sleutel" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/pl-PL/error.json b/locales/pl-PL/error.json index 12916db195b0..40fff23710a4 100644 --- a/locales/pl-PL/error.json +++ b/locales/pl-PL/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Uwierzytelnienie Bedrock nie powiodło się, prosimy sprawdzić AccessKeyId/SecretAccessKey i spróbować 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", "InvalidMistralAPIKey": "Nieprawidłowy lub pusty klucz API Mistral AI. Proszę sprawdzić klucz API Mistral i spróbować ponownie.", "InvalidMoonshotAPIKey": "Nieprawidłowy lub pusty klucz API Moonshot AI. Proszę sprawdzić klucz API Moonshot i spróbować ponownie.", "InvalidOllamaArgs": "Nieprawidłowa konfiguracja Ollama, sprawdź konfigurację Ollama i spróbuj ponownie", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "Klucz API Zero One nieprawidłowy lub pusty, sprawdź poprawność klucza API Zero One i spróbuj ponownie", "InvalidZhipuAPIKey": "Nieprawidłowy lub pusty klucz API Zhipu, prosimy sprawdzić klucz API Zhipu i spróbować ponownie.", "LocationNotSupportError": "Przepraszamy, Twoja lokalizacja nie obsługuje tego usługi modelu, być może ze względu na ograniczenia regionalne lub brak dostępności usługi. Proszę sprawdź, czy bieżąca lokalizacja obsługuje tę usługę, lub spróbuj użyć innych informacji o lokalizacji.", + "MinimaxBizError": "Wystąpił błąd usługi Minimax, proszę sprawdzić poniższe informacje lub spróbować ponownie", "MistralBizError": "Wystąpił błąd żądania usługi Mistral AI. Proszę sprawdzić poniższe informacje lub spróbować ponownie.", "MoonshotBizError": "Wystąpił błąd żądania usługi Moonshot AI. Proszę sprawdzić poniższe informacje lub spróbować ponownie.", "NoOpenAIAPIKey": "Klucz API OpenAI jest pusty. Proszę dodać niestandardowy klucz API OpenAI", diff --git a/locales/pl-PL/modelProvider.json b/locales/pl-PL/modelProvider.json index 6f8458c9c9bd..fe787a286392 100644 --- a/locales/pl-PL/modelProvider.json +++ b/locales/pl-PL/modelProvider.json @@ -95,6 +95,18 @@ "title": "Użyj niestandardowego klucza API Groq" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Wprowadź klucz API Minimax", + "placeholder": "Klucz API Minimax", + "title": "Klucz API" + }, + "unlock": { + "description": "Wprowadź swój klucz API Minimax, aby rozpocząć sesję. Aplikacja nie będzie przechowywać Twojego klucza API.", + "title": "Użyj niestandardowego klucza API Minimax" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/pt-BR/error.json b/locales/pt-BR/error.json index 3ca0a5e7130a..27dbae3535c4 100644 --- a/locales/pt-BR/error.json +++ b/locales/pt-BR/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Credenciais Bedrock inválidas, por favor, verifique AccessKeyId/SecretAccessKey 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", "InvalidMistralAPIKey": "Chave de API Mistral AI inválida ou vazia. Por favor, verifique a chave de API Mistral e tente novamente.", "InvalidMoonshotAPIKey": "A chave da API Moonshot AI está incorreta ou vazia. Por favor, verifique a chave da API Moonshot e tente novamente.", "InvalidOllamaArgs": "Configuração Ollama inválida, verifique a configuração do Ollama e tente novamente", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "Chave de API ZeroOne inválida ou vazia, verifique a chave de API ZeroOne e tente novamente", "InvalidZhipuAPIKey": "Chave de API Zhipu incorreta ou vazia, por favor, verifique a chave de API Zhipu e tente novamente", "LocationNotSupportError": "Desculpe, sua localização atual não suporta este serviço de modelo, pode ser devido a restrições geográficas ou serviço não disponível. Por favor, verifique se a localização atual suporta o uso deste serviço ou tente usar outras informações de localização.", + "MinimaxBizError": "Erro no serviço Minimax, verifique as informações abaixo ou tente novamente", "MistralBizError": "Ocorreu um erro ao solicitar o serviço Mistral AI. Por favor, verifique as informações abaixo ou tente novamente.", "MoonshotBizError": "O serviço Moonshot na face oculta da lua encontrou um erro. Por favor, verifique as informações abaixo ou tente novamente.", "NoOpenAIAPIKey": "A chave de API do OpenAI está em branco. Adicione uma chave de API personalizada do OpenAI", diff --git a/locales/pt-BR/modelProvider.json b/locales/pt-BR/modelProvider.json index 43c74001ba90..373f1d4860d5 100644 --- a/locales/pt-BR/modelProvider.json +++ b/locales/pt-BR/modelProvider.json @@ -95,6 +95,18 @@ "title": "Usar chave de API Groq personalizada" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Insira a chave da API do Minimax", + "placeholder": "Chave da API do Minimax", + "title": "Chave da API" + }, + "unlock": { + "description": "Digite sua chave da API do Minimax para iniciar a sessão. O aplicativo não irá armazenar sua chave da API.", + "title": "Usar chave da API personalizada do Minimax" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/ru-RU/error.json b/locales/ru-RU/error.json index cbd45fcf05a3..90914ad27791 100644 --- a/locales/ru-RU/error.json +++ b/locales/ru-RU/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Аутентификация Bedrock не прошла, пожалуйста, проверьте AccessKeyId/SecretAccessKey и повторите попытку", "InvalidGoogleAPIKey": "Неверный или пустой ключ API Google, пожалуйста, проверьте ключ API Google и повторите попытку", "InvalidGroqAPIKey": "Неверный или пустой ключ API Groq, пожалуйста, проверьте ключ API Groq и повторите попытку", + "InvalidMinimaxAPIKey": "Неверный или пустой ключ Minimax API. Пожалуйста, проверьте ключ Minimax API и повторите попытку", "InvalidMistralAPIKey": "Неверный или пустой ключ API Mistral AI. Пожалуйста, проверьте ключ API Mistral и повторите попытку", "InvalidMoonshotAPIKey": "Moonshot AI API Key неверный или пустой, пожалуйста, проверьте ключ API Moonshot и повторите попытку", "InvalidOllamaArgs": "Неверная конфигурация Ollama, пожалуйста, проверьте конфигурацию Ollama и повторите попытку", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "Неверный или пустой ключ API ZeroOne. Пожалуйста, проверьте ключ API ZeroOne и повторите попытку", "InvalidZhipuAPIKey": "Неверный или пустой ключ API Zhipu, пожалуйста, проверьте ключ API Zhipu и повторите попытку", "LocationNotSupportError": "Извините, ваше текущее местоположение не поддерживает эту службу модели, возможно из-за ограничений региона или недоступности службы. Пожалуйста, убедитесь, что текущее местоположение поддерживает использование этой службы, или попробуйте использовать другую информацию о местоположении.", + "MinimaxBizError": "Ошибка обслуживания Minimax. Пожалуйста, проверьте информацию ниже или повторите попытку", "MistralBizError": "Ошибка запроса к службе Mistral AI. Пожалуйста, проверьте следующую информацию или повторите попытку", "MoonshotBizError": "请求月球暗面服务出错,请根据以下信息排查或重试", "NoOpenAIAPIKey": "Ключ OpenAI API пуст, пожалуйста, добавьте свой собственный ключ OpenAI API", diff --git a/locales/ru-RU/modelProvider.json b/locales/ru-RU/modelProvider.json index 3bc4db53dab0..387b8ca9f8de 100644 --- a/locales/ru-RU/modelProvider.json +++ b/locales/ru-RU/modelProvider.json @@ -95,6 +95,18 @@ "title": "Использовать пользовательский ключ API Groq" } }, + "minimax": { + "title": "Минимакс", + "token": { + "desc": "Введите ключ API от Minimax", + "placeholder": "Ключ API Minimax", + "title": "API-ключ" + }, + "unlock": { + "description": "Просто введите свой ключ API от Minimax, чтобы начать сеанс. Приложение не сохраняет ваш ключ API.", + "title": "Использовать пользовательский ключ API Minimax" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/tr-TR/error.json b/locales/tr-TR/error.json index 55ef273d1a67..0813fdda87b9 100644 --- a/locales/tr-TR/error.json +++ b/locales/tr-TR/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Bedrock kimlik doğrulaması geçersiz, lütfen AccessKeyId/SecretAccessKey bilgilerinizi 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", "InvalidMistralAPIKey": "Mistral AI API Anahtarı geçersiz veya boş. Lütfen Mistral API Anahtarınızı kontrol edip tekrar deneyin", "InvalidMoonshotAPIKey": "Geçersiz veya boş Moonshot AI API Anahtarı, lütfen Moonshot API Anahtarınızı kontrol edip tekrar deneyin", "InvalidOllamaArgs": "Ollama yapılandırması yanlış, lütfen Ollama yapılandırmasını kontrol edip tekrar deneyin", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "SıfırBirIoT API Anahtarı geçersiz veya boş. Lütfen SıfırBirIoT API Anahtarınızı kontrol edip tekrar deneyin", "InvalidZhipuAPIKey": "Zhipu API Anahtarı yanlış veya boş, lütfen Zhipu API Anahtarınızı kontrol edip tekrar deneyin", "LocationNotSupportError": "Üzgünüz, bulunduğunuz konum bu model hizmetini desteklemiyor, muhtemelen bölge kısıtlamaları veya hizmetin henüz açılmamış olması nedeniyle. Lütfen mevcut konumun bu hizmeti kullanmaya uygun olup olmadığını doğrulayın veya başka bir konum bilgisi kullanmayı deneyin.", + "MinimaxBizError": "Minimax hizmetine yapılan istekte hata oluştu, lütfen aşağıdaki bilgilere göre sorunu giderin veya tekrar deneyin", "MistralBizError": "Mistral AI hizmeti isteği sırasında bir hata oluştu. Lütfen aşağıdaki bilgilere göre sorunu giderin veya tekrar deneyin", "MoonshotBizError": "Moonshot hizmetinde bir hata oluştu, lütfen aşağıdaki bilgilere göre sorunu giderin veya tekrar deneyin", "NoOpenAIAPIKey": "OpenAI API Anahtarı boş, lütfen özel bir OpenAI API Anahtarı ekleyin", diff --git a/locales/tr-TR/modelProvider.json b/locales/tr-TR/modelProvider.json index 9559df03ee8c..b6020115ca54 100644 --- a/locales/tr-TR/modelProvider.json +++ b/locales/tr-TR/modelProvider.json @@ -95,6 +95,18 @@ "title": "Özel Groq API Anahtarı Kullan" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Minimax'den API Anahtarınızı girin", + "placeholder": "Minimax API Anahtarı", + "title": "API Anahtarı" + }, + "unlock": { + "description": "Minimax API Anahtarınızı girerek oturumu başlatabilirsiniz. Uygulama API Anahtarınızı kaydetmez", + "title": "Özel Minimax API Anahtarını Kullan" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/vi-VN/error.json b/locales/vi-VN/error.json index 1d4996727abb..7f3e5d729cb4 100644 --- a/locales/vi-VN/error.json +++ b/locales/vi-VN/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Xác thực Bedrock không thành công, vui lòng kiểm tra AccessKeyId/SecretAccessKey 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", "InvalidMistralAPIKey": "Mistral AI API Key không hợp lệ hoặc trống, vui lòng kiểm tra lại Mistral API Key và thử lại", "InvalidMoonshotAPIKey": "Khóa API Moonshot AI không hợp lệ hoặc trống, vui lòng kiểm tra lại Khóa API Moonshot và thử lại", "InvalidOllamaArgs": "Cấu hình Ollama không hợp lệ, vui lòng kiểm tra lại cấu hình Ollama và thử lại", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "Khóa API ZeroOne không hợp lệ hoặc trống, vui lòng kiểm tra lại khóa API ZeroOne và thử lại", "InvalidZhipuAPIKey": "Khóa API Zhipu không chính xác hoặc trống, vui lòng kiểm tra lại Khóa API Zhipu và thử lại", "LocationNotSupportError": "Xin lỗi, vị trí của bạn không hỗ trợ dịch vụ mô hình này, có thể do hạn chế vùng miền hoặc dịch vụ chưa được mở. Vui lòng xác nhận xem vị trí hiện tại có hỗ trợ sử dụng dịch vụ này không, hoặc thử sử dụng thông tin vị trí khác.", + "MinimaxBizError": "Yêu cầu dịch vụ Minimax gặp lỗi, vui lòng kiểm tra thông tin dưới đây hoặc thử lại", "MistralBizError": "Yêu cầu dịch vụ Mistral AI gặp lỗi, vui lòng kiểm tra thông tin dưới đây hoặc thử lại", "MoonshotBizError": "Yêu cầu dịch vụ Mặt Trăng Tối gặp sự cố, vui lòng kiểm tra thông tin dưới đây hoặc thử lại", "NoOpenAIAPIKey": "Khóa API OpenAI trống, vui lòng thêm Khóa API OpenAI tùy chỉnh", diff --git a/locales/vi-VN/modelProvider.json b/locales/vi-VN/modelProvider.json index d60c4007d71a..f6097bf77a94 100644 --- a/locales/vi-VN/modelProvider.json +++ b/locales/vi-VN/modelProvider.json @@ -95,6 +95,18 @@ "title": "Sử dụng Khóa API Groq tùy chỉnh" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "Nhập API Key từ Minimax", + "placeholder": "Minimax API Key", + "title": "API Key" + }, + "unlock": { + "description": "Nhập Minimax API Key của bạn để 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 Minimax API Key tùy chỉnh" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/zh-CN/error.json b/locales/zh-CN/error.json index 7573b1c71043..9d2e133f10f5 100644 --- a/locales/zh-CN/error.json +++ b/locales/zh-CN/error.json @@ -76,6 +76,8 @@ "InvalidOllamaArgs": "Ollama 配置不正确,请检查 Ollama 配置后重试", "OllamaBizError": "请求 Ollama 服务出错,请根据以下信息排查或重试", "OllamaServiceUnavailable": "Ollama 服务连接失败,请检查 Ollama 是否运行正常,或是否正确设置 Ollama 的跨域配置", + "MinimaxBizError": "请求 Minimax 服务出错,请根据以下信息排查或重试", + "InvalidMinimaxAPIKey": "Minimax API Key 不正确或为空,请检查 Minimax API Key 后重试", "AgentRuntimeError": "Lobe AI Runtime 执行出错,请根据以下信息排查或重试" }, "stt": { diff --git a/locales/zh-CN/modelProvider.json b/locales/zh-CN/modelProvider.json index f9291a7dbc2b..682dc96cbab5 100644 --- a/locales/zh-CN/modelProvider.json +++ b/locales/zh-CN/modelProvider.json @@ -95,6 +95,18 @@ "title": "使用自定义 Groq API Key" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "填入来自 Minimax 的 API Key", + "placeholder": "Minimax API Key", + "title": "API Key" + }, + "unlock": { + "description": "输入你的 Minimax API Key 即可开始会话。应用不会记录你的 API Key", + "title": "使用自定义 Minimax API Key" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/locales/zh-TW/error.json b/locales/zh-TW/error.json index ee184e7c3f36..a42516ede6e3 100644 --- a/locales/zh-TW/error.json +++ b/locales/zh-TW/error.json @@ -45,6 +45,7 @@ "InvalidBedrockCredentials": "Bedrock 驗證未通過,請檢查 AccessKeyId/SecretAccessKey 後重試", "InvalidGoogleAPIKey": "Google API Key 不正確或為空,請檢查 Google API Key 後重試", "InvalidGroqAPIKey": "Groq API 金鑰不正確或為空,請檢查 Groq API 金鑰後重試", + "InvalidMinimaxAPIKey": "Minimax API 金鑰不正確或為空,請檢查 Minimax API 金鑰後重試", "InvalidMistralAPIKey": "Mistral AI API Key 不正確或為空,請檢查 Mistral API Key 後重試", "InvalidMoonshotAPIKey": "Moonshot AI API 金鑰不正確或為空,請檢查 Moonshot API 金鑰後重試", "InvalidOllamaArgs": "Ollama 配置不正確,請檢查 Ollama 配置後重試", @@ -54,6 +55,7 @@ "InvalidZeroOneAPIKey": "零一萬物 API Key 不正確或為空,請檢查零一萬物 API Key 後重試", "InvalidZhipuAPIKey": "Zhipu API Key 不正確或為空,請檢查 Zhipu API Key 後重試", "LocationNotSupportError": "很抱歉,你的所在位置不支持此模型服務,可能是由於地區限制或服務未開通。請確認當前位置是否支持使用此服務,或嘗試使用其他位置信息。", + "MinimaxBizError": "請求 Minimax 服務出錯,請根據以下資訊排查或重試", "MistralBizError": "請求 Mistral AI 服務出錯,請根據以下信息排查或重試", "MoonshotBizError": "請求月球背面服務出錯,請根據以下信息排查或重試", "NoOpenAIAPIKey": "OpenAI API 金鑰為空,請添加自訂 OpenAI API 金鑰", diff --git a/locales/zh-TW/modelProvider.json b/locales/zh-TW/modelProvider.json index bd0d78bc7f66..24704b648b6d 100644 --- a/locales/zh-TW/modelProvider.json +++ b/locales/zh-TW/modelProvider.json @@ -95,6 +95,18 @@ "title": "使用自定義 Groq API 金鑰" } }, + "minimax": { + "title": "Minimax", + "token": { + "desc": "請填入來自 Minimax 的 API 金鑰", + "placeholder": "Minimax API 金鑰", + "title": "API 金鑰" + }, + "unlock": { + "description": "輸入您的 Minimax API 金鑰即可開始會話。應用程式不會記錄您的 API 金鑰", + "title": "使用自訂 Minimax API 金鑰" + } + }, "mistral": { "title": "Mistral AI", "token": { diff --git a/src/app/api/chat/agentRuntime.test.ts b/src/app/api/chat/agentRuntime.test.ts index c23f8ff70fd8..87ea783f2af1 100644 --- a/src/app/api/chat/agentRuntime.test.ts +++ b/src/app/api/chat/agentRuntime.test.ts @@ -8,6 +8,7 @@ import { LobeBedrockAI, LobeGoogleAI, LobeGroq, + LobeMinimaxAI, LobeMistralAI, LobeMoonshotAI, LobeOllamaAI, @@ -42,6 +43,7 @@ vi.mock('@/config/server', () => ({ OLLAMA_PROXY_URL: 'https://test-ollama-url.local', PERPLEXITY_API_KEY: 'test-perplexity-key', ANTHROPIC_API_KEY: 'test-anthropic-key', + MINIMAX_API_KEY: 'test-minimax-key', MISTRAL_API_KEY: 'test-mistral-key', OPENROUTER_API_KEY: 'test-openrouter-key', TOGETHERAI_API_KEY: 'test-togetherai-key', @@ -130,6 +132,13 @@ describe('initAgentRuntimeWithUserPayload method', () => { expect(runtime['_runtime']).toBeInstanceOf(LobeAnthropicAI); }); + it('Minimax AI provider: with apikey', async () => { + const jwtPayload: JWTPayload = { apiKey: 'user-minimax-key' }; + const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.Minimax, jwtPayload); + expect(runtime).toBeInstanceOf(AgentRuntime); + expect(runtime['_runtime']).toBeInstanceOf(LobeMinimaxAI); + }); + it('Mistral AI provider: with apikey', async () => { const jwtPayload: JWTPayload = { apiKey: 'user-mistral-key' }; const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.Mistral, jwtPayload); @@ -246,6 +255,14 @@ describe('initAgentRuntimeWithUserPayload method', () => { expect(runtime['_runtime']).toBeInstanceOf(LobeAnthropicAI); }); + it('Minimax AI provider: without apikey', async () => { + const jwtPayload = {}; + const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.Minimax, jwtPayload); + + // 假设 LobeMistralAI 是 Mistral 提供者的实现类 + expect(runtime['_runtime']).toBeInstanceOf(LobeMinimaxAI); + }); + it('Mistral AI provider: without apikey', async () => { const jwtPayload = {}; const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.Mistral, jwtPayload); diff --git a/src/app/api/chat/agentRuntime.ts b/src/app/api/chat/agentRuntime.ts index bb613822e89c..31fd70a32e95 100644 --- a/src/app/api/chat/agentRuntime.ts +++ b/src/app/api/chat/agentRuntime.ts @@ -114,6 +114,13 @@ const getLlmOptionsFromPayload = (provider: string, payload: JWTPayload) => { baseURL, }; } + case ModelProvider.Minimax: { + const { MINIMAX_API_KEY } = getServerConfig(); + const apiKey = apiKeyManager.pick(payload?.apiKey || MINIMAX_API_KEY); + return { + apiKey, + }; + } case ModelProvider.Mistral: { const { MISTRAL_API_KEY } = getServerConfig(); const apiKey = apiKeyManager.pick(payload?.apiKey || MISTRAL_API_KEY); diff --git a/src/app/api/chat/minimax/route.test.ts b/src/app/api/chat/minimax/route.test.ts new file mode 100644 index 000000000000..44bc7940c4ca --- /dev/null +++ b/src/app/api/chat/minimax/route.test.ts @@ -0,0 +1,24 @@ +// @vitest-environment edge-runtime +import { describe, expect, it, vi } from 'vitest'; + +import { POST as UniverseRoute } from '../[provider]/route'; +import { POST, runtime } from './route'; + +// 模拟 '../[provider]/route' +vi.mock('../[provider]/route', () => ({ + POST: vi.fn().mockResolvedValue('mocked response'), +})); + +describe('Configuration tests', () => { + it('should have runtime set to "edge"', () => { + expect(runtime).toBe('nodejs'); + }); +}); + +describe('Minimax POST function tests', () => { + it('should call UniverseRoute with correct parameters', async () => { + const mockRequest = new Request('https://example.com', { method: 'POST' }); + await POST(mockRequest); + expect(UniverseRoute).toHaveBeenCalledWith(mockRequest, { params: { provider: 'minimax' } }); + }); +}); diff --git a/src/app/api/chat/minimax/route.ts b/src/app/api/chat/minimax/route.ts new file mode 100644 index 000000000000..31d7e7a1ed1b --- /dev/null +++ b/src/app/api/chat/minimax/route.ts @@ -0,0 +1,5 @@ +import { POST as UniverseRoute } from '../[provider]/route'; + +export const runtime = 'nodejs'; + +export const POST = async (req: Request) => UniverseRoute(req, { params: { provider: 'minimax' } }); diff --git a/src/app/api/errorResponse.test.ts b/src/app/api/errorResponse.test.ts index 6f064056aff0..8c243c187ec8 100644 --- a/src/app/api/errorResponse.test.ts +++ b/src/app/api/errorResponse.test.ts @@ -126,6 +126,12 @@ describe('createErrorResponse', () => { const response = createErrorResponse(errorType); expect(response.status).toBe(484); }); + + it('returns a 485 status for MinimaxBizError error type', () => { + const errorType = AgentRuntimeErrorType.MinimaxBizError; + const response = createErrorResponse(errorType); + expect(response.status).toBe(485); + }); }); // 测试状态码不在200-599范围内的情况 diff --git a/src/app/api/errorResponse.ts b/src/app/api/errorResponse.ts index e14014c4a189..c0fb5ac45718 100644 --- a/src/app/api/errorResponse.ts +++ b/src/app/api/errorResponse.ts @@ -62,6 +62,9 @@ const getStatus = (errorType: ILobeAgentRuntimeErrorType | ErrorType) => { case AgentRuntimeErrorType.TogetherAIBizError: { return 484; } + case AgentRuntimeErrorType.MinimaxBizError: { + return 485; + } } return errorType as number; }; diff --git a/src/app/settings/llm/Minimax/index.tsx b/src/app/settings/llm/Minimax/index.tsx new file mode 100644 index 000000000000..9cd055d2446a --- /dev/null +++ b/src/app/settings/llm/Minimax/index.tsx @@ -0,0 +1,26 @@ +import { Minimax } from '@lobehub/icons'; +import { useTheme } from 'antd-style'; +import { memo } from 'react'; + +import { ModelProvider } from '@/libs/agent-runtime'; + +import ProviderConfig from '../components/ProviderConfig'; + +const MinimaxProvider = memo(() => { + const theme = useTheme(); + + return ( + + } + /> + ); +}); + +export default MinimaxProvider; diff --git a/src/app/settings/llm/index.tsx b/src/app/settings/llm/index.tsx index 456bb18d82d8..4661e6c6229f 100644 --- a/src/app/settings/llm/index.tsx +++ b/src/app/settings/llm/index.tsx @@ -13,6 +13,7 @@ import Azure from './Azure'; import Bedrock from './Bedrock'; import Google from './Google'; import Groq from './Groq'; +import Minimax from './Minimax'; import Mistral from './Mistral'; import Moonshot from './Moonshot'; import Ollama from './Ollama'; @@ -39,6 +40,7 @@ export default memo(() => { + diff --git a/src/app/settings/sync/components/SystemIcon.tsx b/src/app/settings/sync/components/SystemIcon.tsx index 2aa4e03451e1..49e9c9a44e53 100644 --- a/src/app/settings/sync/components/SystemIcon.tsx +++ b/src/app/settings/sync/components/SystemIcon.tsx @@ -8,7 +8,6 @@ import { } from '@icons-pack/react-simple-icons'; import { memo } from 'react'; - // TODO: 等 simple icons 修复类型,移除 ignore const SystemIcon = memo<{ title?: string }>(({ title }) => { diff --git a/src/components/ModelIcon/index.tsx b/src/components/ModelIcon/index.tsx index ab1d894a6fc4..889ddc123198 100644 --- a/src/components/ModelIcon/index.tsx +++ b/src/components/ModelIcon/index.tsx @@ -45,9 +45,7 @@ const ModelIcon = memo(({ model: originModel, size = 12 // currently supported models, maybe not in its own provider if (model.includes('gpt-3')) return ; if (model.includes('gpt-4')) return ; - if (model.startsWith('glm') || - model.includes('chatglm')) - return ; + if (model.startsWith('glm') || model.includes('chatglm')) return ; if (model.includes('claude')) return ; if (model.includes('titan')) return ; if (model.includes('llama')) return ; @@ -56,13 +54,9 @@ const ModelIcon = memo(({ model: originModel, size = 12 if (model.includes('gemma')) return ; if (model.includes('moonshot')) return ; if (model.includes('qwen')) return ; - if (model.includes('minmax')) return ; - if (model.includes('mistral') || - model.includes('mixtral')) - return ; - if (model.includes('pplx') || - model.includes('sonar')) - return ; + if (model.includes('minmax') || model.includes('abab')) return ; + if (model.includes('mistral') || model.includes('mixtral')) return ; + if (model.includes('pplx') || model.includes('sonar')) return ; if (model.includes('yi-')) return ; if (model.startsWith('openrouter')) return ; // only for Cinematika and Auto if (model.startsWith('openchat')) return ; @@ -73,13 +67,11 @@ const ModelIcon = memo(({ model: originModel, size = 12 if (model.includes('baichuan')) return ; if (model.includes('rwkv')) return ; - if (model.includes('ernie')) - return ; + if (model.includes('ernie')) return ; if (model.includes('spark')) return ; if (model.includes('hunyuan')) return ; // ref https://github.com/fishaudio/Bert-VITS2/blob/master/train_ms.py#L702 - if (model.startsWith('d_') || - model.startsWith('g_') || model.startsWith('wd_')) + if (model.startsWith('d_') || model.startsWith('g_') || model.startsWith('wd_')) return ; if (model.includes('skylark')) return ; @@ -97,9 +89,7 @@ const ModelIcon = memo(({ model: originModel, size = 12 if (model.includes('wizardlm')) return ; if (model.includes('phi3')) return ; if (model.includes('firefly')) return ; - if (model.includes('jamba') || - model.includes('j2-')) - return ; + if (model.includes('jamba') || model.includes('j2-')) return ; }); export default ModelIcon; diff --git a/src/components/ModelProviderIcon/index.tsx b/src/components/ModelProviderIcon/index.tsx index ba1a52f1e8b0..e905f86e43c6 100644 --- a/src/components/ModelProviderIcon/index.tsx +++ b/src/components/ModelProviderIcon/index.tsx @@ -4,6 +4,7 @@ import { Bedrock, Google, Groq, + Minimax, Mistral, Moonshot, Ollama, @@ -65,6 +66,10 @@ const ModelProviderIcon = memo(({ provider }) => { return ; } + case ModelProvider.Minimax: { + return ; + } + case ModelProvider.Mistral: { return ; } diff --git a/src/components/ModelTag/ModelIcon.tsx b/src/components/ModelTag/ModelIcon.tsx index 1614291d1f17..c15e11ad4e9a 100644 --- a/src/components/ModelTag/ModelIcon.tsx +++ b/src/components/ModelTag/ModelIcon.tsx @@ -51,6 +51,7 @@ const ModelIcon = memo(({ model, size = 12 }) => { if (model.includes('moonshot')) return ; if (model.includes('qwen')) return ; if (model.includes('minmax')) return ; + if (model.includes('abab')) return ; if (model.includes('mistral') || model.includes('mixtral')) return ; if (model.includes('pplx') || model.includes('sonar')) return ; if (model.includes('yi-')) return ; diff --git a/src/config/modelProviders/index.ts b/src/config/modelProviders/index.ts index dfbb5caf0523..450c321a5fd7 100644 --- a/src/config/modelProviders/index.ts +++ b/src/config/modelProviders/index.ts @@ -5,6 +5,7 @@ import AzureProvider from './azure'; import BedrockProvider from './bedrock'; import GoogleProvider from './google'; import GroqProvider from './groq'; +import MinimaxProvider from './minimax'; import MistralProvider from './mistral'; import MoonshotProvider from './moonshot'; import OllamaProvider from './ollama'; @@ -21,6 +22,7 @@ export const LOBE_DEFAULT_MODEL_LIST: ChatModelCard[] = [ BedrockProvider.chatModels, GoogleProvider.chatModels, GroqProvider.chatModels, + MinimaxProvider.chatModels, MistralProvider.chatModels, MoonshotProvider.chatModels, OllamaProvider.chatModels, @@ -41,6 +43,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [ TogetherAIProvider, BedrockProvider, PerplexityProvider, + MinimaxProvider, MistralProvider, GroqProvider, MoonshotProvider, @@ -57,6 +60,7 @@ export { default as AzureProviderCard } from './azure'; export { default as BedrockProviderCard } from './bedrock'; export { default as GoogleProviderCard } from './google'; export { default as GroqProviderCard } from './groq'; +export { default as MinimaxProviderCard } from './minimax'; export { default as MistralProviderCard } from './mistral'; export { default as MoonshotProviderCard } from './moonshot'; export { default as OllamaProviderCard } from './ollama'; diff --git a/src/config/modelProviders/minimax.ts b/src/config/modelProviders/minimax.ts new file mode 100644 index 000000000000..a16221e16439 --- /dev/null +++ b/src/config/modelProviders/minimax.ts @@ -0,0 +1,30 @@ +import { ModelProviderCard } from '@/types/llm'; + +const Minimax: ModelProviderCard = { + chatModels: [ + { + description: '更复杂的格式化文本生成', + displayName: 'abab6', + enabled: true, + id: 'abab6-chat', + tokens: 32_768, + }, + { + description: '生产力场景', + displayName: 'abab5.5', + enabled: true, + id: 'abab5.5-chat', + tokens: 16_384, + }, + { + description: '人设对话场景', + displayName: 'abab5.5s', + enabled: true, + id: 'abab5.5s-chat', + tokens: 8192, + }, + ], + id: 'minimax', +}; + +export default Minimax; diff --git a/src/config/server/provider.ts b/src/config/server/provider.ts index b7876d2095ad..249ba8ffa14d 100644 --- a/src/config/server/provider.ts +++ b/src/config/server/provider.ts @@ -43,6 +43,10 @@ declare global { ANTHROPIC_API_KEY?: string; ANTHROPIC_PROXY_URL?: string; + // Minimax Provider + ENABLED_MINIMAX?: string; + MINIMAX_API_KEY?: string; + // Mistral Provider ENABLED_MISTRAL?: string; MISTRAL_API_KEY?: string; @@ -109,6 +113,8 @@ export const getProviderConfig = () => { const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || ''; + const MINIMAX_API_KEY = process.env.MINIMAX_API_KEY || ''; + const MISTRAL_API_KEY = process.env.MISTRAL_API_KEY || ''; const GROQ_API_KEY = process.env.GROQ_API_KEY || ''; @@ -171,6 +177,9 @@ export const getProviderConfig = () => { ANTHROPIC_API_KEY, ANTHROPIC_PROXY_URL: process.env.ANTHROPIC_PROXY_URL, + ENABLED_MINIMAX: !!MINIMAX_API_KEY, + MINIMAX_API_KEY, + ENABLED_MISTRAL: !!MISTRAL_API_KEY, MISTRAL_API_KEY, diff --git a/src/const/settings/index.ts b/src/const/settings/index.ts index aea9adbcb975..ee2330de4050 100644 --- a/src/const/settings/index.ts +++ b/src/const/settings/index.ts @@ -3,6 +3,7 @@ import { BedrockProviderCard, GoogleProviderCard, GroqProviderCard, + MinimaxProviderCard, MistralProviderCard, MoonshotProviderCard, OllamaProviderCard, @@ -90,6 +91,11 @@ export const DEFAULT_LLM_CONFIG: GlobalLLMConfig = { enabled: false, enabledModels: filterEnabledModels(GroqProviderCard), }, + minimax: { + apiKey: '', + enabled: false, + enabledModels: filterEnabledModels(MinimaxProviderCard), + }, mistral: { apiKey: '', enabled: false, diff --git a/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx b/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx index a704d09d2a2b..60f3216807cd 100644 --- a/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx +++ b/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx @@ -2,6 +2,7 @@ import { Anthropic, Google, Groq, + Minimax, Mistral, Moonshot, OpenAI, @@ -32,6 +33,10 @@ const ProviderAvatar = memo(({ provider }) => { return ; } + case ModelProvider.Minimax: { + return ; + } + case ModelProvider.Mistral: { return ; } diff --git a/src/features/Conversation/Error/index.tsx b/src/features/Conversation/Error/index.tsx index 50568ad22e15..bc29efbc000d 100644 --- a/src/features/Conversation/Error/index.tsx +++ b/src/features/Conversation/Error/index.tsx @@ -69,6 +69,7 @@ const ErrorMessageExtra = memo<{ data: ChatMessage }>(({ data }) => { case AgentRuntimeErrorType.InvalidBedrockCredentials: case AgentRuntimeErrorType.InvalidZhipuAPIKey: + case AgentRuntimeErrorType.InvalidMinimaxAPIKey: case AgentRuntimeErrorType.InvalidMistralAPIKey: case AgentRuntimeErrorType.InvalidMoonshotAPIKey: case AgentRuntimeErrorType.InvalidGoogleAPIKey: diff --git a/src/libs/agent-runtime/AgentRuntime.ts b/src/libs/agent-runtime/AgentRuntime.ts index 2a399bfde2a1..bd457920211e 100644 --- a/src/libs/agent-runtime/AgentRuntime.ts +++ b/src/libs/agent-runtime/AgentRuntime.ts @@ -8,6 +8,7 @@ import { LobeAzureOpenAI } from './azureOpenai'; import { LobeBedrockAI, LobeBedrockAIParams } from './bedrock'; import { LobeGoogleAI } from './google'; import { LobeGroq } from './groq'; +import { LobeMinimaxAI } from './minimax'; import { LobeMistralAI } from './mistral'; import { LobeMoonshotAI } from './moonshot'; import { LobeOllamaAI } from './ollama'; @@ -94,6 +95,7 @@ class AgentRuntime { bedrock: Partial; google: { apiKey?: string; baseURL?: string }; groq: Partial; + minimax: Partial; mistral: Partial; moonshot: Partial; ollama: Partial; @@ -159,6 +161,11 @@ class AgentRuntime { break; } + case ModelProvider.Minimax: { + runtimeModel = new LobeMinimaxAI(params.minimax ?? {}); + break; + } + case ModelProvider.Mistral: { runtimeModel = new LobeMistralAI(params.mistral ?? {}); break; diff --git a/src/libs/agent-runtime/error.ts b/src/libs/agent-runtime/error.ts index 6fe72a8de05d..4f29049f9d55 100644 --- a/src/libs/agent-runtime/error.ts +++ b/src/libs/agent-runtime/error.ts @@ -46,6 +46,9 @@ export const AgentRuntimeErrorType = { InvalidTogetherAIAPIKey: 'InvalidTogetherAIAPIKey', TogetherAIBizError: 'TogetherAIBizError', + + InvalidMinimaxAPIKey: 'InvalidMinimaxAPIKey', + MinimaxBizError: 'MinimaxBizError', } as const; export type ILobeAgentRuntimeErrorType = diff --git a/src/libs/agent-runtime/index.ts b/src/libs/agent-runtime/index.ts index 27bf46276944..419e21160c53 100644 --- a/src/libs/agent-runtime/index.ts +++ b/src/libs/agent-runtime/index.ts @@ -6,6 +6,7 @@ export { LobeBedrockAI } from './bedrock'; export * from './error'; export { LobeGoogleAI } from './google'; export { LobeGroq } from './groq'; +export { LobeMinimaxAI } from './minimax'; export { LobeMistralAI } from './mistral'; export { LobeMoonshotAI } from './moonshot'; export { LobeOllamaAI } from './ollama'; diff --git a/src/libs/agent-runtime/minimax/index.test.ts b/src/libs/agent-runtime/minimax/index.test.ts new file mode 100644 index 000000000000..6259844e7642 --- /dev/null +++ b/src/libs/agent-runtime/minimax/index.test.ts @@ -0,0 +1,261 @@ +// @vitest-environment edge-runtime +import { StreamingTextResponse } from 'ai'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; + +import { ChatStreamPayload, ModelProvider } from '@/libs/agent-runtime'; +import * as debugStreamModule from '@/libs/agent-runtime/utils/debugStream'; + +import { LobeMinimaxAI } from './index'; + +const provider = ModelProvider.Minimax; +const bizErrorType = 'MinimaxBizError'; +const invalidErrorType = 'InvalidMinimaxAPIKey'; +const encoder = new TextEncoder(); + +// Mock the console.error to avoid polluting test output +vi.spyOn(console, 'error').mockImplementation(() => {}); + +let instance: LobeMinimaxAI; + +beforeEach(() => { + instance = new LobeMinimaxAI({ apiKey: 'test' }); +}); + +afterEach(() => { + vi.clearAllMocks(); +}); + +describe('LobeMinimaxAI', () => { + describe('init', () => { + it('should correctly initialize with an API key', async () => { + const instance = new LobeMinimaxAI({ apiKey: 'test_api_key' }); + expect(instance).toBeInstanceOf(LobeMinimaxAI); + }); + + it('should throw AgentRuntimeError with InvalidMinimaxAPIKey if no apiKey is provided', async () => { + try { + new LobeMinimaxAI({}); + } catch (e) { + expect(e).toEqual({ errorType: invalidErrorType }); + } + }); + }); + + describe('chat', () => { + it('should return a StreamingTextResponse on successful API call', async () => { + const mockResponseData = { + choices: [{ delta: { content: 'Hello, world!' } }], + }; + const mockResponse = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`data: ${JSON.stringify(mockResponseData)}`)); + controller.close(); + }, + }), + ); + vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(mockResponse); + + const result = await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + }); + + expect(result).toBeInstanceOf(StreamingTextResponse); + }); + + it('should handle text messages correctly', async () => { + const mockResponseData = { + choices: [{ delta: { content: 'Hello, world!' } }], + }; + const mockResponse = new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`data: ${JSON.stringify(mockResponseData)}`)); + controller.close(); + }, + }), + ); + vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(mockResponse); + + const result = await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + }); + + expect(result).toBeInstanceOf(StreamingTextResponse); + }); + + it('should call debugStream in DEBUG mode', async () => { + process.env.DEBUG_MINIMAX_CHAT_COMPLETION = '1'; + + vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce( + new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(JSON.stringify('Hello, world!'))); + controller.close(); + }, + }), + ), + ); + + vi.spyOn(debugStreamModule, 'debugStream').mockImplementation(() => Promise.resolve()); + + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + }); + + // Assert + expect(debugStreamModule.debugStream).toHaveBeenCalled(); + + delete process.env.DEBUG_MINIMAX_CHAT_COMPLETION; + }); + + describe('Error', () => { + it('should throw InvalidMinimaxAPIKey error on API_KEY_INVALID error', async () => { + const mockErrorResponse = { + base_resp: { + status_code: 1004, + status_msg: 'API key not valid', + }, + }; + vi.spyOn(globalThis, 'fetch').mockResolvedValue( + new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(JSON.stringify(mockErrorResponse))); + controller.close(); + }, + }), + ), + ); + + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + errorType: invalidErrorType, + error: { + code: 1004, + message: 'API key not valid', + }, + provider, + }); + } + }); + + it('should throw MinimaxBizError error on other error status codes', async () => { + const mockErrorResponse = { + base_resp: { + status_code: 1001, + status_msg: 'Some error occurred', + }, + }; + vi.spyOn(globalThis, 'fetch').mockResolvedValue( + new Response( + new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(JSON.stringify(mockErrorResponse))); + controller.close(); + }, + }), + ), + ); + + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + errorType: bizErrorType, + error: { + code: 1001, + message: 'Some error occurred', + }, + provider, + }); + } + }); + + it('should throw MinimaxBizError error on generic errors', async () => { + const mockError = new Error('Something went wrong'); + vi.spyOn(globalThis, 'fetch').mockRejectedValueOnce(mockError); + + try { + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + }); + } catch (e) { + expect(e).toEqual({ + errorType: bizErrorType, + error: { + cause: undefined, + message: 'Something went wrong', + name: 'Error', + stack: mockError.stack, + }, + provider, + }); + } + }); + }); + }); + + describe('private methods', () => { + describe('buildCompletionsParams', () => { + it('should build the correct parameters', () => { + const payload: ChatStreamPayload = { + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0.5, + top_p: 0.8, + max_tokens: 100, + }; + + const result = instance['buildCompletionsParams'](payload); + + expect(result).toEqual({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + stream: true, + temperature: 0.5, + top_p: 0.8, + max_tokens: 100, + }); + }); + + it('should exclude temperature and top_p when they are 0', () => { + const payload: ChatStreamPayload = { + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + temperature: 0, + top_p: 0, + max_tokens: 100, + }; + + const result = instance['buildCompletionsParams'](payload); + + expect(result).toEqual({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'text-davinci-003', + stream: true, + max_tokens: 100, + }); + }); + }); + }); +}); diff --git a/src/libs/agent-runtime/minimax/index.ts b/src/libs/agent-runtime/minimax/index.ts new file mode 100644 index 000000000000..f8201ab8ad91 --- /dev/null +++ b/src/libs/agent-runtime/minimax/index.ts @@ -0,0 +1,185 @@ +import { StreamingTextResponse } from 'ai'; +import { isEmpty } from 'lodash-es'; +import OpenAI from 'openai'; + +import { debugStream } from '@/libs/agent-runtime/utils/debugStream'; + +import { LobeRuntimeAI } from '../BaseAI'; +import { AgentRuntimeErrorType } from '../error'; +import { + ChatCompetitionOptions, + ChatCompletionErrorPayload, + ChatStreamPayload, + ModelProvider, +} from '../types'; +import { AgentRuntimeError } from '../utils/createError'; + +interface MinimaxBaseResponse { + base_resp?: { + status_code?: number; + status_msg?: string; + }; +} + +type MinimaxResponse = Partial & MinimaxBaseResponse; + +function throwIfErrorResponse(data: MinimaxResponse) { + // error status code + // https://www.minimaxi.com/document/guides/chat-model/pro/api?id=6569c85948bc7b684b30377e#3.1.3%20%E8%BF%94%E5%9B%9E(response)%E5%8F%82%E6%95%B0 + if (!data.base_resp?.status_code || data.base_resp?.status_code < 1000) { + return; + } + if (data.base_resp?.status_code === 1004) { + throw AgentRuntimeError.chat({ + error: { + code: data.base_resp.status_code, + message: data.base_resp.status_msg, + }, + errorType: AgentRuntimeErrorType.InvalidMinimaxAPIKey, + provider: ModelProvider.Minimax, + }); + } + throw AgentRuntimeError.chat({ + error: { + code: data.base_resp.status_code, + message: data.base_resp.status_msg, + }, + errorType: AgentRuntimeErrorType.MinimaxBizError, + provider: ModelProvider.Minimax, + }); +} + +function parseMinimaxResponse(chunk: string): string | undefined { + let body = chunk; + if (body.startsWith('data:')) { + body = body.slice(5).trim(); + } + if (isEmpty(body)) { + return; + } + const data = JSON.parse(body) as MinimaxResponse; + if (data.choices?.at(0)?.delta?.content) { + return data.choices.at(0)?.delta.content || undefined; + } +} + +export class LobeMinimaxAI implements LobeRuntimeAI { + apiKey: string; + + constructor({ apiKey }: { apiKey?: string }) { + if (!apiKey) throw AgentRuntimeError.createError(AgentRuntimeErrorType.InvalidMinimaxAPIKey); + + this.apiKey = apiKey; + } + + async chat( + payload: ChatStreamPayload, + options?: ChatCompetitionOptions, + ): Promise { + try { + let streamController: ReadableStreamDefaultController | undefined; + const readableStream = new ReadableStream({ + start(controller) { + streamController = controller; + }, + }); + + const response = await fetch('https://api.minimax.chat/v1/text/chatcompletion_v2', { + body: JSON.stringify(this.buildCompletionsParams(payload)), + headers: { + 'Authorization': `Bearer ${this.apiKey}`, + 'Content-Type': 'application/json', + }, + method: 'POST', + }); + if (!response.body || !response.ok) { + throw AgentRuntimeError.chat({ + error: { + status: response.status, + statusText: response.statusText, + }, + errorType: AgentRuntimeErrorType.MinimaxBizError, + provider: ModelProvider.Minimax, + }); + } + + const [prod, body2] = response.body.tee(); + const [prod2, debug] = body2.tee(); + + if (process.env.DEBUG_MINIMAX_CHAT_COMPLETION === '1') { + debugStream(debug).catch(console.error); + } + + this.parseResponse(prod.getReader(), streamController); + + // wait for the first response, and throw error if minix returns an error + await this.parseFirstResponse(prod2.getReader()); + + return new StreamingTextResponse(readableStream, { headers: options?.headers }); + } catch (error) { + console.log('error', error); + const err = error as Error | ChatCompletionErrorPayload; + if ('provider' in err) { + throw error; + } + const errorResult = { + cause: err.cause, + message: err.message, + name: err.name, + stack: err.stack, + }; + throw AgentRuntimeError.chat({ + error: errorResult, + errorType: AgentRuntimeErrorType.MinimaxBizError, + provider: ModelProvider.Minimax, + }); + } + } + + private buildCompletionsParams(payload: ChatStreamPayload) { + const { temperature, top_p, ...params } = payload; + + return { + ...params, + stream: true, + temperature: temperature === 0 ? undefined : temperature, + top_p: top_p === 0 ? undefined : top_p, + }; + } + + private async parseResponse( + reader: ReadableStreamDefaultReader, + streamController: ReadableStreamDefaultController | undefined, + ) { + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + let done = false; + + while (!done) { + const { value, done: doneReading } = await reader.read(); + done = doneReading; + const chunkValue = decoder.decode(value, { stream: true }); + const text = parseMinimaxResponse(chunkValue); + streamController?.enqueue(encoder.encode(text)); + } + + streamController?.close(); + } + + private async parseFirstResponse(reader: ReadableStreamDefaultReader) { + const decoder = new TextDecoder(); + + const { value } = await reader.read(); + const chunkValue = decoder.decode(value, { stream: true }); + let data; + try { + data = JSON.parse(chunkValue) as MinimaxResponse; + } catch { + // parse error, skip it + return; + } + throwIfErrorResponse(data); + } +} + +export default LobeMinimaxAI; diff --git a/src/libs/agent-runtime/togetherai/type.ts b/src/libs/agent-runtime/togetherai/type.ts index 7660aa4a8953..c980c86e3198 100644 --- a/src/libs/agent-runtime/togetherai/type.ts +++ b/src/libs/agent-runtime/togetherai/type.ts @@ -1,4 +1,3 @@ - interface ModelInstanceConfig { appearsIn: any[]; // 你可以替换为实际类型 order: number; diff --git a/src/libs/agent-runtime/types/type.ts b/src/libs/agent-runtime/types/type.ts index e89602bed4f6..e718358171fc 100644 --- a/src/libs/agent-runtime/types/type.ts +++ b/src/libs/agent-runtime/types/type.ts @@ -28,6 +28,7 @@ export enum ModelProvider { ChatGLM = 'chatglm', Google = 'google', Groq = 'groq', + Minimax = 'minimax', Mistral = 'mistral', Moonshot = 'moonshot', Ollama = 'ollama', diff --git a/src/locales/default/error.ts b/src/locales/default/error.ts index d5c28b9b34fe..7b9ccb874a9f 100644 --- a/src/locales/default/error.ts +++ b/src/locales/default/error.ts @@ -99,6 +99,9 @@ export default { OllamaServiceUnavailable: 'Ollama 服务连接失败,请检查 Ollama 是否运行正常,或是否正确设置 Ollama 的跨域配置', + MinimaxBizError: '请求 Minimax 服务出错,请根据以下信息排查或重试', + InvalidMinimaxAPIKey: 'Minimax API Key 不正确或为空,请检查 Minimax API Key 后重试', + AgentRuntimeError: 'Lobe AI Runtime 执行出错,请根据以下信息排查或重试', /* eslint-enable */ }, diff --git a/src/locales/default/modelProvider.ts b/src/locales/default/modelProvider.ts index 08fdfb46f1c0..5f60d594a483 100644 --- a/src/locales/default/modelProvider.ts +++ b/src/locales/default/modelProvider.ts @@ -97,6 +97,18 @@ export default { title: '使用自定义 Groq API Key', }, }, + minimax: { + title: 'Minimax', + token: { + desc: '填入来自 Minimax 的 API Key', + placeholder: 'Minimax API Key', + title: 'API Key', + }, + unlock: { + description: '输入你的 Minimax API Key 即可开始会话。应用不会记录你的 API Key', + title: '使用自定义 Minimax API Key', + }, + }, mistral: { title: 'Mistral AI', token: { diff --git a/src/migrations/FromV3ToV4/types/v3.ts b/src/migrations/FromV3ToV4/types/v3.ts index f07338b9bbad..b0d2b7eaf026 100644 --- a/src/migrations/FromV3ToV4/types/v3.ts +++ b/src/migrations/FromV3ToV4/types/v3.ts @@ -26,6 +26,7 @@ export interface V3LLMConfig { bedrock: any; google: V3GeneralConfig; groq: V3GeneralConfig; + minimax: V3GeneralConfig; mistral: V3GeneralConfig; moonshot: V3GeneralConfig; ollama: V3LegacyConfig; diff --git a/src/store/user/slices/settings/actions/llm.ts b/src/store/user/slices/settings/actions/llm.ts index 46c9f3ecbb67..8c0a21d275b1 100644 --- a/src/store/user/slices/settings/actions/llm.ts +++ b/src/store/user/slices/settings/actions/llm.ts @@ -7,6 +7,7 @@ import { BedrockProviderCard, GoogleProviderCard, GroqProviderCard, + MinimaxProviderCard, MistralProviderCard, MoonshotProviderCard, OllamaProviderCard, @@ -109,6 +110,7 @@ export const llmSettingsSlice: StateCreator< }, BedrockProviderCard, PerplexityProviderCard, + MinimaxProviderCard, MistralProviderCard, GroqProviderCard, MoonshotProviderCard, diff --git a/src/types/settings/modelProvider.ts b/src/types/settings/modelProvider.ts index 11fad0a64248..98dd9c117539 100644 --- a/src/types/settings/modelProvider.ts +++ b/src/types/settings/modelProvider.ts @@ -46,6 +46,7 @@ export interface GlobalLLMConfig { bedrock: AWSBedrockConfig; google: GeneralModelProviderConfig; groq: GeneralModelProviderConfig; + minimax: GeneralModelProviderConfig; mistral: GeneralModelProviderConfig; moonshot: GeneralModelProviderConfig; ollama: GeneralModelProviderConfig;