@lobehub/chat 1.36.33 → 1.36.34
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 +25 -0
- package/README.ja-JP.md +150 -115
- package/README.md +63 -28
- package/README.zh-CN.md +65 -30
- package/changelog/v1.json +9 -0
- package/locales/ar/models.json +0 -24
- package/locales/ar/providers.json +10 -4
- package/locales/bg-BG/models.json +0 -24
- package/locales/bg-BG/providers.json +10 -4
- package/locales/de-DE/models.json +0 -24
- package/locales/de-DE/providers.json +10 -4
- package/locales/en-US/models.json +0 -24
- package/locales/en-US/providers.json +10 -4
- package/locales/es-ES/models.json +0 -24
- package/locales/es-ES/providers.json +10 -4
- package/locales/fa-IR/models.json +0 -24
- package/locales/fa-IR/providers.json +10 -4
- package/locales/fr-FR/models.json +0 -24
- package/locales/fr-FR/providers.json +10 -4
- package/locales/it-IT/models.json +0 -24
- package/locales/it-IT/providers.json +10 -4
- package/locales/ja-JP/models.json +0 -24
- package/locales/ja-JP/providers.json +10 -4
- package/locales/ko-KR/models.json +0 -24
- package/locales/ko-KR/providers.json +10 -4
- package/locales/nl-NL/models.json +0 -24
- package/locales/nl-NL/providers.json +10 -4
- package/locales/pl-PL/models.json +0 -24
- package/locales/pl-PL/providers.json +10 -4
- package/locales/pt-BR/models.json +0 -24
- package/locales/pt-BR/providers.json +10 -4
- package/locales/ru-RU/models.json +0 -24
- package/locales/ru-RU/providers.json +10 -4
- package/locales/tr-TR/models.json +0 -24
- package/locales/tr-TR/providers.json +10 -4
- package/locales/vi-VN/models.json +0 -24
- package/locales/vi-VN/providers.json +10 -4
- package/locales/zh-CN/models.json +4 -28
- package/locales/zh-CN/providers.json +10 -4
- package/locales/zh-TW/models.json +0 -24
- package/locales/zh-TW/providers.json +10 -4
- package/package.json +1 -1
- package/scripts/readmeWorkflow/const.ts +22 -8
- package/scripts/readmeWorkflow/index.ts +2 -0
- package/scripts/readmeWorkflow/syncAgentIndex.ts +36 -28
- package/scripts/readmeWorkflow/syncPluginIndex.ts +28 -15
- package/scripts/readmeWorkflow/syncProviderIndex.ts +51 -0
- package/scripts/readmeWorkflow/utlis.ts +23 -12
- package/src/config/modelProviders/ai21.ts +1 -0
- package/src/config/modelProviders/cloudflare.ts +1 -2
- package/src/config/modelProviders/higress.ts +2 -1
- package/src/config/modelProviders/sensenova.ts +6 -3
- package/src/features/FileViewer/index.tsx +1 -1
- package/src/locales/default/models.ts +1 -0
- package/src/locales/default/providers.ts +1 -0
@@ -1,47 +1,55 @@
|
|
1
1
|
import { consola } from 'consola';
|
2
2
|
import { markdownTable } from 'markdown-table';
|
3
|
-
import
|
3
|
+
import urlJoin from 'url-join';
|
4
4
|
|
5
|
-
import {
|
6
|
-
import {
|
5
|
+
import { AGENT_SPLIT, DataItem } from './const';
|
6
|
+
import {
|
7
|
+
fetchAgentIndex,
|
8
|
+
genLink,
|
9
|
+
genTags,
|
10
|
+
getTitle,
|
11
|
+
readReadme,
|
12
|
+
updateReadme,
|
13
|
+
writeReadme,
|
14
|
+
} from './utlis';
|
7
15
|
|
8
|
-
const genAgentTable = (data: DataItem[], lang
|
9
|
-
const
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
...content,
|
26
|
-
]);
|
16
|
+
const genAgentTable = (data: DataItem[], lang?: string) => {
|
17
|
+
const title = getTitle(lang);
|
18
|
+
|
19
|
+
const content = data
|
20
|
+
.slice(0, 4)
|
21
|
+
.map((item) => [
|
22
|
+
[
|
23
|
+
genLink(
|
24
|
+
item.meta.title.replaceAll('|', ','),
|
25
|
+
urlJoin('https://lobechat.com/discover/assistant', item.identifier),
|
26
|
+
),
|
27
|
+
`<sup>By **${genLink(item.author, item.homepage)}** on **${(item as any).createdAt}**</sup>`,
|
28
|
+
].join('<br/>'),
|
29
|
+
[item.meta.description.replaceAll('|', ','), genTags(item.meta.tags)].join('<br/>'),
|
30
|
+
]);
|
31
|
+
|
32
|
+
return markdownTable([title, ...content]);
|
27
33
|
};
|
28
34
|
|
29
|
-
const runAgentTable = async (lang
|
35
|
+
const runAgentTable = async (lang?: string) => {
|
30
36
|
const data = await fetchAgentIndex(lang);
|
31
37
|
const md = readReadme(lang);
|
32
38
|
const mdTable = genAgentTable(data, lang);
|
33
39
|
const newMd = updateReadme(
|
34
40
|
AGENT_SPLIT,
|
35
41
|
md,
|
36
|
-
[
|
37
|
-
|
38
|
-
|
42
|
+
[
|
43
|
+
mdTable,
|
44
|
+
`> 📊 Total agents: ${genLink(`<kbd>**${data.length}**</kbd> `, 'https://lobechat.com/discover/assistants')}`,
|
45
|
+
].join('\n\n'),
|
39
46
|
);
|
40
47
|
writeReadme(newMd, lang);
|
41
|
-
consola.success(
|
48
|
+
consola.success(`Sync ${lang || 'en-US'} agent index success!`);
|
42
49
|
};
|
43
50
|
|
44
51
|
export default async () => {
|
45
|
-
await runAgentTable(
|
52
|
+
await runAgentTable();
|
46
53
|
await runAgentTable('zh-CN');
|
54
|
+
await runAgentTable('ja-JP');
|
47
55
|
};
|
@@ -1,42 +1,55 @@
|
|
1
1
|
import { consola } from 'consola';
|
2
2
|
import { markdownTable } from 'markdown-table';
|
3
|
+
import urlJoin from 'url-join';
|
3
4
|
|
4
|
-
import { DataItem,
|
5
|
-
import {
|
5
|
+
import { DataItem, PLUGIN_SPLIT } from './const';
|
6
|
+
import {
|
7
|
+
fetchPluginIndex,
|
8
|
+
genLink,
|
9
|
+
genTags,
|
10
|
+
getTitle,
|
11
|
+
readReadme,
|
12
|
+
updateReadme,
|
13
|
+
writeReadme,
|
14
|
+
} from './utlis';
|
15
|
+
|
16
|
+
const genPluginTable = (data: DataItem[], lang?: string) => {
|
17
|
+
const title = getTitle(lang);
|
6
18
|
|
7
|
-
const genPluginTable = (data: DataItem[], lang: string) => {
|
8
|
-
const isCN = lang === 'zh-CN';
|
9
19
|
const content = data
|
10
20
|
.slice(0, 4)
|
11
21
|
.map((item) => [
|
12
22
|
[
|
13
|
-
genLink(
|
23
|
+
genLink(
|
24
|
+
item.meta.title.replaceAll('|', ','),
|
25
|
+
urlJoin('https://lobechat.com/discover/plugin', item.identifier),
|
26
|
+
),
|
14
27
|
`<sup>By **${item.author}** on **${item.createdAt}**</sup>`,
|
15
28
|
].join('<br/>'),
|
16
29
|
[item.meta.description.replaceAll('|', ','), genTags(item.meta.tags)].join('<br/>'),
|
17
30
|
]);
|
18
|
-
|
19
|
-
|
20
|
-
...content,
|
21
|
-
]);
|
31
|
+
|
32
|
+
return markdownTable([title, ...content]);
|
22
33
|
};
|
23
34
|
|
24
|
-
const runPluginTable = async (lang
|
35
|
+
const runPluginTable = async (lang?: string) => {
|
25
36
|
const data = await fetchPluginIndex(lang);
|
26
37
|
const md = readReadme(lang);
|
27
38
|
const mdTable = genPluginTable(data, lang);
|
28
39
|
const newMd = updateReadme(
|
29
40
|
PLUGIN_SPLIT,
|
30
41
|
md,
|
31
|
-
[
|
32
|
-
|
33
|
-
|
42
|
+
[
|
43
|
+
mdTable,
|
44
|
+
`> 📊 Total plugins: ${genLink(`<kbd>**${data.length}**</kbd>`, 'https://lobechat.com/discover/plugins')}`,
|
45
|
+
].join('\n\n'),
|
34
46
|
);
|
35
47
|
writeReadme(newMd, lang);
|
36
|
-
consola.success(
|
48
|
+
consola.success(`Sync ${lang || 'en-US'} plugin index success!`);
|
37
49
|
};
|
38
50
|
|
39
51
|
export default async () => {
|
40
|
-
await runPluginTable(
|
52
|
+
await runPluginTable();
|
41
53
|
await runPluginTable('zh-CN');
|
54
|
+
await runPluginTable('ja-JP');
|
42
55
|
};
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { consola } from 'consola';
|
2
|
+
import { readJSONSync } from 'fs-extra';
|
3
|
+
import { resolve } from 'node:path';
|
4
|
+
import urlJoin from 'url-join';
|
5
|
+
|
6
|
+
import { PROVIDER_LIST, PROVIDER_SPLIT, root } from './const';
|
7
|
+
import { genLink, readReadme, updateReadme, writeReadme } from './utlis';
|
8
|
+
|
9
|
+
const genProviderTable = (data: { desc?: string; id: string; name: string }) => {
|
10
|
+
const title = genLink(data.name, urlJoin('https://lobechat.com/discover/provider', data.id));
|
11
|
+
|
12
|
+
return ['-', `**${title}**:`, data.desc].join(' ');
|
13
|
+
};
|
14
|
+
|
15
|
+
const runProviderTable = async (lang?: string) => {
|
16
|
+
const md = readReadme(lang);
|
17
|
+
const desc = readJSONSync(resolve(root, 'locales', lang || 'en-US', 'providers.json'));
|
18
|
+
const newMd = updateReadme(
|
19
|
+
PROVIDER_SPLIT,
|
20
|
+
md,
|
21
|
+
[
|
22
|
+
PROVIDER_LIST.slice(0, 10)
|
23
|
+
.map((item) =>
|
24
|
+
genProviderTable({
|
25
|
+
...item,
|
26
|
+
desc: desc?.[item.id]?.description,
|
27
|
+
}),
|
28
|
+
)
|
29
|
+
.join('\n'),
|
30
|
+
`<details><summary><kbd>See more providers (+${PROVIDER_LIST.length - 10})</kbd></summary>`,
|
31
|
+
PROVIDER_LIST.slice(10, PROVIDER_LIST.length)
|
32
|
+
.map((item) =>
|
33
|
+
genProviderTable({
|
34
|
+
...item,
|
35
|
+
desc: desc?.[item.id]?.description,
|
36
|
+
}),
|
37
|
+
)
|
38
|
+
.join('\n'),
|
39
|
+
'</details>',
|
40
|
+
`> 📊 Total providers: ${genLink(`<kbd>**${PROVIDER_LIST.length}**</kbd>`, 'https://lobechat.com/discover/providers')}`,
|
41
|
+
].join('\n\n'),
|
42
|
+
);
|
43
|
+
writeReadme(newMd, lang);
|
44
|
+
consola.success(`Sync ${lang || 'en-US'} provider index success!`);
|
45
|
+
};
|
46
|
+
|
47
|
+
export default async () => {
|
48
|
+
await runProviderTable();
|
49
|
+
await runProviderTable('zh-CN');
|
50
|
+
await runProviderTable('ja-JP');
|
51
|
+
};
|
@@ -2,23 +2,21 @@ import { kebabCase } from 'lodash';
|
|
2
2
|
import { readFileSync, writeFileSync } from 'node:fs';
|
3
3
|
import { resolve } from 'node:path';
|
4
4
|
|
5
|
-
import {
|
5
|
+
import { AGENT_I18N_URL, AGENT_URL, PLUGIN_I18N_URL, PLUGIN_URL, root } from './const';
|
6
6
|
|
7
7
|
const fetchIndex = async (url: string) => {
|
8
8
|
const res = await fetch(url);
|
9
9
|
return await res.json();
|
10
10
|
};
|
11
11
|
|
12
|
-
export const fetchAgentIndex = async (lang
|
13
|
-
const
|
14
|
-
const url = isCN ? AGENT_CN_URL : AGENT_EN_URL;
|
12
|
+
export const fetchAgentIndex = async (lang?: string) => {
|
13
|
+
const url = lang ? AGENT_I18N_URL(lang) : AGENT_URL;
|
15
14
|
const data = await fetchIndex(url);
|
16
15
|
return data.agents;
|
17
16
|
};
|
18
17
|
|
19
|
-
export const fetchPluginIndex = async (lang
|
20
|
-
const
|
21
|
-
const url = isCN ? PLUGIN_CN_URL : PLUGIN_EN_URL;
|
18
|
+
export const fetchPluginIndex = async (lang?: string) => {
|
19
|
+
const url = lang ? PLUGIN_I18N_URL(lang) : PLUGIN_URL;
|
22
20
|
const data = await fetchIndex(url);
|
23
21
|
return data.plugins;
|
24
22
|
};
|
@@ -31,16 +29,15 @@ export const genTags = (tags: string[]) =>
|
|
31
29
|
.map((tag) => `\`${kebabCase(tag)}\``)
|
32
30
|
.join(' ');
|
33
31
|
|
34
|
-
const getReadmePath = (lang
|
35
|
-
|
36
|
-
return resolve(__dirname, '../../', isCN ? `./README.zh-CN.md` : `./README.md`);
|
32
|
+
const getReadmePath = (lang?: string) => {
|
33
|
+
return resolve(root, lang ? `./README.${lang}.md` : `./README.md`);
|
37
34
|
};
|
38
35
|
|
39
|
-
export const readReadme = (lang
|
36
|
+
export const readReadme = (lang?: string): string => {
|
40
37
|
return readFileSync(getReadmePath(lang), 'utf8');
|
41
38
|
};
|
42
39
|
|
43
|
-
export const writeReadme = (content: string, lang
|
40
|
+
export const writeReadme = (content: string, lang?: string) => {
|
44
41
|
writeFileSync(getReadmePath(lang), content, 'utf8');
|
45
42
|
};
|
46
43
|
|
@@ -50,3 +47,17 @@ export const updateReadme = (split: string, md: string, content: string): string
|
|
50
47
|
|
51
48
|
return mds.join(split);
|
52
49
|
};
|
50
|
+
|
51
|
+
export const getTitle = (lang?: string) => {
|
52
|
+
switch (lang) {
|
53
|
+
case 'zh-CN': {
|
54
|
+
return ['最近新增', '描述'];
|
55
|
+
}
|
56
|
+
case 'ja-JP': {
|
57
|
+
return ['最近追加', '説明'];
|
58
|
+
}
|
59
|
+
default: {
|
60
|
+
return ['Recent Submits', 'Description'];
|
61
|
+
}
|
62
|
+
}
|
63
|
+
};
|
@@ -69,8 +69,6 @@ const Cloudflare: ModelProviderCard = {
|
|
69
69
|
tokens: 32_768,
|
70
70
|
},
|
71
71
|
{
|
72
|
-
description:
|
73
|
-
'Generation over generation, Meta Llama 3 demonstrates state-of-the-art performance on a wide range of industry benchmarks and offers new capabilities, including improved reasoning.\t',
|
74
72
|
displayName: 'meta-llama-3-8b-instruct',
|
75
73
|
enabled: true,
|
76
74
|
functionCall: false,
|
@@ -78,6 +76,7 @@ const Cloudflare: ModelProviderCard = {
|
|
78
76
|
},
|
79
77
|
],
|
80
78
|
checkModel: '@hf/meta-llama/meta-llama-3-8b-instruct',
|
79
|
+
description: '在 Cloudflare 的全球网络上运行由无服务器 GPU 驱动的机器学习模型。',
|
81
80
|
disableBrowserRequest: true,
|
82
81
|
id: 'cloudflare',
|
83
82
|
modelList: {
|
@@ -2464,7 +2464,8 @@ const Higress: ModelProviderCard = {
|
|
2464
2464
|
},
|
2465
2465
|
],
|
2466
2466
|
checkModel: 'qwen-max',
|
2467
|
-
description:
|
2467
|
+
description:
|
2468
|
+
'Higress 是一款云原生 API 网关,在阿里内部为解决 Tengine reload 对长连接业务有损,以及 gRPC/Dubbo 负载均衡能力不足而诞生。',
|
2468
2469
|
id: 'higress',
|
2469
2470
|
modelList: { showModelFetcher: true },
|
2470
2471
|
modelsUrl: 'https://higress.cn/',
|
@@ -5,7 +5,8 @@ import { ModelProviderCard } from '@/types/llm';
|
|
5
5
|
const SenseNova: ModelProviderCard = {
|
6
6
|
chatModels: [
|
7
7
|
{
|
8
|
-
description:
|
8
|
+
description:
|
9
|
+
'最新版本模型 (V5.5),128K上下文长度,在数学推理、英文对话、指令跟随以及长文本理解等领域能力显著提升,比肩GPT-4o',
|
9
10
|
displayName: 'SenseChat 5.5',
|
10
11
|
enabled: true,
|
11
12
|
functionCall: true,
|
@@ -17,7 +18,7 @@ const SenseNova: ModelProviderCard = {
|
|
17
18
|
},
|
18
19
|
tokens: 131_072,
|
19
20
|
},
|
20
|
-
/*
|
21
|
+
/*
|
21
22
|
// Not compatible with local mode (Not support Base64 Image)
|
22
23
|
{
|
23
24
|
description: '最新版本模型 (V5.5),16K上下文长度,支持多图的输入,全面实现模型基础能力优化,在对象属性识别、空间关系、动作事件识别、场景理解、情感识别、逻辑常识推理和文本理解生成上都实现了较大提升。',
|
@@ -46,7 +47,8 @@ const SenseNova: ModelProviderCard = {
|
|
46
47
|
tokens: 32_768,
|
47
48
|
},
|
48
49
|
{
|
49
|
-
description:
|
50
|
+
description:
|
51
|
+
'32K上下文长度,在粤语的对话理解上超越了GPT-4,在知识、推理、数学及代码编写等多个领域均能与GPT-4 Turbo相媲美',
|
50
52
|
displayName: 'SenseChat 5.0 Cantonese',
|
51
53
|
id: 'SenseChat-5-Cantonese',
|
52
54
|
pricing: {
|
@@ -116,6 +118,7 @@ const SenseNova: ModelProviderCard = {
|
|
116
118
|
},
|
117
119
|
],
|
118
120
|
checkModel: 'SenseChat-Turbo',
|
121
|
+
description: '商汤日日新,依托商汤大装置的强大的基础支撑,提供高效易用的全栈大模型服务。',
|
119
122
|
disableBrowserRequest: true,
|
120
123
|
id: 'sensenova',
|
121
124
|
modelList: { showModelFetcher: true },
|
@@ -24,7 +24,7 @@ interface FileViewerProps extends FileListItem {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
const FileViewer = memo<FileViewerProps>(({ id, style, fileType, url, name }) => {
|
27
|
-
if (fileType === 'pdf' || name.endsWith('.pdf')) {
|
27
|
+
if (fileType?.toLowerCase() === 'pdf' || name?.toLowerCase().endsWith('.pdf')) {
|
28
28
|
return <PDFRenderer fileId={id} url={url} />;
|
29
29
|
}
|
30
30
|
|