@lobehub/chat 1.4.0 → 1.4.2
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.
- package/CHANGELOG.md +52 -0
- package/docs/self-hosting/advanced/model-list.mdx +1 -1
- package/docs/self-hosting/advanced/model-list.zh-CN.mdx +1 -1
- package/locales/ar/chat.json +2 -0
- package/locales/ar/common.json +9 -0
- package/locales/bg-BG/chat.json +2 -0
- package/locales/bg-BG/common.json +9 -0
- package/locales/de-DE/chat.json +2 -0
- package/locales/de-DE/common.json +9 -0
- package/locales/en-US/chat.json +2 -0
- package/locales/en-US/common.json +11 -2
- package/locales/es-ES/chat.json +2 -0
- package/locales/es-ES/common.json +9 -0
- package/locales/fr-FR/chat.json +2 -0
- package/locales/fr-FR/common.json +9 -0
- package/locales/it-IT/chat.json +2 -0
- package/locales/it-IT/common.json +9 -0
- package/locales/ja-JP/chat.json +2 -0
- package/locales/ja-JP/common.json +9 -0
- package/locales/ko-KR/chat.json +2 -0
- package/locales/ko-KR/common.json +9 -0
- package/locales/nl-NL/chat.json +2 -0
- package/locales/nl-NL/common.json +9 -0
- package/locales/pl-PL/chat.json +2 -0
- package/locales/pl-PL/common.json +9 -0
- package/locales/pt-BR/chat.json +2 -0
- package/locales/pt-BR/common.json +9 -0
- package/locales/ru-RU/chat.json +2 -0
- package/locales/ru-RU/common.json +9 -0
- package/locales/tr-TR/chat.json +2 -0
- package/locales/tr-TR/common.json +9 -0
- package/locales/vi-VN/chat.json +2 -0
- package/locales/vi-VN/common.json +9 -0
- package/locales/vi-VN/setting.json +6 -10
- package/locales/zh-CN/chat.json +2 -0
- package/locales/zh-CN/common.json +9 -0
- package/locales/zh-TW/chat.json +2 -0
- package/locales/zh-TW/common.json +9 -0
- package/next-sitemap.config.mjs +2 -2
- package/package.json +2 -1
- package/src/app/(main)/_layout/Desktop.tsx +19 -12
- package/src/app/(main)/_layout/Mobile.tsx +5 -0
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/TopicContent.tsx +4 -1
- package/src/config/featureFlags/schema.ts +6 -0
- package/src/const/guide.ts +8 -4
- package/src/const/url.ts +2 -1
- package/src/features/AlertBanner/CloudBanner.tsx +91 -0
- package/src/features/ChatInput/ActionBar/Clear.tsx +15 -6
- package/src/features/ChatInput/Topic/index.tsx +44 -9
- package/src/features/User/UserPanel/useMenu.tsx +21 -2
- package/src/libs/agent-runtime/google/index.test.ts +3 -33
- package/src/libs/agent-runtime/google/index.ts +1 -16
- package/src/locales/default/chat.ts +2 -0
- package/src/locales/default/common.ts +10 -0
- package/src/store/serverConfig/selectors.test.ts +1 -0
- package/src/types/user/index.ts +3 -1
- package/src/utils/parseModels.test.ts +3 -3
|
@@ -50,7 +50,7 @@ export class LobeGoogleAI implements LobeRuntimeAI {
|
|
|
50
50
|
|
|
51
51
|
async chat(payload: ChatStreamPayload, options?: ChatCompetitionOptions) {
|
|
52
52
|
try {
|
|
53
|
-
const model =
|
|
53
|
+
const model = payload.model;
|
|
54
54
|
|
|
55
55
|
const contents = this.buildGoogleMessages(payload.messages, model);
|
|
56
56
|
|
|
@@ -197,21 +197,6 @@ export class LobeGoogleAI implements LobeRuntimeAI {
|
|
|
197
197
|
return contents;
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
-
private convertModel = (model: string, messages: OpenAIChatMessage[]) => {
|
|
201
|
-
let finalModel: string = model;
|
|
202
|
-
|
|
203
|
-
if (model.includes('pro-vision')) {
|
|
204
|
-
// if message are all text message, use vision will return an error:
|
|
205
|
-
// "[400 Bad Request] Add an image to use models/gemini-pro-vision, or switch your model to a text model."
|
|
206
|
-
const noNeedVision = messages.every((m) => typeof m.content === 'string');
|
|
207
|
-
|
|
208
|
-
// so we need to downgrade to gemini-pro
|
|
209
|
-
if (noNeedVision) finalModel = 'gemini-pro';
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return finalModel;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
200
|
private parseErrorMessage(message: string): {
|
|
216
201
|
error: any;
|
|
217
202
|
errorType: ILobeAgentRuntimeErrorType;
|
|
@@ -100,6 +100,8 @@ export default {
|
|
|
100
100
|
duplicate: '创建副本',
|
|
101
101
|
export: '导出话题',
|
|
102
102
|
},
|
|
103
|
+
checkOpenNewTopic: '是否开启新话题?',
|
|
104
|
+
checkSaveCurrentMessages: '是否保存当前会话为话题?',
|
|
103
105
|
confirmRemoveAll: '即将删除全部话题,删除后将不可恢复,请谨慎操作。',
|
|
104
106
|
confirmRemoveTopic: '即将删除该话题,删除后将不可恢复,请谨慎操作。',
|
|
105
107
|
confirmRemoveUnstarred: '即将删除未收藏话题,删除后将不可恢复,请谨慎操作。',
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
about: '关于',
|
|
3
3
|
advanceSettings: '高级设置',
|
|
4
|
+
alert: {
|
|
5
|
+
cloud: {
|
|
6
|
+
action: '立即体验',
|
|
7
|
+
desc: '我们为所有注册用户提供了免费的 {{credit}} 额度计算积分,无需复杂配置开箱即用, 支持全局云同步与进阶联网查询,更多高级特性等你探索。',
|
|
8
|
+
descOnMobile:
|
|
9
|
+
'我们为所有注册用户提供了免费的 {{credit}} 额度计算积分,无需复杂配置开箱即用。',
|
|
10
|
+
title: '{{name}} 开始公测',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
4
13
|
appInitializing: '应用启动中,请耐心等待...',
|
|
5
14
|
autoGenerate: '自动补全',
|
|
6
15
|
autoGenerateTooltip: '基于提示词自动补全助手描述',
|
|
@@ -198,6 +207,7 @@ export default {
|
|
|
198
207
|
userPanel: {
|
|
199
208
|
anonymousNickName: '匿名用户',
|
|
200
209
|
billing: '账单管理',
|
|
210
|
+
cloud: '体验 {{name}}',
|
|
201
211
|
data: '数据存储',
|
|
202
212
|
defaultNickname: '社区版用户',
|
|
203
213
|
discord: '社区支持',
|
package/src/types/user/index.ts
CHANGED
|
@@ -49,14 +49,14 @@ describe('parseModelString', () => {
|
|
|
49
49
|
|
|
50
50
|
it('multi models', () => {
|
|
51
51
|
const result = parseModelString(
|
|
52
|
-
'gemini-
|
|
52
|
+
'gemini-1.5-flash-latest=Gemini 1.5 Flash<16000:vision>,gpt-4-all=ChatGPT Plus<128000:fc:vision:file>',
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
expect(result.add).toEqual([
|
|
56
56
|
{
|
|
57
|
-
displayName: 'Gemini
|
|
57
|
+
displayName: 'Gemini 1.5 Flash',
|
|
58
58
|
vision: true,
|
|
59
|
-
id: 'gemini-
|
|
59
|
+
id: 'gemini-1.5-flash-latest',
|
|
60
60
|
tokens: 16000,
|
|
61
61
|
},
|
|
62
62
|
{
|