@lobehub/chat 0.145.11 → 0.145.13

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 (74) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/locales/ar/common.json +1 -1
  3. package/locales/ar/error.json +7 -7
  4. package/locales/ar/setting.json +108 -108
  5. package/locales/bg-BG/common.json +1 -0
  6. package/locales/bg-BG/error.json +7 -1
  7. package/locales/bg-BG/setting.json +107 -91
  8. package/locales/de-DE/common.json +1 -1
  9. package/locales/de-DE/error.json +7 -7
  10. package/locales/de-DE/setting.json +106 -106
  11. package/locales/en-US/common.json +1 -1
  12. package/locales/en-US/error.json +7 -7
  13. package/locales/en-US/setting.json +66 -66
  14. package/locales/es-ES/common.json +1 -1
  15. package/locales/es-ES/error.json +7 -7
  16. package/locales/es-ES/setting.json +91 -91
  17. package/locales/fr-FR/common.json +1 -1
  18. package/locales/fr-FR/error.json +7 -7
  19. package/locales/fr-FR/setting.json +87 -87
  20. package/locales/it-IT/common.json +1 -1
  21. package/locales/it-IT/error.json +7 -7
  22. package/locales/it-IT/setting.json +111 -111
  23. package/locales/ja-JP/common.json +1 -1
  24. package/locales/ja-JP/error.json +7 -7
  25. package/locales/ja-JP/setting.json +101 -101
  26. package/locales/ko-KR/common.json +1 -1
  27. package/locales/ko-KR/error.json +7 -3
  28. package/locales/ko-KR/setting.json +82 -82
  29. package/locales/nl-NL/common.json +1 -1
  30. package/locales/nl-NL/error.json +10 -10
  31. package/locales/nl-NL/setting.json +112 -112
  32. package/locales/pl-PL/common.json +1 -1
  33. package/locales/pl-PL/error.json +12 -12
  34. package/locales/pl-PL/setting.json +102 -102
  35. package/locales/pt-BR/common.json +1 -1
  36. package/locales/pt-BR/error.json +7 -7
  37. package/locales/pt-BR/setting.json +104 -104
  38. package/locales/ru-RU/common.json +1 -1
  39. package/locales/ru-RU/error.json +7 -7
  40. package/locales/ru-RU/setting.json +113 -113
  41. package/locales/tr-TR/common.json +1 -1
  42. package/locales/tr-TR/error.json +7 -7
  43. package/locales/tr-TR/setting.json +113 -113
  44. package/locales/vi-VN/common.json +1 -1
  45. package/locales/vi-VN/error.json +7 -7
  46. package/locales/vi-VN/setting.json +81 -81
  47. package/locales/zh-CN/common.json +1 -1
  48. package/locales/zh-CN/error.json +6 -6
  49. package/locales/zh-CN/setting.json +39 -39
  50. package/locales/zh-TW/common.json +1 -1
  51. package/locales/zh-TW/error.json +7 -7
  52. package/locales/zh-TW/setting.json +70 -70
  53. package/package.json +1 -1
  54. package/src/app/api/auth/sso-providers/azure-ad.ts +1 -1
  55. package/src/app/settings/llm/Anthropic/index.tsx +3 -43
  56. package/src/app/settings/llm/Azure/index.tsx +10 -10
  57. package/src/app/settings/llm/Bedrock/index.tsx +9 -9
  58. package/src/app/settings/llm/Google/index.tsx +3 -29
  59. package/src/app/settings/llm/Groq/index.tsx +2 -28
  60. package/src/app/settings/llm/Mistral/index.tsx +2 -28
  61. package/src/app/settings/llm/Moonshot/index.tsx +2 -28
  62. package/src/app/settings/llm/Ollama/index.tsx +13 -32
  63. package/src/app/settings/llm/OpenAI/index.tsx +15 -17
  64. package/src/app/settings/llm/OpenRouter/index.tsx +3 -40
  65. package/src/app/settings/llm/Perplexity/index.tsx +2 -28
  66. package/src/app/settings/llm/TogetherAI/index.tsx +3 -44
  67. package/src/app/settings/llm/ZeroOne/index.tsx +2 -28
  68. package/src/app/settings/llm/Zhipu/index.tsx +2 -30
  69. package/src/app/settings/llm/components/ProviderConfig/index.tsx +73 -9
  70. package/src/app/settings/llm/const.ts +6 -0
  71. package/src/app/settings/tts/TTS/index.tsx +1 -1
  72. package/src/locales/default/error.ts +1 -1
  73. package/src/locales/default/setting.ts +30 -31
  74. package/src/locales/resources.ts +4 -0
@@ -31,20 +31,20 @@
31
31
  "sessionWithName": "對話設定 · {{name}}"
32
32
  },
33
33
  "llm": {
34
- "Anthropic": {
34
+ "anthropic": {
35
35
  "endpoint": {
36
- "desc": "除預設地址外,必須包含 http(s)://",
36
+ "desc": "除了預設地址外,必須包含 http(s)://",
37
37
  "placeholder": "https://api.anthropic.com",
38
38
  "title": "API 代理地址"
39
39
  },
40
40
  "title": "Anthropic",
41
41
  "token": {
42
- "desc": "填入來自 Anthropic 的 API 金鑰",
43
- "placeholder": "Anthropic API 金鑰",
44
- "title": "API 金鑰"
42
+ "desc": "填入來自 Anthropics 的 API Key",
43
+ "placeholder": "Anthropic API Key",
44
+ "title": "API Key"
45
45
  }
46
46
  },
47
- "AzureOpenAI": {
47
+ "azure": {
48
48
  "azureApiVersion": {
49
49
  "desc": "Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查閱[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
50
50
  "fetch": "獲取列表",
@@ -55,7 +55,7 @@
55
55
  "title": "Azure 部署模型列表"
56
56
  },
57
57
  "endpoint": {
58
- "desc": "從 Azure 門戶檢查資源時,可在“金鑰和終結點”部分中找到此值",
58
+ "desc": "從 Azure 門戶檢查資源時,可在「密鑰和終端點」部分中找到此值",
59
59
  "placeholder": "https://docs-test-001.openai.azure.com",
60
60
  "title": "Azure API 地址"
61
61
  },
@@ -63,21 +63,21 @@
63
63
  "desc": "支援的模型",
64
64
  "title": "模型列表"
65
65
  },
66
- "title": "Azure OpenAI 設定",
66
+ "title": "Azure OpenAI",
67
67
  "token": {
68
- "desc": "從 Azure 門戶檢查資源時,可在“金鑰和終結點”部分中找到此值。 可以使用 KEY1 或 KEY2",
69
- "placeholder": "Azure API 金鑰",
70
- "title": "API 金鑰"
68
+ "desc": "從 Azure 門戶檢查資源時,可在「密鑰和終端點」部分中找到此值。 可以使用 KEY1 或 KEY2",
69
+ "placeholder": "Azure API Key",
70
+ "title": "API Key"
71
71
  }
72
72
  },
73
- "Bedrock": {
73
+ "bedrock": {
74
74
  "accessKeyId": {
75
75
  "desc": "填入 AWS Access Key ID",
76
76
  "placeholder": "AWS Access Key ID",
77
77
  "title": "AWS Access Key ID"
78
78
  },
79
79
  "checker": {
80
- "desc": "測試 Access Key ID / Secret Access Key 是否填寫正確"
80
+ "desc": "測試 AccessKeyId / SecretAccessKey 是否填寫正確"
81
81
  },
82
82
  "region": {
83
83
  "desc": "填入 AWS Region",
@@ -91,45 +91,51 @@
91
91
  },
92
92
  "title": "Bedrock"
93
93
  },
94
- "Google": {
94
+ "checker": {
95
+ "button": "檢查",
96
+ "desc": "測試 API 金鑰與代理地址是否正確填寫",
97
+ "pass": "檢查通過",
98
+ "title": "連通性檢查"
99
+ },
100
+ "google": {
95
101
  "title": "Google",
96
102
  "token": {
97
- "desc": "填入來自 Google 的 API 金鑰",
98
- "placeholder": "Google API 金鑰",
99
- "title": "API 金鑰"
103
+ "desc": "填入來自 Google 的 API Key",
104
+ "placeholder": "Google API Key",
105
+ "title": "API Key"
100
106
  }
101
107
  },
102
- "Groq": {
108
+ "groq": {
103
109
  "title": "Groq",
104
110
  "token": {
105
- "desc": "填入來自 Groq 的 API 金鑰",
106
- "placeholder": "Groq API 金鑰",
107
- "title": "API 金鑰"
111
+ "desc": "填入來自 Groq 的 API Key",
112
+ "placeholder": "Groq API Key",
113
+ "title": "API Key"
108
114
  }
109
115
  },
110
- "Mistral": {
116
+ "mistral": {
111
117
  "title": "Mistral AI",
112
118
  "token": {
113
- "desc": "填入來自 Mistral AI 的 API 金鑰",
114
- "placeholder": "Mistral AI API 金鑰",
115
- "title": "API 金鑰"
119
+ "desc": "填入來自 Mistral AI 的 API Key",
120
+ "placeholder": "Mistral AI API Key",
121
+ "title": "API Key"
116
122
  }
117
123
  },
118
- "Moonshot": {
119
- "title": "月球背面",
124
+ "moonshot": {
125
+ "title": "月之暗面",
120
126
  "token": {
121
- "desc": "請填入來自 Moonshot AI 的 API 金鑰",
122
- "placeholder": "Moonshot AI API 金鑰",
123
- "title": "API 金鑰"
127
+ "desc": "填入來自 Moonshot AI 的 API Key",
128
+ "placeholder": "Moonshot AI API Key",
129
+ "title": "API Key"
124
130
  }
125
131
  },
126
- "Ollama": {
132
+ "ollama": {
127
133
  "checker": {
128
134
  "desc": "檢查代理地址是否正確填寫"
129
135
  },
130
136
  "customModelName": {
131
137
  "desc": "新增自定義模型,多個模型使用逗號(,)隔開",
132
- "placeholder": "維庫納,利亞瓦,科迪拉瑪,拉瑪2:13b-文本",
138
+ "placeholder": "vicuna,llava,codellama,llama2:13b-text",
133
139
  "title": "自定義模型名稱"
134
140
  },
135
141
  "endpoint": {
@@ -139,7 +145,7 @@
139
145
  },
140
146
  "title": "Ollama"
141
147
  },
142
- "OpenAI": {
148
+ "openai": {
143
149
  "azureApiVersion": {
144
150
  "desc": "Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查閱[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
145
151
  "fetch": "獲取列表",
@@ -153,7 +159,7 @@
153
159
  "endpoint": {
154
160
  "desc": "除預設地址外,必須包含 http(s)://",
155
161
  "placeholder": "https://api.openai.com/v1",
156
- "title": "介面代理地址"
162
+ "title": "接口代理地址"
157
163
  },
158
164
  "models": {
159
165
  "count": "共支援 {{count}} 個模型",
@@ -164,11 +170,11 @@
164
170
  "refetch": "重新獲取模型列表",
165
171
  "title": "模型列表"
166
172
  },
167
- "title": "OpenAI 設定",
173
+ "title": "OpenAI",
168
174
  "token": {
169
- "desc": "使用自己的 OpenAI 金鑰",
170
- "placeholder": "OpenAI API 金鑰",
171
- "title": "API 金鑰"
175
+ "desc": "使用自己的 OpenAI Key",
176
+ "placeholder": "OpenAI API Key",
177
+ "title": "OpenAI API Key"
172
178
  },
173
179
  "useAzure": {
174
180
  "desc": "使用 Azure 提供的 OpenAI 服務",
@@ -177,7 +183,7 @@
177
183
  "title": "Azure OpenAI"
178
184
  }
179
185
  },
180
- "OpenRouter": {
186
+ "openrouter": {
181
187
  "checker": {
182
188
  "desc": "測試代理地址是否正確填寫"
183
189
  },
@@ -188,12 +194,20 @@
188
194
  },
189
195
  "title": "OpenRouter",
190
196
  "token": {
191
- "desc": "填入來自 OpenRouter AI 的 API 金鑰",
192
- "placeholder": "OpenRouter AI API 金鑰",
193
- "title": "API 金鑰"
197
+ "desc": "填入來自 OpenRouter AI 的 API Key",
198
+ "placeholder": "OpenRouter AI API Key",
199
+ "title": "API Key"
200
+ }
201
+ },
202
+ "perplexity": {
203
+ "title": "Perplexity",
204
+ "token": {
205
+ "desc": "填入來自 Perplexity AI 的 API Key",
206
+ "placeholder": "Perplexity AI API Key",
207
+ "title": "API Key"
194
208
  }
195
209
  },
196
- "TogetherAI": {
210
+ "togetherai": {
197
211
  "checker": {
198
212
  "desc": "測試代理地址是否正確填寫"
199
213
  },
@@ -204,42 +218,28 @@
204
218
  },
205
219
  "title": "TogetherAI",
206
220
  "token": {
207
- "desc": "填入來自 TogetherAI AI 的 API 金鑰",
208
- "placeholder": "TogetherAI AI API 金鑰",
209
- "title": "API 金鑰"
221
+ "desc": "填入來自 TogetherAI AI 的 API Key",
222
+ "placeholder": "TogetherAI AI API Key",
223
+ "title": "API Key"
210
224
  }
211
225
  },
212
- "Perplexity": {
213
- "title": "Perplexity AI",
214
- "token": {
215
- "desc": "請填入來自 Perplexity AI 的 API 金鑰",
216
- "placeholder": "Perplexity AI API 金鑰",
217
- "title": "API 金鑰"
218
- }
219
- },
220
- "ZeroOne": {
226
+ "waitingForMore": "更多模型正在 <1>計劃接入</1> 中,敬請期待 ✨",
227
+ "zeroone": {
221
228
  "title": "01.AI 零一萬物",
222
229
  "token": {
223
- "desc": "填入來自 01.AI 零一萬物的 API 金鑰",
224
- "placeholder": "01.AI 零一萬物 API 金鑰",
225
- "title": "API 金鑰"
230
+ "desc": "填入來自 01.AI 零一萬物的 API Key",
231
+ "placeholder": "01.AI 零一萬物 API Key",
232
+ "title": "API Key"
226
233
  }
227
234
  },
228
- "Zhipu": {
235
+ "zhipu": {
229
236
  "title": "智譜",
230
237
  "token": {
231
- "desc": "填入來自智譜的 API 金鑰",
232
- "placeholder": "智譜 API 金鑰",
233
- "title": "API 金鑰"
238
+ "desc": "填入來自智譜的 API Key",
239
+ "placeholder": "Zhipu API Key",
240
+ "title": "API Key"
234
241
  }
235
- },
236
- "checker": {
237
- "button": "檢查",
238
- "desc": "測試 API 金鑰與代理地址是否正確填寫",
239
- "pass": "檢查通過",
240
- "title": "連通性檢查"
241
- },
242
- "waitingForMore": "更多模型正在 <1>計劃接入</1> 中,敬請期待 ✨"
242
+ }
243
243
  },
244
244
  "ollama": {
245
245
  "download": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.145.11",
3
+ "version": "0.145.13",
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",
@@ -5,7 +5,7 @@ import { getServerConfig } from '@/config/server';
5
5
  const { AZURE_AD_CLIENT_ID, AZURE_AD_CLIENT_SECRET, AZURE_AD_TENANT_ID } = getServerConfig();
6
6
 
7
7
  const provider = {
8
- id: 'azureAd',
8
+ id: 'azure-ad',
9
9
  provider: AzureAD({
10
10
  // Specify auth scope, at least include 'openid email'
11
11
  // all scopes in Azure AD ref: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#openid-connect-scopes
@@ -1,59 +1,19 @@
1
1
  import { Anthropic, Claude } from '@lobehub/icons';
2
- import { Input } from 'antd';
3
2
  import { useTheme } from 'antd-style';
4
3
  import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
4
 
7
5
  import { ModelProvider } from '@/libs/agent-runtime';
8
6
 
9
- import Checker from '../components/Checker';
10
7
  import ProviderConfig from '../components/ProviderConfig';
11
- import {
12
- LLMProviderApiTokenKey,
13
- LLMProviderBaseUrlKey,
14
- LLMProviderConfigKey
15
- } from '../const';
16
-
17
- const providerKey = 'anthropic';
18
8
 
19
9
  const AnthropicProvider = memo(() => {
20
- const { t } = useTranslation('setting');
21
-
22
10
  const theme = useTheme();
23
11
 
24
12
  return (
25
13
  <ProviderConfig
26
- configItems={[
27
- {
28
- children: (
29
- <Input.Password
30
- autoComplete={'new-password'}
31
- placeholder={t('llm.Anthropic.token.placeholder')}
32
- />
33
- ),
34
- desc: t('llm.Anthropic.token.desc'),
35
- label: t('llm.Anthropic.token.title'),
36
- name: [LLMProviderConfigKey, providerKey, LLMProviderApiTokenKey],
37
- },
38
- {
39
- children: (
40
- <Input
41
- allowClear
42
- placeholder={t('llm.Anthropic.endpoint.placeholder')}
43
- />
44
- ),
45
- desc: t('llm.Anthropic.endpoint.desc'),
46
- label: t('llm.Anthropic.endpoint.title'),
47
- name: [LLMProviderConfigKey, providerKey, LLMProviderBaseUrlKey],
48
- },
49
- {
50
- children: <Checker model={'claude-2.1'} provider={ModelProvider.Anthropic} />,
51
- desc: t('llm.checker.desc'),
52
- label: t('llm.checker.title'),
53
- minWidth: '100%',
54
- },
55
- ]}
56
- provider={providerKey}
14
+ checkModel={'claude-2.1'}
15
+ provider={ModelProvider.Anthropic}
16
+ showEndpoint
57
17
  title={
58
18
  <Anthropic.Text
59
19
  color={theme.isDarkMode ? theme.colorText : Claude.colorPrimary}
@@ -38,17 +38,17 @@ const AzureOpenAIProvider = memo(() => {
38
38
  children: (
39
39
  <Input.Password
40
40
  autoComplete={'new-password'}
41
- placeholder={t('llm.AzureOpenAI.token.placeholder')}
41
+ placeholder={t('llm.azure.token.placeholder')}
42
42
  />
43
43
  ),
44
- desc: t('llm.AzureOpenAI.token.desc'),
45
- label: t('llm.AzureOpenAI.token.title'),
44
+ desc: t('llm.azure.token.desc'),
45
+ label: t('llm.azure.token.title'),
46
46
  name: [LLMProviderConfigKey, providerKey, LLMProviderApiTokenKey],
47
47
  },
48
48
  {
49
- children: <Input allowClear placeholder={t('llm.AzureOpenAI.endpoint.placeholder')} />,
50
- desc: t('llm.AzureOpenAI.endpoint.desc'),
51
- label: t('llm.AzureOpenAI.endpoint.title'),
49
+ children: <Input allowClear placeholder={t('llm.azure.endpoint.placeholder')} />,
50
+ desc: t('llm.azure.endpoint.desc'),
51
+ label: t('llm.azure.endpoint.title'),
52
52
  name: [LLMProviderConfigKey, providerKey, LLMProviderBaseUrlKey],
53
53
  },
54
54
  {
@@ -69,10 +69,10 @@ const AzureOpenAIProvider = memo(() => {
69
69
  ),
70
70
  desc: (
71
71
  <Markdown className={styles.markdown} fontSize={12} variant={'chat'}>
72
- {t('llm.AzureOpenAI.azureApiVersion.desc')}
72
+ {t('llm.azure.azureApiVersion.desc')}
73
73
  </Markdown>
74
74
  ),
75
- label: t('llm.AzureOpenAI.azureApiVersion.title'),
75
+ label: t('llm.azure.azureApiVersion.title'),
76
76
  name: [LLMProviderConfigKey, providerKey, 'apiVersion'],
77
77
  },
78
78
  {
@@ -85,11 +85,11 @@ const AzureOpenAIProvider = memo(() => {
85
85
  ),
86
86
  desc: (
87
87
  <Markdown className={styles.markdown} fontSize={12} variant={'chat'}>
88
- {t('llm.AzureOpenAI.deployments.desc')}
88
+ {t('llm.azure.deployments.desc')}
89
89
  </Markdown>
90
90
  ),
91
91
 
92
- label: t('llm.AzureOpenAI.deployments.title'),
92
+ label: t('llm.azure.deployments.title'),
93
93
  name: [LLMProviderConfigKey, providerKey, 'deployments'],
94
94
  },
95
95
  {
@@ -23,22 +23,22 @@ const BedrockProvider = memo(() => {
23
23
  children: (
24
24
  <Input.Password
25
25
  autoComplete={'new-password'}
26
- placeholder={t('llm.Bedrock.accessKeyId.placeholder')}
26
+ placeholder={t(`llm.${providerKey}.accessKeyId.placeholder`)}
27
27
  />
28
28
  ),
29
- desc: t('llm.Bedrock.accessKeyId.desc'),
30
- label: t('llm.Bedrock.accessKeyId.title'),
29
+ desc: t(`llm.${providerKey}.accessKeyId.desc`),
30
+ label: t(`llm.${providerKey}.accessKeyId.title`),
31
31
  name: [LLMProviderConfigKey, providerKey, 'accessKeyId'],
32
32
  },
33
33
  {
34
34
  children: (
35
35
  <Input.Password
36
36
  autoComplete={'new-password'}
37
- placeholder={t('llm.Bedrock.secretAccessKey.placeholder')}
37
+ placeholder={t(`llm.${providerKey}.secretAccessKey.placeholder`)}
38
38
  />
39
39
  ),
40
- desc: t('llm.Bedrock.secretAccessKey.desc'),
41
- label: t('llm.Bedrock.secretAccessKey.title'),
40
+ desc: t(`llm.${providerKey}.secretAccessKey.desc`),
41
+ label: t(`llm.${providerKey}.secretAccessKey.title`),
42
42
  name: [LLMProviderConfigKey, providerKey, 'secretAccessKey'],
43
43
  },
44
44
  {
@@ -52,15 +52,15 @@ const BedrockProvider = memo(() => {
52
52
  placeholder={'us-east-1'}
53
53
  />
54
54
  ),
55
- desc: t('llm.Bedrock.region.desc'),
56
- label: t('llm.Bedrock.region.title'),
55
+ desc: t(`llm.${providerKey}.region.desc`),
56
+ label: t(`llm.${providerKey}.region.title`),
57
57
  name: [LLMProviderConfigKey, providerKey, 'region'],
58
58
  },
59
59
  {
60
60
  children: (
61
61
  <Checker model={'anthropic.claude-instant-v1'} provider={ModelProvider.Bedrock} />
62
62
  ),
63
- desc: t('llm.Bedrock.checker.desc'),
63
+ desc: t(`llm.${providerKey}.checker.desc`),
64
64
  label: t('llm.checker.title'),
65
65
  minWidth: '100%',
66
66
  },
@@ -1,43 +1,17 @@
1
1
  import { Gemini, Google } from '@lobehub/icons';
2
- import { Divider, Input } from 'antd';
2
+ import { Divider } from 'antd';
3
3
  import { memo } from 'react';
4
- import { useTranslation } from 'react-i18next';
5
4
  import { Flexbox } from 'react-layout-kit';
6
5
 
7
6
  import { ModelProvider } from '@/libs/agent-runtime';
8
- import { GlobalLLMProviderKey } from '@/types/settings';
9
7
 
10
- import Checker from '../components/Checker';
11
8
  import ProviderConfig from '../components/ProviderConfig';
12
- import { LLMProviderApiTokenKey, LLMProviderConfigKey } from '../const';
13
-
14
- const providerKey: GlobalLLMProviderKey = 'google';
15
9
 
16
10
  const GoogleProvider = memo(() => {
17
- const { t } = useTranslation('setting');
18
-
19
11
  return (
20
12
  <ProviderConfig
21
- configItems={[
22
- {
23
- children: (
24
- <Input.Password
25
- autoComplete={'new-password'}
26
- placeholder={t('llm.Google.token.placeholder')}
27
- />
28
- ),
29
- desc: t('llm.Google.token.desc'),
30
- label: t('llm.Google.token.title'),
31
- name: [LLMProviderConfigKey, providerKey, LLMProviderApiTokenKey],
32
- },
33
- {
34
- children: <Checker model={'gemini-pro'} provider={ModelProvider.Google} />,
35
- desc: t('llm.checker.desc'),
36
- label: t('llm.checker.title'),
37
- minWidth: '100%',
38
- },
39
- ]}
40
- provider={providerKey}
13
+ checkModel={'gemini-pro'}
14
+ provider={ModelProvider.Google}
41
15
  title={
42
16
  <Flexbox align={'center'} gap={8} horizontal>
43
17
  <Google.BrandColor size={28} />
@@ -1,44 +1,18 @@
1
1
  import { Groq } from '@lobehub/icons';
2
- import { Input } from 'antd';
3
2
  import { useTheme } from 'antd-style';
4
3
  import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
4
 
7
5
  import { ModelProvider } from '@/libs/agent-runtime';
8
6
 
9
- import Checker from '../components/Checker';
10
7
  import ProviderConfig from '../components/ProviderConfig';
11
- import { LLMProviderApiTokenKey, LLMProviderConfigKey } from '../const';
12
-
13
- const providerKey = 'groq';
14
8
 
15
9
  const GroqProvider = memo(() => {
16
- const { t } = useTranslation('setting');
17
-
18
10
  const theme = useTheme();
19
11
 
20
12
  return (
21
13
  <ProviderConfig
22
- configItems={[
23
- {
24
- children: (
25
- <Input.Password
26
- autoComplete={'new-password'}
27
- placeholder={t('llm.Groq.token.placeholder')}
28
- />
29
- ),
30
- desc: t('llm.Groq.token.desc'),
31
- label: t('llm.Groq.token.title'),
32
- name: [LLMProviderConfigKey, providerKey, LLMProviderApiTokenKey],
33
- },
34
- {
35
- children: <Checker model={'gemma-7b-it'} provider={ModelProvider.Groq} />,
36
- desc: t('llm.checker.desc'),
37
- label: t('llm.checker.title'),
38
- minWidth: '100%',
39
- },
40
- ]}
41
- provider={providerKey}
14
+ checkModel={'gemma-7b-it'}
15
+ provider={ModelProvider.Groq}
42
16
  title={<Groq.Text color={theme.isDarkMode ? theme.colorText : Groq.colorPrimary} size={24} />}
43
17
  />
44
18
  );
@@ -1,44 +1,18 @@
1
1
  import { Mistral } from '@lobehub/icons';
2
- import { Input } from 'antd';
3
2
  import { useTheme } from 'antd-style';
4
3
  import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
4
 
7
5
  import { ModelProvider } from '@/libs/agent-runtime';
8
6
 
9
- import Checker from '../components/Checker';
10
7
  import ProviderConfig from '../components/ProviderConfig';
11
- import { LLMProviderApiTokenKey, LLMProviderConfigKey } from '../const';
12
-
13
- const providerKey = 'mistral';
14
8
 
15
9
  const MistralProvider = memo(() => {
16
- const { t } = useTranslation('setting');
17
-
18
10
  const theme = useTheme();
19
11
 
20
12
  return (
21
13
  <ProviderConfig
22
- configItems={[
23
- {
24
- children: (
25
- <Input.Password
26
- autoComplete={'new-password'}
27
- placeholder={t('llm.Mistral.token.placeholder')}
28
- />
29
- ),
30
- desc: t('llm.Mistral.token.desc'),
31
- label: t('llm.Mistral.token.title'),
32
- name: [LLMProviderConfigKey, providerKey, LLMProviderApiTokenKey],
33
- },
34
- {
35
- children: <Checker model={'open-mistral-7b'} provider={ModelProvider.Mistral} />,
36
- desc: t('llm.checker.desc'),
37
- label: t('llm.checker.title'),
38
- minWidth: '100%',
39
- },
40
- ]}
41
- provider={providerKey}
14
+ checkModel={'open-mistral-7b'}
15
+ provider={ModelProvider.Mistral}
42
16
  title={
43
17
  <Mistral.Combine
44
18
  color={theme.isDarkMode ? theme.colorText : Mistral.colorPrimary}
@@ -1,44 +1,18 @@
1
1
  import { Moonshot } from '@lobehub/icons';
2
- import { Input } from 'antd';
3
2
  import { useTheme } from 'antd-style';
4
3
  import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
4
 
7
5
  import { ModelProvider } from '@/libs/agent-runtime';
8
6
 
9
- import Checker from '../components/Checker';
10
7
  import ProviderConfig from '../components/ProviderConfig';
11
- import { LLMProviderApiTokenKey, LLMProviderConfigKey } from '../const';
12
-
13
- const providerKey = 'moonshot';
14
8
 
15
9
  const MoonshotProvider = memo(() => {
16
- const { t } = useTranslation('setting');
17
-
18
10
  const theme = useTheme();
19
11
 
20
12
  return (
21
13
  <ProviderConfig
22
- configItems={[
23
- {
24
- children: (
25
- <Input.Password
26
- autoComplete={'new-password'}
27
- placeholder={t('llm.Moonshot.token.placeholder')}
28
- />
29
- ),
30
- desc: t('llm.Moonshot.token.desc'),
31
- label: t('llm.Moonshot.token.title'),
32
- name: [LLMProviderConfigKey, providerKey, LLMProviderApiTokenKey],
33
- },
34
- {
35
- children: <Checker model={'moonshot-v1-8k'} provider={ModelProvider.Moonshot} />,
36
- desc: t('llm.checker.desc'),
37
- label: t('llm.checker.title'),
38
- minWidth: '100%',
39
- },
40
- ]}
41
- provider={providerKey}
14
+ checkModel={'moonshot-v1-8k'}
15
+ provider={ModelProvider.Moonshot}
42
16
  title={
43
17
  <Moonshot.Combine
44
18
  color={theme.isDarkMode ? theme.colorText : Moonshot.colorPrimary}