@lobehub/chat 0.158.2 → 0.159.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/.env.example +4 -0
  2. package/CHANGELOG.md +58 -0
  3. package/Dockerfile +3 -0
  4. package/README.md +1 -0
  5. package/README.zh-CN.md +1 -0
  6. package/docs/self-hosting/advanced/authentication.mdx +9 -0
  7. package/docs/self-hosting/advanced/authentication.zh-CN.mdx +9 -0
  8. package/docs/self-hosting/environment-variables/model-provider.mdx +16 -7
  9. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +16 -7
  10. package/docs/usage/features/multi-ai-providers.mdx +1 -0
  11. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +1 -0
  12. package/locales/ar/error.json +2 -0
  13. package/locales/ar/modelProvider.json +12 -0
  14. package/locales/bg-BG/error.json +2 -0
  15. package/locales/bg-BG/modelProvider.json +12 -0
  16. package/locales/de-DE/error.json +2 -0
  17. package/locales/de-DE/modelProvider.json +12 -0
  18. package/locales/en-US/error.json +2 -0
  19. package/locales/en-US/modelProvider.json +12 -0
  20. package/locales/es-ES/error.json +2 -0
  21. package/locales/es-ES/modelProvider.json +12 -0
  22. package/locales/fr-FR/error.json +2 -0
  23. package/locales/fr-FR/modelProvider.json +12 -0
  24. package/locales/it-IT/error.json +2 -0
  25. package/locales/it-IT/modelProvider.json +12 -0
  26. package/locales/ja-JP/error.json +2 -0
  27. package/locales/ja-JP/modelProvider.json +12 -0
  28. package/locales/ko-KR/error.json +2 -0
  29. package/locales/ko-KR/modelProvider.json +12 -0
  30. package/locales/nl-NL/error.json +2 -0
  31. package/locales/nl-NL/modelProvider.json +12 -0
  32. package/locales/pl-PL/error.json +2 -0
  33. package/locales/pl-PL/modelProvider.json +12 -0
  34. package/locales/pt-BR/error.json +2 -0
  35. package/locales/pt-BR/modelProvider.json +12 -0
  36. package/locales/ru-RU/error.json +2 -0
  37. package/locales/ru-RU/modelProvider.json +12 -0
  38. package/locales/tr-TR/error.json +2 -0
  39. package/locales/tr-TR/modelProvider.json +12 -0
  40. package/locales/vi-VN/error.json +2 -0
  41. package/locales/vi-VN/modelProvider.json +12 -0
  42. package/locales/zh-CN/error.json +2 -0
  43. package/locales/zh-CN/modelProvider.json +12 -0
  44. package/locales/zh-TW/error.json +2 -0
  45. package/locales/zh-TW/modelProvider.json +12 -0
  46. package/package.json +2 -2
  47. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +13 -15
  48. package/src/app/(main)/settings/common/features/Common.tsx +11 -8
  49. package/src/app/(main)/settings/common/index.tsx +1 -9
  50. package/src/app/(main)/settings/llm/DeepSeek/index.tsx +21 -0
  51. package/src/app/(main)/settings/llm/index.tsx +2 -0
  52. package/src/app/api/chat/agentRuntime.test.ts +17 -0
  53. package/src/app/api/chat/agentRuntime.ts +5 -0
  54. package/src/app/api/errorResponse.test.ts +6 -0
  55. package/src/app/api/errorResponse.ts +3 -0
  56. package/src/components/ModelIcon/index.tsx +2 -0
  57. package/src/components/ModelProviderIcon/index.tsx +5 -0
  58. package/src/components/ModelTag/ModelIcon.tsx +2 -0
  59. package/src/config/modelProviders/deepseek.ts +23 -0
  60. package/src/config/modelProviders/index.ts +4 -0
  61. package/src/config/server/provider.ts +10 -0
  62. package/src/const/settings/index.ts +6 -0
  63. package/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx +5 -0
  64. package/src/features/Conversation/Error/APIKeyForm/index.tsx +4 -0
  65. package/src/features/Conversation/Error/OAuthForm.tsx +6 -4
  66. package/src/features/Conversation/Error/index.tsx +1 -0
  67. package/src/features/User/__tests__/UserAvatar.test.tsx +8 -3
  68. package/src/features/User/__tests__/useMenu.test.tsx +3 -3
  69. package/src/libs/agent-runtime/AgentRuntime.ts +7 -0
  70. package/src/libs/agent-runtime/deepseek/index.test.ts +254 -0
  71. package/src/libs/agent-runtime/deepseek/index.ts +15 -0
  72. package/src/libs/agent-runtime/error.ts +3 -0
  73. package/src/libs/agent-runtime/index.ts +1 -0
  74. package/src/libs/agent-runtime/types/type.ts +1 -0
  75. package/src/libs/next-auth/index.ts +0 -7
  76. package/src/locales/default/error.ts +3 -0
  77. package/src/locales/default/modelProvider.ts +12 -0
  78. package/src/migrations/FromV3ToV4/types/v3.ts +0 -8
  79. package/src/server/globalConfig/index.ts +4 -0
  80. package/src/services/__tests__/chat.test.ts +16 -0
  81. package/src/services/chat.ts +3 -0
  82. package/src/store/serverConfig/selectors.ts +1 -0
  83. package/src/store/user/slices/auth/action.test.ts +61 -0
  84. package/src/store/user/slices/auth/action.ts +17 -15
  85. package/src/store/user/slices/auth/selectors.test.ts +18 -2
  86. package/src/store/user/slices/auth/selectors.ts +4 -4
  87. package/src/store/user/slices/settings/actions/llm.ts +2 -0
  88. package/src/types/next-auth.d.ts +23 -0
  89. package/src/types/serverConfig.ts +1 -0
  90. package/src/types/settings/modelProvider.ts +1 -0
  91. package/src/hooks/useOAuthSession.ts +0 -24
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Anthropic AI 서비스 요청 중 오류가 발생했습니다. 다음 정보를 확인하고 다시 시도하십시오.",
56
56
  "AzureBizError": "Azure AI 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.",
57
57
  "BedrockBizError": "Bedrock 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.",
58
+ "DeepSeekBizError": "DeepSeek 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.",
58
59
  "GoogleBizError": "Google 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도하십시오.",
59
60
  "GroqBizError": "Groq 서비스 요청 중 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도해주세요.",
60
61
  "InvalidAccessCode": "액세스 코드가 잘못되었거나 비어 있습니다. 올바른 액세스 코드를 입력하거나 사용자 지정 API 키를 추가하십시오.",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "잘못된 또는 비어 있는 Azure API Key입니다. Azure API Key를 확인한 후 다시 시도하십시오.",
63
64
  "InvalidBedrockCredentials": "Bedrock 인증에 실패했습니다. AccessKeyId/SecretAccessKey를 확인한 후 다시 시도하십시오.",
64
65
  "InvalidClerkUser": "죄송합니다. 현재 로그인되어 있지 않습니다. 계속하려면 먼저 로그인하거나 계정을 등록해주세요.",
66
+ "InvalidDeepSeekAPIKey": "DeepSeek API 키가 잘못되었거나 비어 있습니다. DeepSeek API 키를 확인한 후 다시 시도하십시오.",
65
67
  "InvalidGoogleAPIKey": "잘못된 또는 비어 있는 Google API Key입니다. Google API Key를 확인한 후 다시 시도하십시오.",
66
68
  "InvalidGroqAPIKey": "잘못된 또는 비어 있는 Groq API Key입니다. Groq API Key를 확인한 후 다시 시도하십시오.",
67
69
  "InvalidMinimaxAPIKey": "잘못된 Minimax API 키이거나 비어 있습니다. Minimax API 키를 확인한 후 다시 시도해주세요.",
@@ -61,6 +61,18 @@
61
61
  "title": "사용자 정의 Bedrock 인증 정보 사용"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "DeepSeek의 API 키를 입력하세요",
68
+ "placeholder": "DeepSeek API 키",
69
+ "title": "API 키"
70
+ },
71
+ "unlock": {
72
+ "description": "DeepSeek API 키를 입력하면 세션을 시작할 수 있습니다. 애플리케이션은 API 키를 기록하지 않습니다.",
73
+ "title": "사용자 정의 DeepSeek API 키 사용"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Er is een fout opgetreden bij het aanvragen van de Anthropic AI-service. Controleer de onderstaande informatie en probeer het opnieuw.",
56
56
  "AzureBizError": "Error requesting Azure AI service, please troubleshoot or retry based on the following information",
57
57
  "BedrockBizError": "Error requesting Bedrock service, please troubleshoot or retry based on the following information",
58
+ "DeepSeekBizError": "Er is een fout opgetreden bij het aanvragen van de DeepSeek-service. Controleer de volgende informatie en probeer het opnieuw.",
58
59
  "GoogleBizError": "Error requesting Google service, please troubleshoot or retry based on the following information",
59
60
  "GroqBizError": "Er is een fout opgetreden bij het aanroepen van de Groq-service. Controleer de onderstaande informatie of probeer het opnieuw.",
60
61
  "InvalidAccessCode": "Ongeldige toegangscode: het wachtwoord is onjuist of leeg. Voer de juiste toegangscode in of voeg een aangepaste API-sleutel toe.",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Incorrect or empty Azure API Key, please check the Azure API Key and retry",
63
64
  "InvalidBedrockCredentials": "Bedrock authentication failed, please check AccessKeyId/SecretAccessKey and retry",
64
65
  "InvalidClerkUser": "Sorry, you are not currently logged in. Please log in or register an account to continue.",
66
+ "InvalidDeepSeekAPIKey": "DeepSeek API-sleutel is onjuist of leeg. Controleer de DeepSeek API-sleutel en probeer het opnieuw.",
65
67
  "InvalidGoogleAPIKey": "Incorrect or empty Google API Key, please check the Google API Key and retry",
66
68
  "InvalidGroqAPIKey": "Groq API Key is onjuist of leeg. Controleer de Groq API Key en probeer het opnieuw.",
67
69
  "InvalidMinimaxAPIKey": "Ongeldige of lege Minimax API-sleutel. Controleer de Minimax API-sleutel en probeer het opnieuw.",
@@ -61,6 +61,18 @@
61
61
  "title": "Gebruik aangepaste Bedrock-verificatiegegevens"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "Fill in your API Key from DeepSeek",
68
+ "placeholder": "DeepSeek API Key",
69
+ "title": "API Key"
70
+ },
71
+ "unlock": {
72
+ "description": "Enter your DeepSeek API Key to start the session. The app will not store your API Key.",
73
+ "title": "Use Custom DeepSeek API Key"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Wystąpił błąd biznesowy podczas żądania usługi Anthropic AI. Sprawdź poniższe informacje i spróbuj ponownie.",
56
56
  "AzureBizError": "Wystąpił błąd żądania usługi Azure AI, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.",
57
57
  "BedrockBizError": "Wystąpił błąd żądania usługi Bedrock, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.",
58
+ "DeepSeekBizError": "Błąd biznesowy podczas żądania usługi DeepSeek. Sprawdź poniższe informacje lub spróbuj ponownie.",
58
59
  "GoogleBizError": "Wystąpił błąd żądania usługi Google, prosimy o sprawdzenie poniższych informacji lub ponowne próbowanie.",
59
60
  "GroqBizError": "Wystąpił błąd usługi Groq. Sprawdź poniższe informacje lub spróbuj ponownie.",
60
61
  "InvalidAccessCode": "Nieprawidłowy kod dostępu: Hasło jest nieprawidłowe lub puste. Proszę wprowadzić poprawne hasło dostępu lub dodać niestandardowy klucz API.",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Nieprawidłowy lub pusty klucz API Azure, prosimy sprawdzić klucz API Azure i spróbować ponownie.",
63
64
  "InvalidBedrockCredentials": "Uwierzytelnienie Bedrock nie powiodło się, prosimy sprawdzić AccessKeyId/SecretAccessKey i spróbować ponownie.",
64
65
  "InvalidClerkUser": "Przepraszamy, nie jesteś obecnie zalogowany. Proszę najpierw zalogować się lub zarejestrować, aby kontynuować.",
66
+ "InvalidDeepSeekAPIKey": "Klucz API DeepSeek jest nieprawidłowy lub pusty. Sprawdź klucz API DeepSeek i spróbuj ponownie.",
65
67
  "InvalidGoogleAPIKey": "Nieprawidłowy lub pusty klucz API Google, prosimy sprawdzić klucz API Google i spróbować ponownie.",
66
68
  "InvalidGroqAPIKey": "Nieprawidłowy klucz API Groq, prosimy sprawdzić klucz API Groq i spróbować ponownie.",
67
69
  "InvalidMinimaxAPIKey": "Nieprawidłowy lub pusty klucz API Minimax, proszę sprawdzić klucz API Minimax i spróbować ponownie",
@@ -61,6 +61,18 @@
61
61
  "title": "Użyj niestandardowych informacji uwierzytelniających Bedrock"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "Wprowadź klucz API DeepSeek",
68
+ "placeholder": "Klucz API DeepSeek",
69
+ "title": "Klucz API"
70
+ },
71
+ "unlock": {
72
+ "description": "Wprowadź swój klucz API DeepSeek, aby rozpocząć sesję. Aplikacja nie zapisuje Twojego klucza API.",
73
+ "title": "Użyj niestandardowego klucza API DeepSeek"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Erro de negócios ao solicitar o serviço Anthropic AI. Por favor, verifique as informações abaixo ou tente novamente.",
56
56
  "AzureBizError": "Erro ao solicitar o serviço Azure AI, por favor, verifique as informações abaixo ou tente novamente",
57
57
  "BedrockBizError": "Erro ao solicitar o serviço Bedrock, por favor, verifique as informações abaixo ou tente novamente",
58
+ "DeepSeekBizError": "Erro de negócio ao solicitar o serviço DeepSeek, por favor, verifique as informações abaixo ou tente novamente",
58
59
  "GoogleBizError": "Erro ao solicitar o serviço Google, por favor, verifique as informações abaixo ou tente novamente",
59
60
  "GroqBizError": "O serviço Groq encontrou um erro. Por favor, verifique as informações abaixo ou tente novamente.",
60
61
  "InvalidAccessCode": "Senha de acesso inválida ou em branco. Por favor, insira a senha de acesso correta ou adicione uma Chave de API personalizada.",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Chave de API Azure incorreta ou vazia, por favor, verifique a chave de API Azure e tente novamente",
63
64
  "InvalidBedrockCredentials": "Credenciais Bedrock inválidas, por favor, verifique AccessKeyId/SecretAccessKey e tente novamente",
64
65
  "InvalidClerkUser": "Desculpe, você ainda não fez login. Por favor, faça login ou registre uma conta antes de continuar.",
66
+ "InvalidDeepSeekAPIKey": "Chave da API DeepSeek inválida ou em branco, por favor, verifique a chave da API DeepSeek e tente novamente",
65
67
  "InvalidGoogleAPIKey": "Chave de API Google incorreta ou vazia, por favor, verifique a chave de API Google e tente novamente",
66
68
  "InvalidGroqAPIKey": "Chave de API Groq AI inválida ou em branco, verifique a chave de API Groq e tente novamente",
67
69
  "InvalidMinimaxAPIKey": "Chave de API Minimax inválida ou em branco, verifique a chave de API Minimax e tente novamente",
@@ -61,6 +61,18 @@
61
61
  "title": "Usar informações de autenticação Bedrock personalizadas"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "Insira a chave da API do DeepSeek",
68
+ "placeholder": "Chave da API do DeepSeek",
69
+ "title": "Chave da API"
70
+ },
71
+ "unlock": {
72
+ "description": "Digite sua chave da API do DeepSeek para iniciar a sessão. O aplicativo não irá armazenar sua chave da API",
73
+ "title": "Usar chave da API personalizada do DeepSeek"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Ошибка запроса к сервису Anthropic AI. Пожалуйста, проверьте информацию ниже или повторите попытку",
56
56
  "AzureBizError": "Ошибка запроса службы Azure AI, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией",
57
57
  "BedrockBizError": "Ошибка запроса службы Bedrock, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией",
58
+ "DeepSeekBizError": "Ошибка обращения к сервису DeepSeek. Пожалуйста, проверьте информацию ниже и повторите попытку",
58
59
  "GoogleBizError": "Ошибка запроса службы Google, пожалуйста, проверьте и повторите попытку в соответствии с предоставленной информацией",
59
60
  "GroqBizError": "Ошибка обращения к сервису Groq. Пожалуйста, проверьте следующую информацию или повторите попытку",
60
61
  "InvalidAccessCode": "Неверный код доступа: введите правильный код доступа или добавьте пользовательский ключ API",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Неверный или пустой ключ API Azure, пожалуйста, проверьте ключ API Azure и повторите попытку",
63
64
  "InvalidBedrockCredentials": "Аутентификация Bedrock не прошла, пожалуйста, проверьте AccessKeyId/SecretAccessKey и повторите попытку",
64
65
  "InvalidClerkUser": "Извините, вы еще не вошли в систему. Пожалуйста, войдите или зарегистрируйтесь, прежде чем продолжить",
66
+ "InvalidDeepSeekAPIKey": "Неверный или пустой ключ DeepSeek API. Пожалуйста, проверьте ключ DeepSeek API и повторите попытку",
65
67
  "InvalidGoogleAPIKey": "Неверный или пустой ключ API Google, пожалуйста, проверьте ключ API Google и повторите попытку",
66
68
  "InvalidGroqAPIKey": "Неверный или пустой ключ API Groq, пожалуйста, проверьте ключ API Groq и повторите попытку",
67
69
  "InvalidMinimaxAPIKey": "Неверный или пустой ключ Minimax API. Пожалуйста, проверьте ключ Minimax API и повторите попытку",
@@ -61,6 +61,18 @@
61
61
  "title": "Использовать пользовательскую информацию аутентификации Bedrock"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "填入来自 DeepSeek 的 API Key",
68
+ "placeholder": "DeepSeek API Key",
69
+ "title": "API Key"
70
+ },
71
+ "unlock": {
72
+ "description": "输入你的 DeepSeek API Key 即可开始会话。应用不会记录你的 API Key",
73
+ "title": "使用自定义 DeepSeek API Key"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Anthropic AI hizmetine yönelik istek hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin",
56
56
  "AzureBizError": "Azure AI servisi isteği hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin",
57
57
  "BedrockBizError": "Bedrock servisi isteği hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin",
58
+ "DeepSeekBizError": "DeepSeek hizmetine yapılan istekte hata oluştu, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin",
58
59
  "GoogleBizError": "Google servisi isteği hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin",
59
60
  "GroqBizError": "Groq hizmeti isteği sırasında bir hata oluştu. Lütfen aşağıdaki bilgilere göre sorunu giderin veya tekrar deneyin",
60
61
  "InvalidAccessCode": "Geçersiz Erişim Kodu: Geçersiz veya boş bir şifre girdiniz. Lütfen doğru erişim şifresini girin veya özel API Anahtarı ekleyin.",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Azure API Anahtarı yanlış veya boş, lütfen Azure API Anahtarınızı kontrol edip tekrar deneyin",
63
64
  "InvalidBedrockCredentials": "Bedrock kimlik doğrulaması geçersiz, lütfen AccessKeyId/SecretAccessKey bilgilerinizi kontrol edip tekrar deneyin",
64
65
  "InvalidClerkUser": "Üzgünüz, şu anda giriş yapmadınız. Lütfen işlemlere devam etmeden önce giriş yapın veya hesap oluşturun",
66
+ "InvalidDeepSeekAPIKey": "DeepSeek API Anahtarı geçersiz veya boş, lütfen DeepSeek API Anahtarınızı kontrol edip tekrar deneyin",
65
67
  "InvalidGoogleAPIKey": "Google API Anahtarı yanlış veya boş, lütfen Google API Anahtarınızı kontrol edip tekrar deneyin",
66
68
  "InvalidGroqAPIKey": "Groq API Anahtarı yanlış veya boş, lütfen Groq API Anahtarınızı kontrol edip tekrar deneyin",
67
69
  "InvalidMinimaxAPIKey": "Minimax API Anahtarı geçersiz veya boş, lütfen Minimax API Anahtarınızı kontrol edip tekrar deneyin",
@@ -61,6 +61,18 @@
61
61
  "title": "Özel Bedrock Kimlik Bilgilerini Kullan"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "DeepSeek 的 API Anahtarını girin",
68
+ "placeholder": "DeepSeek API Anahtarı",
69
+ "title": "API Anahtarı"
70
+ },
71
+ "unlock": {
72
+ "description": "Oturumu başlatmak için DeepSeek API Anahtarınızı girin. Uygulama API Anahtarınızı kaydetmez",
73
+ "title": "Özel DeepSeek API Anahtarını Kullan"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "Yêu cầu dịch vụ AI Anthropic gặp lỗi, vui lòng kiểm tra thông tin dưới đây hoặc thử lại",
56
56
  "AzureBizError": "Yêu cầu dịch vụ Azure AI gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây",
57
57
  "BedrockBizError": "Yêu cầu dịch vụ Bedrock gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây",
58
+ "DeepSeekBizError": "Yêu cầu dịch vụ DeepSeek gặp lỗi, vui lòng kiểm tra thông tin dưới đây hoặc thử lại",
58
59
  "GoogleBizError": "Yêu cầu dịch vụ Google gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây",
59
60
  "GroqBizError": "Yêu cầu dịch vụ Groq gặp sự cố, vui lòng kiểm tra thông tin bên dưới hoặc thử lại",
60
61
  "InvalidAccessCode": "Mật khẩu truy cập không hợp lệ hoặc trống, vui lòng nhập mật khẩu truy cập đúng hoặc thêm Khóa API tùy chỉnh",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Khóa API Azure không chính xác hoặc trống, vui lòng kiểm tra lại Khóa API Azure và thử lại",
63
64
  "InvalidBedrockCredentials": "Xác thực Bedrock không thành công, vui lòng kiểm tra AccessKeyId/SecretAccessKey và thử lại",
64
65
  "InvalidClerkUser": "Xin lỗi, bạn chưa đăng nhập. Vui lòng đăng nhập hoặc đăng ký tài khoản trước khi tiếp tục.",
66
+ "InvalidDeepSeekAPIKey": "Khóa API DeepSeek không hợp lệ hoặc trống, vui lòng kiểm tra lại và thử lại",
65
67
  "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",
66
68
  "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",
67
69
  "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",
@@ -61,6 +61,18 @@
61
61
  "title": "Sử dụng Thông tin Xác thực Bedrock tùy chỉnh"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "Nhập API Key từ DeepSeek",
68
+ "placeholder": "Khóa API DeepSeek",
69
+ "title": "API Key"
70
+ },
71
+ "unlock": {
72
+ "description": "Nhập API Key của bạn từ DeepSeek để bắt đầu phiên làm việc. Ứng dụng sẽ không lưu trữ API Key của bạn",
73
+ "title": "Sử dụng API Key DeepSeek tùy chỉnh"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -78,6 +78,8 @@
78
78
  "InvalidGoogleAPIKey": "Google API Key 不正确或为空,请检查 Google API Key 后重试",
79
79
  "InvalidBedrockCredentials": "Bedrock 鉴权未通过,请检查 AccessKeyId/SecretAccessKey 后重试",
80
80
  "BedrockBizError": "请求 Bedrock 服务出错,请根据以下信息排查或重试",
81
+ "InvalidDeepSeekAPIKey": "DeepSeek API Key 不正确或为空,请检查 DeepSeek API Key 后重试",
82
+ "DeepSeekBizError": "请求 DeepSeek 服务出错,请根据以下信息排查或重试",
81
83
  "InvalidAzureAPIKey": "Azure API Key 不正确或为空,请检查 Azure API Key 后重试",
82
84
  "AzureBizError": "请求 Azure AI 服务出错,请根据以下信息排查或重试",
83
85
  "InvalidPerplexityAPIKey": "Perplexity API Key 不正确或为空,请检查 Perplexity API Key 后重试",
@@ -61,6 +61,18 @@
61
61
  "title": "使用自定义 Bedrock 鉴权信息"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "填入来自 DeepSeek 的 API Key",
68
+ "placeholder": "DeepSeek API Key",
69
+ "title": "API Key"
70
+ },
71
+ "unlock": {
72
+ "description": "输入你的 DeepSeek API Key 即可开始会话。应用不会记录你的 API Key",
73
+ "title": "使用自定义 DeepSeek API Key"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
@@ -55,6 +55,7 @@
55
55
  "AnthropicBizError": "請求 Anthropic AI 服務出錯,請根據以下信息排查或重試",
56
56
  "AzureBizError": "請求 Azure AI 服務出錯,請根據以下信息排查或重試",
57
57
  "BedrockBizError": "請求 Bedrock 服務出錯,請根據以下信息排查或重試",
58
+ "DeepSeekBizError": "請求 DeepSeek 服務出錯,請根據以下資訊排查或重試",
58
59
  "GoogleBizError": "請求 Google 服務出錯,請根據以下信息排查或重試",
59
60
  "GroqBizError": "請求 Groq 服務出錯,請根據以下信息排查或重試",
60
61
  "InvalidAccessCode": "密碼不正確或為空,請輸入正確的訪問密碼,或添加自定義 API 金鑰",
@@ -62,6 +63,7 @@
62
63
  "InvalidAzureAPIKey": "Azure API Key 不正確或為空,請檢查 Azure API Key 後重試",
63
64
  "InvalidBedrockCredentials": "Bedrock 驗證未通過,請檢查 AccessKeyId/SecretAccessKey 後重試",
64
65
  "InvalidClerkUser": "很抱歉,你當前尚未登錄,請先登錄或註冊帳號後繼續操作",
66
+ "InvalidDeepSeekAPIKey": "DeepSeek API 金鑰不正確或為空,請檢查 DeepSeek API 金鑰後重試",
65
67
  "InvalidGoogleAPIKey": "Google API Key 不正確或為空,請檢查 Google API Key 後重試",
66
68
  "InvalidGroqAPIKey": "Groq API 金鑰不正確或為空,請檢查 Groq API 金鑰後重試",
67
69
  "InvalidMinimaxAPIKey": "Minimax API 金鑰不正確或為空,請檢查 Minimax API 金鑰後重試",
@@ -61,6 +61,18 @@
61
61
  "title": "使用自定義 Bedrock 驗證資訊"
62
62
  }
63
63
  },
64
+ "deepseek": {
65
+ "title": "DeepSeek",
66
+ "token": {
67
+ "desc": "填入來自 DeepSeek 的 API 金鑰",
68
+ "placeholder": "DeepSeek API 金鑰",
69
+ "title": "API 金鑰"
70
+ },
71
+ "unlock": {
72
+ "description": "輸入你的 DeepSeek API 金鑰即可開始會話。應用程式不會記錄你的 API 金鑰",
73
+ "title": "使用自訂 DeepSeek API 金鑰"
74
+ }
75
+ },
64
76
  "google": {
65
77
  "title": "Google",
66
78
  "token": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.158.2",
3
+ "version": "0.159.1",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -108,7 +108,7 @@
108
108
  "@vercel/speed-insights": "^1.0.10",
109
109
  "ahooks": "^3.7.11",
110
110
  "ai": "3.0.19",
111
- "antd": "^5.17.0",
111
+ "antd": "5.17.0",
112
112
  "antd-style": "^3.6.2",
113
113
  "brotli-wasm": "^3.0.0",
114
114
  "chroma-js": "^2.4.2",
@@ -3,7 +3,6 @@
3
3
  import { ActionIcon, Avatar, ChatHeaderTitle } from '@lobehub/ui';
4
4
  import { Skeleton } from 'antd';
5
5
  import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
6
- import Link from 'next/link';
7
6
  import { memo } from 'react';
8
7
  import { useTranslation } from 'react-i18next';
9
8
  import { Flexbox } from 'react-layout-kit';
@@ -45,20 +44,19 @@ const Main = memo(() => {
45
44
  ) : (
46
45
  <Flexbox align={'flex-start'} gap={12} horizontal>
47
46
  {
48
- <Link aria-label={t('agentsAndConversations')} href={'/chat'}>
49
- <ActionIcon
50
- icon={showSessionPanel ? PanelLeftClose : PanelLeftOpen}
51
- onClick={() => {
52
- const currentShowSessionPanel = useGlobalStore.getState().preference.showSessionPanel;
53
- useGlobalStore.getState().updatePreference({
54
- sessionsWidth: currentShowSessionPanel ? 0 : 320,
55
- showSessionPanel: !currentShowSessionPanel,
56
- });
57
- }}
58
- size="large"
59
- title={t('agentsAndConversations')}
60
- />
61
- </Link>
47
+ <ActionIcon
48
+ aria-label={t('agentsAndConversations')}
49
+ icon={showSessionPanel ? PanelLeftClose : PanelLeftOpen}
50
+ onClick={() => {
51
+ const currentShowSessionPanel = useGlobalStore.getState().preference.showSessionPanel;
52
+ useGlobalStore.getState().updatePreference({
53
+ sessionsWidth: currentShowSessionPanel ? 0 : 320,
54
+ showSessionPanel: !currentShowSessionPanel,
55
+ });
56
+ }}
57
+ size="large"
58
+ title={t('agentsAndConversations')}
59
+ />
62
60
  }
63
61
  <Avatar
64
62
  avatar={avatar}
@@ -3,7 +3,6 @@
3
3
  import { Form, type ItemGroup } from '@lobehub/ui';
4
4
  import { App, Button, Input } from 'antd';
5
5
  import isEqual from 'fast-deep-equal';
6
- import { signIn, signOut } from 'next-auth/react';
7
6
  import { memo, useCallback } from 'react';
8
7
  import { useTranslation } from 'react-i18next';
9
8
 
@@ -12,6 +11,8 @@ import { FORM_STYLE } from '@/const/layoutTokens';
12
11
  import { DEFAULT_SETTINGS } from '@/const/settings';
13
12
  import { useChatStore } from '@/store/chat';
14
13
  import { useFileStore } from '@/store/file';
14
+ import { useServerConfigStore } from '@/store/serverConfig';
15
+ import { serverConfigSelectors } from '@/store/serverConfig/selectors';
15
16
  import { useSessionStore } from '@/store/session';
16
17
  import { useToolStore } from '@/store/tool';
17
18
  import { useUserStore } from '@/store/user';
@@ -19,16 +20,13 @@ import { settingsSelectors, userProfileSelectors } from '@/store/user/selectors'
19
20
 
20
21
  type SettingItemGroup = ItemGroup;
21
22
 
22
- export interface SettingsCommonProps {
23
- showAccessCodeConfig: boolean;
24
- showOAuthLogin?: boolean;
25
- }
26
-
27
- const Common = memo<SettingsCommonProps>(({ showAccessCodeConfig, showOAuthLogin }) => {
23
+ const Common = memo(() => {
28
24
  const { t } = useTranslation('setting');
29
25
  const [form] = Form.useForm();
30
26
 
31
27
  const isSignedIn = useUserStore((s) => s.isSignedIn);
28
+ const showAccessCodeConfig = useServerConfigStore(serverConfigSelectors.enabledAccessCode);
29
+ const showOAuthLogin = useServerConfigStore(serverConfigSelectors.enabledOAuthSSO);
32
30
  const user = useUserStore(userProfileSelectors.userProfile, isEqual);
33
31
 
34
32
  const [clearSessions, clearSessionGroups] = useSessionStore((s) => [
@@ -42,7 +40,12 @@ const Common = memo<SettingsCommonProps>(({ showAccessCodeConfig, showOAuthLogin
42
40
  const [removeAllFiles] = useFileStore((s) => [s.removeAllFiles]);
43
41
  const removeAllPlugins = useToolStore((s) => s.removeAllPlugins);
44
42
  const settings = useUserStore(settingsSelectors.currentSettings, isEqual);
45
- const [setSettings, resetSettings] = useUserStore((s) => [s.setSettings, s.resetSettings]);
43
+ const [setSettings, resetSettings, signIn, signOut] = useUserStore((s) => [
44
+ s.setSettings,
45
+ s.resetSettings,
46
+ s.openLogin,
47
+ s.logout,
48
+ ]);
46
49
 
47
50
  const { message, modal } = App.useApp();
48
51
 
@@ -1,19 +1,11 @@
1
- import { authEnv } from '@/config/auth';
2
- import { getServerConfig } from '@/config/server';
3
-
4
1
  import Common from './features/Common';
5
2
  import Theme from './features/Theme';
6
3
 
7
4
  const Page = () => {
8
- const { SHOW_ACCESS_CODE_CONFIG } = getServerConfig();
9
-
10
5
  return (
11
6
  <>
12
7
  <Theme />
13
- <Common
14
- showAccessCodeConfig={SHOW_ACCESS_CODE_CONFIG}
15
- showOAuthLogin={authEnv.NEXT_PUBLIC_ENABLE_NEXT_AUTH}
16
- />
8
+ <Common />
17
9
  </>
18
10
  );
19
11
  };
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+
3
+ import { DeepSeek } from '@lobehub/icons';
4
+ import { memo } from 'react';
5
+
6
+ import { ModelProvider } from '@/libs/agent-runtime';
7
+
8
+ import ProviderConfig from '../components/ProviderConfig';
9
+
10
+ const DeepSeekProvider = memo(() => {
11
+ return (
12
+ <ProviderConfig
13
+ checkModel={'deepseek/deepseek-chat'}
14
+ modelList={{ showModelFetcher: true }}
15
+ provider={ModelProvider.DeepSeek}
16
+ title={<DeepSeek.Combine size={28} type={'color'} />}
17
+ />
18
+ );
19
+ });
20
+
21
+ export default DeepSeekProvider;
@@ -5,6 +5,7 @@ import { Flexbox } from 'react-layout-kit';
5
5
  import Anthropic from './Anthropic';
6
6
  import Azure from './Azure';
7
7
  import Bedrock from './Bedrock';
8
+ import DeepSeek from './DeepSeek';
8
9
  import Google from './Google';
9
10
  import Groq from './Groq';
10
11
  import Minimax from './Minimax';
@@ -28,6 +29,7 @@ const Page = () => {
28
29
  <Google />
29
30
  <Anthropic />
30
31
  <Bedrock />
32
+ <DeepSeek />
31
33
  <OpenRouter />
32
34
  <TogetherAI />
33
35
  <Groq />
@@ -16,6 +16,7 @@ import {
16
16
  LobeOpenRouterAI,
17
17
  LobePerplexityAI,
18
18
  LobeRuntimeAI,
19
+ LobeDeepSeekAI,
19
20
  LobeTogetherAI,
20
21
  LobeZeroOneAI,
21
22
  LobeZhipuAI,
@@ -42,6 +43,7 @@ vi.mock('@/config/server', () => ({
42
43
  AWS_REGION: 'test-aws-region',
43
44
  OLLAMA_PROXY_URL: 'https://test-ollama-url.local',
44
45
  PERPLEXITY_API_KEY: 'test-perplexity-key',
46
+ DEEPSEEK_API_KEY: 'test-deepseek-key',
45
47
  ANTHROPIC_API_KEY: 'test-anthropic-key',
46
48
  MINIMAX_API_KEY: 'test-minimax-key',
47
49
  MISTRAL_API_KEY: 'test-mistral-key',
@@ -153,6 +155,13 @@ describe('initAgentRuntimeWithUserPayload method', () => {
153
155
  expect(runtime['_runtime']).toBeInstanceOf(LobeOpenRouterAI);
154
156
  });
155
157
 
158
+ it('DeepSeek AI provider: with apikey', async () => {
159
+ const jwtPayload: JWTPayload = { apiKey: 'user-deepseek-key' };
160
+ const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.DeepSeek, jwtPayload);
161
+ expect(runtime).toBeInstanceOf(AgentRuntime);
162
+ expect(runtime['_runtime']).toBeInstanceOf(LobeDeepSeekAI);
163
+ });
164
+
156
165
  it('Together AI provider: with apikey', async () => {
157
166
  const jwtPayload: JWTPayload = { apiKey: 'user-togetherai-key' };
158
167
  const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.TogetherAI, jwtPayload);
@@ -279,6 +288,14 @@ describe('initAgentRuntimeWithUserPayload method', () => {
279
288
  expect(runtime['_runtime']).toBeInstanceOf(LobeOpenRouterAI);
280
289
  });
281
290
 
291
+ it('DeepSeek AI provider: without apikey', async () => {
292
+ const jwtPayload = {};
293
+ const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.DeepSeek, jwtPayload);
294
+
295
+ // 假设 LobeDeepSeekAI 是 DeepSeek 提供者的实现类
296
+ expect(runtime['_runtime']).toBeInstanceOf(LobeDeepSeekAI);
297
+ });
298
+
282
299
  it('Together AI provider: without apikey', async () => {
283
300
  const jwtPayload = {};
284
301
  const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.TogetherAI, jwtPayload);
@@ -137,6 +137,11 @@ const getLlmOptionsFromPayload = (provider: string, payload: JWTPayload) => {
137
137
 
138
138
  return { apiKey };
139
139
  }
140
+ case ModelProvider.DeepSeek: {
141
+ const { DEEPSEEK_API_KEY } = getServerConfig();
142
+ const apiKey = apiKeyManager.pick(payload?.apiKey || DEEPSEEK_API_KEY);
143
+ return { apiKey };
144
+ }
140
145
  case ModelProvider.TogetherAI: {
141
146
  const { TOGETHERAI_API_KEY } = getServerConfig();
142
147
 
@@ -132,6 +132,12 @@ describe('createErrorResponse', () => {
132
132
  const response = createErrorResponse(errorType);
133
133
  expect(response.status).toBe(485);
134
134
  });
135
+
136
+ it('returns a 486 status for DeepSeekBizError error type', () => {
137
+ const errorType = AgentRuntimeErrorType.DeepSeekBizError;
138
+ const response = createErrorResponse(errorType);
139
+ expect(response.status).toBe(486);
140
+ });
135
141
  });
136
142
 
137
143
  // 测试状态码不在200-599范围内的情况
@@ -65,6 +65,9 @@ const getStatus = (errorType: ILobeAgentRuntimeErrorType | ErrorType) => {
65
65
  case AgentRuntimeErrorType.MinimaxBizError: {
66
66
  return 485;
67
67
  }
68
+ case AgentRuntimeErrorType.DeepSeekBizError: {
69
+ return 486;
70
+ }
68
71
  }
69
72
  return errorType as number;
70
73
  };
@@ -9,6 +9,7 @@ import {
9
9
  Claude,
10
10
  Cohere,
11
11
  Dbrx,
12
+ DeepSeek,
12
13
  FishAudio,
13
14
  Gemini,
14
15
  Gemma,
@@ -46,6 +47,7 @@ const ModelIcon = memo<ModelProviderIconProps>(({ model: originModel, size = 12
46
47
  if (model.includes('gpt-3')) return <OpenAI.Avatar size={size} type={'gpt3'} />;
47
48
  if (model.includes('gpt-4')) return <OpenAI.Avatar size={size} type={'gpt4'} />;
48
49
  if (model.startsWith('glm') || model.includes('chatglm')) return <ChatGLM.Avatar size={size} />;
50
+ if (model.includes('deepseek')) return <DeepSeek.Avatar size={size} />;
49
51
  if (model.includes('claude')) return <Claude.Avatar size={size} />;
50
52
  if (model.includes('titan')) return <Aws.Avatar size={size} />;
51
53
  if (model.includes('llama')) return <Meta.Avatar size={size} />;
@@ -2,6 +2,7 @@ import {
2
2
  Anthropic,
3
3
  Azure,
4
4
  Bedrock,
5
+ DeepSeek,
5
6
  Google,
6
7
  Groq,
7
8
  Minimax,
@@ -34,6 +35,10 @@ const ModelProviderIcon = memo<ModelProviderIconProps>(({ provider }) => {
34
35
  return <Bedrock size={20} />;
35
36
  }
36
37
 
38
+ case ModelProvider.DeepSeek: {
39
+ return <DeepSeek size={20} />;
40
+ }
41
+
37
42
  case ModelProvider.Google: {
38
43
  return (
39
44
  <Center height={20} width={20}>