diff --git a/Dockerfile b/Dockerfile index d3528c81e582..7efd79cc23a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -168,6 +168,8 @@ ENV \ HUGGINGFACE_API_KEY="" HUGGINGFACE_MODEL_LIST="" HUGGINGFACE_PROXY_URL="" \ # Hunyuan HUNYUAN_API_KEY="" HUNYUAN_MODEL_LIST="" \ + # InternLM + INTERNLM_API_KEY="" INTERNLM_MODEL_LIST="" \ # Minimax MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \ # Mistral diff --git a/Dockerfile.database b/Dockerfile.database index db399992cbdb..371b220ac118 100644 --- a/Dockerfile.database +++ b/Dockerfile.database @@ -212,6 +212,8 @@ ENV \ HUGGINGFACE_API_KEY="" HUGGINGFACE_MODEL_LIST="" HUGGINGFACE_PROXY_URL="" \ # Hunyuan HUNYUAN_API_KEY="" HUNYUAN_MODEL_LIST="" \ + # InternLM + INTERNLM_API_KEY="" INTERNLM_MODEL_LIST="" \ # Minimax MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \ # Mistral diff --git a/locales/ar/error.json b/locales/ar/error.json index ff081c333c62..c05aeb0ef979 100644 --- a/locales/ar/error.json +++ b/locales/ar/error.json @@ -68,6 +68,7 @@ "510": "عذرًا، لا يدعم الخادم الوظائف الإضافية المطلوبة، يرجى الاتصال بالمسؤول", "524": "عذرًا، انتهت مهلة الخادم أثناء الانتظار للرد، قد يكون ذلك بسبب بطء الاستجابة، يرجى المحاولة مرة أخرى لاحقًا", "AgentRuntimeError": "حدث خطأ في تشغيل نموذج Lobe اللغوي، يرجى التحقق من المعلومات التالية أو إعادة المحاولة", + "ConnectionCheckFailed": "الاستجابة فارغة، يرجى التحقق من أن عنوان وكيل الـ API لا ينتهي بـ `/v1`", "FreePlanLimit": "أنت حاليًا مستخدم مجاني، لا يمكنك استخدام هذه الوظيفة، يرجى الترقية إلى خطة مدفوعة للمتابعة", "InvalidAccessCode": "كلمة المرور غير صحيحة أو فارغة، يرجى إدخال كلمة مرور الوصول الصحيحة أو إضافة مفتاح API مخصص", "InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة", diff --git a/locales/bg-BG/error.json b/locales/bg-BG/error.json index aa708609d000..f4ab13e7f245 100644 --- a/locales/bg-BG/error.json +++ b/locales/bg-BG/error.json @@ -68,6 +68,7 @@ "510": "Съжаляваме, сървърът не поддържа исканата разширена функция, моля, свържете се с администратора", "524": "Съжаляваме, сървърът изтече времето за изчакване при очакване на отговор, вероятно поради бавен отговор, моля, опитайте отново по-късно", "AgentRuntimeError": "Грешка при изпълнение на времето за изпълнение на езиковия модел Lobe. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.", + "ConnectionCheckFailed": "Заявката върна празен отговор. Моля, проверете дали адресът на API проксито не завършва с `/v1`.", "FreePlanLimit": "В момента сте потребител на безплатен план и не можете да използвате тази функционалност. Моля, надстройте до платен план, за да продължите да я използвате.", "InvalidAccessCode": "Невалиден или празен код за достъп. Моля, въведете правилния код за достъп или добавете персонализиран API ключ.", "InvalidBedrockCredentials": "Удостоверяването на Bedrock е неуспешно. Моля, проверете AccessKeyId/SecretAccessKey и опитайте отново.", diff --git a/locales/de-DE/error.json b/locales/de-DE/error.json index e76da6fb9e44..c1b09342d4dc 100644 --- a/locales/de-DE/error.json +++ b/locales/de-DE/error.json @@ -68,6 +68,7 @@ "510": "Es tut uns leid, der Server unterstützt die angeforderte Erweiterungsfunktion nicht. Bitte wenden Sie sich an den Administrator.", "524": "Es tut uns leid, der Server hat beim Warten auf eine Antwort die Zeit überschritten, möglicherweise aufgrund einer zu langsamen Antwort. Bitte versuchen Sie es später erneut.", "AgentRuntimeError": "Es ist ein Fehler bei der Ausführung des Lobe-Sprachmodells aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.", + "ConnectionCheckFailed": "Die Anfrage brachte eine leere Antwort zurück. Bitte überprüfen Sie, ob die API-Proxy-Adresse am Ende nicht mit `/v1` endet.", "FreePlanLimit": "Sie sind derzeit ein kostenloser Benutzer und können diese Funktion nicht nutzen. Bitte aktualisieren Sie auf ein kostenpflichtiges Abonnement, um fortzufahren.", "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.", "InvalidBedrockCredentials": "Die Bedrock-Authentifizierung ist fehlgeschlagen. Bitte überprüfen Sie AccessKeyId/SecretAccessKey und versuchen Sie es erneut.", diff --git a/locales/en-US/error.json b/locales/en-US/error.json index 7560d9f353d8..729aae969706 100644 --- a/locales/en-US/error.json +++ b/locales/en-US/error.json @@ -68,6 +68,7 @@ "510": "Sorry, the server does not support the requested extension. Please contact the administrator.", "524": "Sorry, the server timed out while waiting for a response, possibly due to a slow reply. Please try again later.", "AgentRuntimeError": "Lobe language model runtime execution error. Please troubleshoot or retry based on the following information.", + "ConnectionCheckFailed": "The request returned empty. Please check if the API proxy address does not end with `/v1`.", "FreePlanLimit": "You are currently a free user and cannot use this feature. Please upgrade to a paid plan to continue using it.", "InvalidAccessCode": "Invalid access code or empty. Please enter the correct access code or add a custom API Key.", "InvalidBedrockCredentials": "Bedrock authentication failed. Please check the AccessKeyId/SecretAccessKey and retry.", diff --git a/locales/es-ES/error.json b/locales/es-ES/error.json index 04c30ba6a558..cabe5fa732ba 100644 --- a/locales/es-ES/error.json +++ b/locales/es-ES/error.json @@ -68,6 +68,7 @@ "510": "Lo sentimos, el servidor no soporta la funcionalidad de extensión solicitada, por favor contacte al administrador", "524": "Lo sentimos, el servidor ha agotado el tiempo de espera mientras esperaba una respuesta, puede ser debido a que la respuesta es demasiado lenta, por favor inténtelo de nuevo más tarde", "AgentRuntimeError": "Se produjo un error en la ejecución del tiempo de ejecución del modelo de lenguaje Lobe, por favor, verifica la siguiente información o inténtalo de nuevo", + "ConnectionCheckFailed": "La respuesta de la solicitud está vacía, por favor verifica que la dirección del proxy de la API no termine con `/v1`", "FreePlanLimit": "Actualmente eres un usuario gratuito y no puedes utilizar esta función. Por favor, actualiza a un plan de pago para seguir utilizando.", "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", "InvalidBedrockCredentials": "La autenticación de Bedrock no se ha completado con éxito, por favor, verifica AccessKeyId/SecretAccessKey e inténtalo de nuevo", diff --git a/locales/fa-IR/error.json b/locales/fa-IR/error.json index 262fa7c7e296..6b5ab810a8d1 100644 --- a/locales/fa-IR/error.json +++ b/locales/fa-IR/error.json @@ -68,6 +68,7 @@ "510": "متأسفیم، سرور از قابلیت‌های افزوده درخواست پشتیبانی نمی‌کند، لطفاً با مدیر سیستم تماس بگیرید", "524": "متأسفیم، سرور در انتظار پاسخ زمان‌سنجی کرد، ممکن است به دلیل کندی پاسخ باشد، لطفاً بعداً دوباره تلاش کنید", "AgentRuntimeError": "اجرای Lobe AI Runtime با خطا مواجه شد، لطفاً بر اساس اطلاعات زیر بررسی کنید یا دوباره تلاش کنید", + "ConnectionCheckFailed": "درخواست بدون پاسخ برگشت، لطفاً بررسی کنید که آیا آدرس پروکسی API در انتها شامل `/v1` نیست", "FreePlanLimit": "شما در حال حاضر کاربر رایگان هستید و نمی‌توانید از این قابلیت استفاده کنید، لطفاً به یک طرح پولی ارتقا دهید تا ادامه دهید", "InvalidAccessCode": "رمز عبور نادرست یا خالی است، لطفاً رمز عبور صحیح را وارد کنید یا API Key سفارشی اضافه کنید", "InvalidBedrockCredentials": "اعتبارسنجی Bedrock ناموفق بود، لطفاً AccessKeyId/SecretAccessKey را بررسی کرده و دوباره تلاش کنید", diff --git a/locales/fr-FR/error.json b/locales/fr-FR/error.json index 2520f4a284ea..08e3eb0015cc 100644 --- a/locales/fr-FR/error.json +++ b/locales/fr-FR/error.json @@ -68,6 +68,7 @@ "510": "Désolé, le serveur ne prend pas en charge l'extension demandée, veuillez contacter l'administrateur.", "524": "Désolé, le serveur a dépassé le délai d'attente en attendant une réponse, cela peut être dû à une réponse trop lente, veuillez réessayer plus tard.", "AgentRuntimeError": "Erreur d'exécution du modèle linguistique Lobe, veuillez vérifier les informations ci-dessous ou réessayer", + "ConnectionCheckFailed": "La réponse est vide, veuillez vérifier si l'URL du proxy API se termine par `/v1`", "FreePlanLimit": "Vous êtes actuellement un utilisateur gratuit et ne pouvez pas utiliser cette fonction. Veuillez passer à un plan payant pour continuer à l'utiliser.", "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.", "InvalidBedrockCredentials": "L'authentification Bedrock a échoué, veuillez vérifier AccessKeyId/SecretAccessKey et réessayer", diff --git a/locales/it-IT/error.json b/locales/it-IT/error.json index bb9c9f9806f9..072fbb3aeb8b 100644 --- a/locales/it-IT/error.json +++ b/locales/it-IT/error.json @@ -68,6 +68,7 @@ "510": "Ci dispiace, il server non supporta le funzionalità di estensione richieste, contatta l'amministratore", "524": "Ci dispiace, il server ha superato il timeout in attesa di una risposta, potrebbe essere a causa di una risposta troppo lenta, per favore riprova più tardi", "AgentRuntimeError": "Errore di esecuzione del modello linguistico Lobe, controlla le informazioni seguenti o riprova", + "ConnectionCheckFailed": "La risposta è vuota, controlla se l'indirizzo del proxy API termina con `/v1`", "FreePlanLimit": "Attualmente sei un utente gratuito e non puoi utilizzare questa funzione. Per favore, passa a un piano a pagamento per continuare.", "InvalidAccessCode": "Password incorrect or empty, please enter the correct access password, or add a custom API Key", "InvalidBedrockCredentials": "Autenticazione Bedrock non riuscita, controlla AccessKeyId/SecretAccessKey e riprova", diff --git a/locales/ja-JP/error.json b/locales/ja-JP/error.json index 9ca1357f0490..04c7b6bae89d 100644 --- a/locales/ja-JP/error.json +++ b/locales/ja-JP/error.json @@ -68,6 +68,7 @@ "510": "申し訳ありませんが、サーバーはリクエストされた拡張機能をサポートしていません。管理者に連絡してください。", "524": "申し訳ありませんが、サーバーは応答を待っている間にタイムアウトしました。応答が遅すぎる可能性があります。後でもう一度お試しください。", "AgentRuntimeError": "Lobe言語モデルの実行時にエラーが発生しました。以下の情報に基づいてトラブルシューティングを行うか、再試行してください。", + "ConnectionCheckFailed": "リクエストの返答が空です。API プロキシのアドレスの末尾に `/v1` が含まれているか確認してください。", "FreePlanLimit": "現在は無料ユーザーですので、この機能を使用することはできません。有料プランにアップグレードして継続してください。", "InvalidAccessCode": "パスワードが正しくないか空です。正しいアクセスパスワードを入力するか、カスタムAPIキーを追加してください", "InvalidBedrockCredentials": "Bedrockの認証に失敗しました。AccessKeyId/SecretAccessKeyを確認してから再試行してください。", diff --git a/locales/ko-KR/error.json b/locales/ko-KR/error.json index 0c4fe0cb740d..d79695e0ee8f 100644 --- a/locales/ko-KR/error.json +++ b/locales/ko-KR/error.json @@ -68,6 +68,7 @@ "510": "죄송합니다. 서버가 요청된 확장 기능을 지원하지 않습니다. 관리자에게 문의해 주세요.", "524": "죄송합니다. 서버가 응답을 기다리는 동안 시간 초과가 발생했습니다. 응답이 너무 느릴 수 있습니다. 잠시 후 다시 시도해 주세요.", "AgentRuntimeError": "Lobe 언어 모델 실행 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.", + "ConnectionCheckFailed": "요청이 빈 응답으로 돌아왔습니다. API 프록시 주소의 끝에 `/v1`이 포함되어 있는지 확인하세요.", "FreePlanLimit": "현재 무료 사용자이므로이 기능을 사용할 수 없습니다. 유료 요금제로 업그레이드 한 후 계속 사용하십시오.", "InvalidAccessCode": "액세스 코드가 잘못되었거나 비어 있습니다. 올바른 액세스 코드를 입력하거나 사용자 지정 API 키를 추가하십시오.", "InvalidBedrockCredentials": "Bedrock 인증에 실패했습니다. AccessKeyId/SecretAccessKey를 확인한 후 다시 시도하십시오.", diff --git a/locales/nl-NL/error.json b/locales/nl-NL/error.json index 42d87f9081e9..d6d16225f1bd 100644 --- a/locales/nl-NL/error.json +++ b/locales/nl-NL/error.json @@ -68,6 +68,7 @@ "510": "Het spijt ons, de server ondersteunt de gevraagde uitbreidingsfunctie niet, neem contact op met de beheerder", "524": "Het spijt ons, de server heeft een time-out terwijl hij op een antwoord wacht, mogelijk omdat de reactie te traag is, probeer het alstublieft later opnieuw", "AgentRuntimeError": "Lobe language model runtime execution error, please troubleshoot or retry based on the following information", + "ConnectionCheckFailed": "Het verzoek heeft geen antwoord geleverd. Controleer of het API-proxyadres niet eindigt met `/v1`.", "FreePlanLimit": "U bent momenteel een gratis gebruiker en kunt deze functie niet gebruiken. Upgrade naar een betaald plan om door te gaan met gebruiken.", "InvalidAccessCode": "Ongeldige toegangscode: het wachtwoord is onjuist of leeg. Voer de juiste toegangscode in of voeg een aangepaste API-sleutel toe.", "InvalidBedrockCredentials": "Bedrock authentication failed, please check AccessKeyId/SecretAccessKey and retry", diff --git a/locales/pl-PL/error.json b/locales/pl-PL/error.json index 9704e52e2200..0736c484270c 100644 --- a/locales/pl-PL/error.json +++ b/locales/pl-PL/error.json @@ -68,6 +68,7 @@ "510": "Przykro nam, serwer nie obsługuje żądanej funkcji rozszerzenia, proszę skontaktować się z administratorem", "524": "Przykro nam, serwer przekroczył czas oczekiwania na odpowiedź, może to być spowodowane zbyt wolną odpowiedzią, proszę spróbować ponownie później", "AgentRuntimeError": "Wystąpił błąd wykonania modelu językowego Lobe, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.", + "ConnectionCheckFailed": "Odpowiedź jest pusta. Sprawdź, czy na końcu adresu proxy API nie brakuje `/v1`", "FreePlanLimit": "Jesteś obecnie użytkownikiem darmowej wersji, nie możesz korzystać z tej funkcji. Proszę uaktualnić do planu płatnego, aby kontynuować korzystanie.", "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.", "InvalidBedrockCredentials": "Uwierzytelnienie Bedrock nie powiodło się, prosimy sprawdzić AccessKeyId/SecretAccessKey i spróbować ponownie.", diff --git a/locales/pt-BR/error.json b/locales/pt-BR/error.json index 8de662079244..314f66b872ec 100644 --- a/locales/pt-BR/error.json +++ b/locales/pt-BR/error.json @@ -68,6 +68,7 @@ "510": "Desculpe, o servidor não suporta a funcionalidade de extensão solicitada. Por favor, entre em contato com o administrador.", "524": "Desculpe, o servidor excedeu o tempo de espera enquanto aguardava uma resposta, possivelmente devido à lentidão da resposta. Por favor, tente novamente mais tarde.", "AgentRuntimeError": "Erro de execução do modelo de linguagem Lobe, por favor, verifique as informações abaixo ou tente novamente", + "ConnectionCheckFailed": "A resposta da solicitação está vazia. Verifique se o endereço do proxy da API não termina com `/v1`", "FreePlanLimit": "Atualmente, você é um usuário gratuito e não pode usar essa função. Por favor, faça upgrade para um plano pago para continuar usando.", "InvalidAccessCode": "Senha de acesso inválida ou em branco. Por favor, insira a senha de acesso correta ou adicione uma Chave de API personalizada.", "InvalidBedrockCredentials": "Credenciais Bedrock inválidas, por favor, verifique AccessKeyId/SecretAccessKey e tente novamente", diff --git a/locales/ru-RU/error.json b/locales/ru-RU/error.json index f215dacb3b93..d59049042dd0 100644 --- a/locales/ru-RU/error.json +++ b/locales/ru-RU/error.json @@ -68,6 +68,7 @@ "510": "Извините, сервер не поддерживает запрашиваемую расширенную функцию. Пожалуйста, свяжитесь с администратором.", "524": "Извините, сервер превысил время ожидания ответа, возможно, из-за слишком медленного ответа. Пожалуйста, попробуйте позже.", "AgentRuntimeError": "Ошибка выполнения времени выполнения языковой модели Lobe, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией", + "ConnectionCheckFailed": "Запрос вернул пустой ответ, пожалуйста, проверьте, что в конце адреса API-прокси не указано `/v1`", "FreePlanLimit": "Вы являетесь бесплатным пользователем и не можете использовать эту функцию. Пожалуйста, перейдите на платный план для продолжения использования.", "InvalidAccessCode": "Неверный код доступа: введите правильный код доступа или добавьте пользовательский ключ API", "InvalidBedrockCredentials": "Аутентификация Bedrock не прошла, пожалуйста, проверьте AccessKeyId/SecretAccessKey и повторите попытку", diff --git a/locales/tr-TR/error.json b/locales/tr-TR/error.json index d176f1a8449c..d21949de719e 100644 --- a/locales/tr-TR/error.json +++ b/locales/tr-TR/error.json @@ -68,6 +68,7 @@ "510": "Üzgünüm, sunucu isteğinizi genişletme işlevini desteklemiyor, lütfen yöneticinizle iletişime geçin", "524": "Üzgünüm, sunucu yanıt beklerken zaman aşımına uğradı, bu muhtemelen yanıtın çok yavaş olmasından kaynaklanıyor, lütfen daha sonra tekrar deneyin", "AgentRuntimeError": "Lobe dil modeli çalışma zamanı hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin", + "ConnectionCheckFailed": "İstek boş döndü, lütfen API代理地址ının sonuna `/v1` ekleyip eklemediğinizi kontrol edin.", "FreePlanLimit": "Şu anda ücretsiz bir kullanıcısınız, bu özelliği kullanamazsınız. Lütfen devam etmek için bir ücretli plana yükseltin.", "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.", "InvalidBedrockCredentials": "Bedrock kimlik doğrulaması geçersiz, lütfen AccessKeyId/SecretAccessKey bilgilerinizi kontrol edip tekrar deneyin", diff --git a/locales/vi-VN/error.json b/locales/vi-VN/error.json index 7fa18330cb6b..2bf18fc54b67 100644 --- a/locales/vi-VN/error.json +++ b/locales/vi-VN/error.json @@ -68,6 +68,7 @@ "510": "Xin lỗi, máy chủ không hỗ trợ chức năng mở rộng được yêu cầu, vui lòng liên hệ với quản trị viên", "524": "Xin lỗi, máy chủ đã hết thời gian chờ khi đang chờ phản hồi, có thể do phản hồi quá chậm, vui lòng thử lại sau", "AgentRuntimeError": "Lobe mô hình ngôn ngữ thực thi gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây", + "ConnectionCheckFailed": "Yêu cầu trả về trống, xin kiểm tra xem địa chỉ API proxy có đang thiếu `/v1` ở cuối không", "FreePlanLimit": "Hiện tại bạn đang sử dụng tài khoản miễn phí, không thể sử dụng tính năng này. Vui lòng nâng cấp lên gói trả phí để tiếp tục sử dụng.", "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", "InvalidBedrockCredentials": "Xác thực Bedrock không thành công, vui lòng kiểm tra AccessKeyId/SecretAccessKey và thử lại", diff --git a/locales/zh-CN/error.json b/locales/zh-CN/error.json index af8519abc6e6..9aa120ddc202 100644 --- a/locales/zh-CN/error.json +++ b/locales/zh-CN/error.json @@ -98,7 +98,8 @@ "AgentRuntimeError": "Lobe AI Runtime 执行出错,请根据以下信息排查或重试", "FreePlanLimit": "当前为免费用户,无法使用该功能,请升级到付费计划后继续使用", "SubscriptionPlanLimit": "您的订阅额度已用尽,无法使用该功能,请升级到更高计划,或购买资源包后继续使用", - "InvalidGithubToken": "Github PAT 不正确或为空,请检查 Github PAT 后重试" + "InvalidGithubToken": "Github PAT 不正确或为空,请检查 Github PAT 后重试", + "ConnectionCheckFailed": "请求返回为空,请检查 API 代理地址末尾是否未包含 `/v1`" }, "stt": { "responseError": "服务请求失败,请检查配置或重试" diff --git a/locales/zh-TW/error.json b/locales/zh-TW/error.json index 5d9ac609db6e..e4512d56c473 100644 --- a/locales/zh-TW/error.json +++ b/locales/zh-TW/error.json @@ -68,6 +68,7 @@ "510": "很抱歉,伺服器不支援請求的擴展功能,請聯繫管理員", "524": "很抱歉,伺服器在等待回覆時超時,可能是因為回應太慢,請稍後再試", "AgentRuntimeError": "Lobe 語言模型運行時執行出錯,請根據以下信息排查或重試", + "ConnectionCheckFailed": "請求返回為空,請檢查 API 代理地址末尾是否未包含 `/v1`", "FreePlanLimit": "目前為免費用戶,無法使用該功能,請升級到付費計劃後繼續使用", "InvalidAccessCode": "密碼不正確或為空,請輸入正確的訪問密碼,或添加自定義 API 金鑰", "InvalidBedrockCredentials": "Bedrock 驗證未通過,請檢查 AccessKeyId/SecretAccessKey 後重試", diff --git a/package.json b/package.json index 4e3b6e30b181..8fe3e173bfbc 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "@azure/openai": "1.0.0-beta.12", "@baiducloud/qianfan": "^0.1.9", "@bentwnghk/ui": "latest", - "@cfworker/json-schema": "^2.0.1", + "@cfworker/json-schema": "^3.0.0", "@clerk/localizations": "^3.3.0", "@clerk/nextjs": "^5.7.5", "@clerk/themes": "^2.1.37", @@ -302,7 +302,7 @@ "vitest": "~1.2.2", "vitest-canvas-mock": "^0.3.3" }, - "packageManager": "pnpm@9.12.3", + "packageManager": "pnpm@9.13.2", "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org" diff --git a/src/app/(main)/settings/llm/ProviderList/providers.tsx b/src/app/(main)/settings/llm/ProviderList/providers.tsx index d67e56fa1242..f49cdd22cea1 100644 --- a/src/app/(main)/settings/llm/ProviderList/providers.tsx +++ b/src/app/(main)/settings/llm/ProviderList/providers.tsx @@ -10,6 +10,7 @@ import { GoogleProviderCard, GroqProviderCard, HunyuanProviderCard, + InternLMProviderCard, MinimaxProviderCard, MistralProviderCard, MoonshotProviderCard, @@ -85,6 +86,7 @@ export const useProviderList = (): ProviderItem[] => { MinimaxProviderCard, Ai360ProviderCard, TaichuProviderCard, + InternLMProviderCard, SiliconCloudProviderCard, ], [ diff --git a/src/app/(main)/settings/llm/components/Checker.tsx b/src/app/(main)/settings/llm/components/Checker.tsx index 5d2ca7ca417b..e80c381b1479 100644 --- a/src/app/(main)/settings/llm/components/Checker.tsx +++ b/src/app/(main)/settings/llm/components/Checker.tsx @@ -60,10 +60,17 @@ const Checker = memo(({ model, provider }) => { setPass(false); isError = true; }, - onFinish: async () => { - if (!isError) { + onFinish: async (value) => { + if (!isError && value) { setError(undefined); setPass(true); + } else { + setPass(false); + setError({ + body: value, + message: t('response.ConnectionCheckFailed', { ns: 'error' }), + type: 'ConnectionCheckFailed', + }); } }, onLoadingChange: (loading) => { diff --git a/src/config/llm.ts b/src/config/llm.ts index 0d34d4f8da1d..4c9a831d4843 100644 --- a/src/config/llm.ts +++ b/src/config/llm.ts @@ -124,6 +124,9 @@ export const getLLMConfig = () => { ENABLED_XAI: z.boolean(), XAI_API_KEY: z.string().optional(), + + ENABLED_INTERNLM: z.boolean(), + INTERNLM_API_KEY: z.string().optional(), }, runtimeEnv: { API_KEY_SELECT_MODE: process.env.API_KEY_SELECT_MODE, @@ -246,6 +249,9 @@ export const getLLMConfig = () => { ENABLED_XAI: !!process.env.XAI_API_KEY, XAI_API_KEY: process.env.XAI_API_KEY, + + ENABLED_INTERNLM: !!process.env.INTERNLM_API_KEY, + INTERNLM_API_KEY: process.env.INTERNLM_API_KEY, }, }); }; diff --git a/src/config/modelProviders/index.ts b/src/config/modelProviders/index.ts index 3fa1e590c1e5..c79ee701497f 100644 --- a/src/config/modelProviders/index.ts +++ b/src/config/modelProviders/index.ts @@ -14,6 +14,7 @@ import GoogleProvider from './google'; import GroqProvider from './groq'; import HuggingFaceProvider from './huggingface'; import HunyuanProvider from './hunyuan'; +import InternLMProvider from './internlm'; import MinimaxProvider from './minimax'; import MistralProvider from './mistral'; import MoonshotProvider from './moonshot'; @@ -69,6 +70,7 @@ export const LOBE_DEFAULT_MODEL_LIST: ChatModelCard[] = [ HunyuanProvider.chatModels, WenxinProvider.chatModels, SenseNovaProvider.chatModels, + InternLMProvider.chatModels, ].flat(); export const DEFAULT_MODEL_PROVIDER_LIST = [ @@ -105,6 +107,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [ MinimaxProvider, Ai360Provider, TaichuProvider, + InternLMProvider, SiliconCloudProvider, ]; @@ -131,6 +134,7 @@ export { default as GoogleProviderCard } from './google'; export { default as GroqProviderCard } from './groq'; export { default as HuggingFaceProviderCard } from './huggingface'; export { default as HunyuanProviderCard } from './hunyuan'; +export { default as InternLMProviderCard } from './internlm'; export { default as MinimaxProviderCard } from './minimax'; export { default as MistralProviderCard } from './mistral'; export { default as MoonshotProviderCard } from './moonshot'; diff --git a/src/config/modelProviders/internlm.ts b/src/config/modelProviders/internlm.ts new file mode 100644 index 000000000000..07e07117ea47 --- /dev/null +++ b/src/config/modelProviders/internlm.ts @@ -0,0 +1,42 @@ +import { ModelProviderCard } from '@/types/llm'; + +const InternLM: ModelProviderCard = { + chatModels: [ + { + description: '我们最新的模型系列,有着卓越的推理性能,支持 1M 的上下文长度以及更强的指令跟随和工具调用能力。', + displayName: 'InternLM2.5', + enabled: true, + functionCall: true, + id: 'internlm2.5-latest', + maxOutput: 4096, + pricing: { + input: 0, + output: 0, + }, + tokens: 32_768, + }, + { + description: '我们仍在维护的老版本模型,有 7B、20B 多种模型参数量可选。', + displayName: 'InternLM2 Pro Chat', + functionCall: true, + id: 'internlm2-pro-chat', + maxOutput: 4096, + pricing: { + input: 0, + output: 0, + }, + tokens: 32_768, + }, + ], + checkModel: 'internlm2.5-latest', + description: + '致力于大模型研究与开发工具链的开源组织。为所有 AI 开发者提供高效、易用的开源平台,让最前沿的大模型与算法技术触手可及', + disableBrowserRequest: true, + id: 'internlm', + modelList: { showModelFetcher: true }, + modelsUrl: 'https://internlm.intern-ai.org.cn/doc/docs/Models#%E8%8E%B7%E5%8F%96%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8', + name: 'InternLM', + url: 'https://internlm.intern-ai.org.cn', +}; + +export default InternLM; diff --git a/src/database/server/models/__tests__/session.test.ts b/src/database/server/models/__tests__/session.test.ts index 4d128e5be37e..0a91adb6f7f8 100644 --- a/src/database/server/models/__tests__/session.test.ts +++ b/src/database/server/models/__tests__/session.test.ts @@ -231,8 +231,18 @@ describe('SessionModel', () => { it('should return sessions with matching title', async () => { await serverDB.insert(sessions).values([ - { id: '1', userId, title: 'Hello World', description: 'Some description' }, - { id: '2', userId, title: 'Another Session', description: 'Another description' }, + { id: '1', userId }, + { id: '2', userId }, + ]); + + await serverDB.insert(agents).values([ + { id: 'agent-1', userId, model: 'gpt-3.5-turbo', title: 'Hello, Agent 1' }, + { id: 'agent-2', userId, model: 'gpt-4', title: 'Agent 2' }, + ]); + + await serverDB.insert(agentsToSessions).values([ + { agentId: 'agent-1', sessionId: '1' }, + { agentId: 'agent-2', sessionId: '2' }, ]); const result = await sessionModel.queryByKeyword('hello'); @@ -241,9 +251,21 @@ describe('SessionModel', () => { }); it('should return sessions with matching description', async () => { + // The sessions has no title and desc, + // see: https://github.com/lobehub/lobe-chat/pull/4725 await serverDB.insert(sessions).values([ - { id: '1', userId, title: 'Session 1', description: 'Description with keyword' }, - { id: '2', userId, title: 'Session 2', description: 'Another description' }, + { id: '1', userId }, + { id: '2', userId }, + ]); + + await serverDB.insert(agents).values([ + { id: 'agent-1', userId, model: 'gpt-3.5-turbo', title: 'Agent 1', description: 'Description with Keyword' }, + { id: 'agent-2', userId, model: 'gpt-4', title: 'Agent 2' }, + ]); + + await serverDB.insert(agentsToSessions).values([ + { agentId: 'agent-1', sessionId: '1' }, + { agentId: 'agent-2', sessionId: '2' }, ]); const result = await sessionModel.queryByKeyword('keyword'); @@ -253,11 +275,23 @@ describe('SessionModel', () => { it('should return sessions with matching title or description', async () => { await serverDB.insert(sessions).values([ + { id: '1', userId }, + { id: '2', userId }, + { id: '3', userId }, + ]); + + await serverDB.insert(agents).values([ { id: '1', userId, title: 'Title with keyword', description: 'Some description' }, { id: '2', userId, title: 'Another Session', description: 'Description with keyword' }, { id: '3', userId, title: 'Third Session', description: 'Third description' }, ]); + await serverDB.insert(agentsToSessions).values([ + { agentId: '1', sessionId: '1' }, + { agentId: '2', sessionId: '2' }, + { agentId: '3', sessionId: '3' }, + ]); + const result = await sessionModel.queryByKeyword('keyword'); expect(result).toHaveLength(2); expect(result.map((s) => s.id)).toEqual(['1', '2']); diff --git a/src/database/server/models/session.ts b/src/database/server/models/session.ts index 136104da2ead..01d4bb287d86 100644 --- a/src/database/server/models/session.ts +++ b/src/database/server/models/session.ts @@ -61,7 +61,7 @@ export class SessionModel { const keywordLowerCase = keyword.toLowerCase(); - const data = await this.findSessions({ keyword: keywordLowerCase }); + const data = await this.findSessionsByKeywords({ keyword: keywordLowerCase }); return data.map((item) => this.mapSessionItem(item as any)); } @@ -281,15 +281,15 @@ export class SessionModel { pinned !== undefined ? eq(sessions.pinned, pinned) : eq(sessions.userId, this.userId), keyword ? or( - like( - sql`lower(${sessions.title})` as unknown as Column, - `%${keyword.toLowerCase()}%`, - ), - like( - sql`lower(${sessions.description})` as unknown as Column, - `%${keyword.toLowerCase()}%`, - ), - ) + like( + sql`lower(${sessions.title})` as unknown as Column, + `%${keyword.toLowerCase()}%`, + ), + like( + sql`lower(${sessions.description})` as unknown as Column, + `%${keyword.toLowerCase()}%`, + ), + ) : eq(sessions.userId, this.userId), group ? eq(sessions.groupId, group) : isNull(sessions.groupId), ), @@ -297,4 +297,37 @@ export class SessionModel { with: { agentsToSessions: { columns: {}, with: { agent: true } }, group: true }, }); } + + async findSessionsByKeywords(params: { + current?: number; + keyword: string; + pageSize?: number; + }) { + const { keyword, pageSize = 9999, current = 0 } = params; + const offset = current * pageSize; + const results = await serverDB.query.agents.findMany({ + limit: pageSize, + offset, + orderBy: [desc(agents.updatedAt)], + where: and( + eq(agents.userId, this.userId), + or( + like( + sql`lower(${agents.title})` as unknown as Column, + `%${keyword.toLowerCase()}%`, + ), + like( + sql`lower(${agents.description})` as unknown as Column, + `%${keyword.toLowerCase()}%`, + ), + ) + ), + with: { agentsToSessions: { columns: {}, with: { session: true } } }, + }); + try { + // @ts-expect-error + return results.map((item) => item.agentsToSessions[0].session); + } catch {} + return [] + } } diff --git a/src/database/server/models/topic.ts b/src/database/server/models/topic.ts index 7dac6002baf3..128bd2d801aa 100644 --- a/src/database/server/models/topic.ts +++ b/src/database/server/models/topic.ts @@ -85,7 +85,12 @@ export class TopicModel { serverDB .select() .from(messages) - .where(and(eq(messages.topicId, topics.id), or(matchKeyword(messages.content)))), + .where( + and( + eq(messages.topicId, topics.id), + matchKeyword(messages.content) + ) + ), ), ), ), diff --git a/src/libs/agent-runtime/AgentRuntime.ts b/src/libs/agent-runtime/AgentRuntime.ts index 7f54ec1abd8e..8ee4a61b2d62 100644 --- a/src/libs/agent-runtime/AgentRuntime.ts +++ b/src/libs/agent-runtime/AgentRuntime.ts @@ -17,6 +17,7 @@ import { LobeGoogleAI } from './google'; import { LobeGroq } from './groq'; import { LobeHuggingFaceAI } from './huggingface'; import { LobeHunyuanAI } from './hunyuan'; +import { LobeInternLMAI } from './internlm'; import { LobeMinimaxAI } from './minimax'; import { LobeMistralAI } from './mistral'; import { LobeMoonshotAI } from './moonshot'; @@ -141,6 +142,7 @@ class AgentRuntime { groq: Partial; huggingface: { apiKey?: string; baseURL?: string }; hunyuan: Partial; + internlm: Partial; minimax: Partial; mistral: Partial; moonshot: Partial; @@ -335,6 +337,11 @@ class AgentRuntime { runtimeModel = new LobeCloudflareAI(params.cloudflare ?? {}); break; } + + case ModelProvider.InternLM: { + runtimeModel = new LobeInternLMAI(params.internlm); + break; + } } return new AgentRuntime(runtimeModel); } diff --git a/src/libs/agent-runtime/error.ts b/src/libs/agent-runtime/error.ts index f0f736e3bbf1..5e0d7069eb89 100644 --- a/src/libs/agent-runtime/error.ts +++ b/src/libs/agent-runtime/error.ts @@ -17,6 +17,8 @@ export const AgentRuntimeErrorType = { InvalidGithubToken: 'InvalidGithubToken', + ConnectionCheckFailed: 'ConnectionCheckFailed', + /** * @deprecated */ diff --git a/src/libs/agent-runtime/github/index.ts b/src/libs/agent-runtime/github/index.ts index fd7fa6f280bc..2612bc6fe697 100644 --- a/src/libs/agent-runtime/github/index.ts +++ b/src/libs/agent-runtime/github/index.ts @@ -10,7 +10,7 @@ export const LobeGithubAI = LobeOpenAICompatibleFactory({ const { model } = payload; if (o1Models.has(model)) { - return pruneO1Payload(payload) as any; + return { ...pruneO1Payload(payload), stream: false } as any; } return { ...payload, stream: payload.stream ?? true }; diff --git a/src/libs/agent-runtime/internlm/index.test.ts b/src/libs/agent-runtime/internlm/index.test.ts new file mode 100644 index 000000000000..73925e4ed1f8 --- /dev/null +++ b/src/libs/agent-runtime/internlm/index.test.ts @@ -0,0 +1,255 @@ +// @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 { LobeInternLMAI } from './index'; + +const provider = ModelProvider.InternLM; +const defaultBaseURL = 'https://internlm-chat.intern-ai.org.cn/puyu/api/v1'; + +const bizErrorType = 'ProviderBizError'; +const invalidErrorType = 'InvalidProviderAPIKey'; + +// Mock the console.error to avoid polluting test output +vi.spyOn(console, 'error').mockImplementation(() => {}); + +let instance: LobeOpenAICompatibleRuntime; + +beforeEach(() => { + instance = new LobeInternLMAI({ apiKey: 'test' }); + + // 使用 vi.spyOn 来模拟 chat.completions.create 方法 + vi.spyOn(instance['client'].chat.completions, 'create').mockResolvedValue( + new ReadableStream() as any, + ); +}); + +afterEach(() => { + vi.clearAllMocks(); +}); + +describe('LobeInternLMAI', () => { + describe('init', () => { + it('should correctly initialize with an API key', async () => { + const instance = new LobeInternLMAI({ apiKey: 'test_api_key' }); + expect(instance).toBeInstanceOf(LobeInternLMAI); + 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: 'internlm2.5-latest', + 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 LobeInternLMAI({}); + } 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: 'internlm2.5-latest', + 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 LobeInternLMAI({ + 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: 'internlm2.5-latest', + 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 InvalidInternLMAIAPIKey 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: 'internlm2.5-latest', + temperature: 0, + }); + } catch (e) { + // Expect the chat method to throw an error with InvalidInternLMAIAPIKey + 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: 'internlm2.5-latest', + 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_INTERNLM_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_INTERNLM_CHAT_COMPLETION; + + // 模拟环境变量 + process.env.DEBUG_INTERNLM_CHAT_COMPLETION = '1'; + vi.spyOn(debugStreamModule, 'debugStream').mockImplementation(() => Promise.resolve()); + + // 执行测试 + // 运行你的测试函数,确保它会在条件满足时调用 debugStream + // 假设的测试函数调用,你可能需要根据实际情况调整 + await instance.chat({ + messages: [{ content: 'Hello', role: 'user' }], + model: 'internlm2.5-latest', + stream: true, + temperature: 0, + }); + + // 验证 debugStream 被调用 + expect(debugStreamModule.debugStream).toHaveBeenCalled(); + + // 恢复原始环境变量值 + process.env.DEBUG_INTERNLM_CHAT_COMPLETION = originalDebugValue; + }); + }); + }); +}); diff --git a/src/libs/agent-runtime/internlm/index.ts b/src/libs/agent-runtime/internlm/index.ts new file mode 100644 index 000000000000..3dfaf0edda41 --- /dev/null +++ b/src/libs/agent-runtime/internlm/index.ts @@ -0,0 +1,18 @@ +import { ModelProvider } from '../types'; +import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory'; + +export const LobeInternLMAI = LobeOpenAICompatibleFactory({ + baseURL: 'https://internlm-chat.intern-ai.org.cn/puyu/api/v1', + chatCompletion: { + handlePayload: (payload) => { + return { + ...payload, + stream: !payload.tools, + } as any; + }, + }, + debug: { + chatCompletion: () => process.env.DEBUG_INTERNLM_CHAT_COMPLETION === '1', + }, + provider: ModelProvider.InternLM, +}); diff --git a/src/libs/agent-runtime/openai/index.ts b/src/libs/agent-runtime/openai/index.ts index d4d718df4b49..9c42965cce07 100644 --- a/src/libs/agent-runtime/openai/index.ts +++ b/src/libs/agent-runtime/openai/index.ts @@ -17,7 +17,6 @@ export const pruneO1Payload = (payload: ChatStreamPayload) => ({ role: message.role === 'system' ? 'user' : message.role, })), presence_penalty: 0, - stream: false, temperature: 1, top_p: 1, }); diff --git a/src/libs/agent-runtime/types/type.ts b/src/libs/agent-runtime/types/type.ts index 5a00cbc3dd9c..6629f2bf9920 100644 --- a/src/libs/agent-runtime/types/type.ts +++ b/src/libs/agent-runtime/types/type.ts @@ -36,6 +36,7 @@ export enum ModelProvider { Groq = 'groq', HuggingFace = 'huggingface', Hunyuan = 'hunyuan', + InternLM = 'internlm', Minimax = 'minimax', Mistral = 'mistral', Moonshot = 'moonshot', diff --git a/src/locales/default/error.ts b/src/locales/default/error.ts index 6fb898860742..62f4eee58a58 100644 --- a/src/locales/default/error.ts +++ b/src/locales/default/error.ts @@ -124,6 +124,7 @@ export default { // Github Token InvalidGithubToken: 'Github PAT 不正确或为空,请检查 Github PAT 后重试', + ConnectionCheckFailed: '请求返回为空,请检查 API 代理地址末尾是否未包含 `/v1`', /* eslint-enable */ }, diff --git a/src/server/modules/AgentRuntime/index.ts b/src/server/modules/AgentRuntime/index.ts index 6d2ead94a01a..8134bed5c7a2 100644 --- a/src/server/modules/AgentRuntime/index.ts +++ b/src/server/modules/AgentRuntime/index.ts @@ -293,6 +293,13 @@ const getLlmOptionsFromPayload = (provider: string, payload: JWTPayload) => { const apiKey = apiKeyManager.pick(payload?.apiKey || XAI_API_KEY); + return { apiKey }; + } + case ModelProvider.InternLM: { + const { INTERNLM_API_KEY } = getLLMConfig(); + + const apiKey = apiKeyManager.pick(payload?.apiKey || INTERNLM_API_KEY); + return { apiKey }; } } diff --git a/src/store/chat/slices/topic/selectors.ts b/src/store/chat/slices/topic/selectors.ts index a05d4deba710..07d54dcf535d 100644 --- a/src/store/chat/slices/topic/selectors.ts +++ b/src/store/chat/slices/topic/selectors.ts @@ -42,7 +42,7 @@ const currentActiveTopicSummary = (s: ChatStoreState): ChatTopicSummary | undefi const isCreatingTopic = (s: ChatStoreState) => s.creatingTopic; const groupedTopicsSelector = (s: ChatStoreState): GroupedTopic[] => { - const topics = currentTopics(s); + const topics = displayTopics(s); if (!topics) return []; const favTopics = currentFavTopics(s); diff --git a/src/types/user/settings/keyVaults.ts b/src/types/user/settings/keyVaults.ts index dec9a9c1ab7c..492cf7449834 100644 --- a/src/types/user/settings/keyVaults.ts +++ b/src/types/user/settings/keyVaults.ts @@ -46,6 +46,7 @@ export interface UserKeyVaults { groq?: OpenAICompatibleKeyVault; huggingface?: OpenAICompatibleKeyVault; hunyuan?: OpenAICompatibleKeyVault; + internlm?: OpenAICompatibleKeyVault; lobehub?: any; minimax?: OpenAICompatibleKeyVault; mistral?: OpenAICompatibleKeyVault;