@lobehub/chat 1.88.1 → 1.88.3
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 +58 -0
- package/changelog/v1.json +21 -0
- package/locales/ar/models.json +6 -0
- package/locales/ar/plugin.json +1 -0
- package/locales/bg-BG/models.json +6 -0
- package/locales/bg-BG/plugin.json +1 -0
- package/locales/de-DE/models.json +6 -0
- package/locales/de-DE/plugin.json +1 -0
- package/locales/en-US/models.json +6 -0
- package/locales/en-US/plugin.json +1 -0
- package/locales/es-ES/models.json +6 -0
- package/locales/es-ES/plugin.json +1 -0
- package/locales/fa-IR/models.json +6 -0
- package/locales/fa-IR/plugin.json +1 -0
- package/locales/fr-FR/models.json +6 -0
- package/locales/fr-FR/plugin.json +1 -0
- package/locales/it-IT/models.json +6 -0
- package/locales/it-IT/plugin.json +1 -0
- package/locales/ja-JP/models.json +6 -0
- package/locales/ja-JP/plugin.json +1 -0
- package/locales/ko-KR/models.json +6 -0
- package/locales/ko-KR/plugin.json +1 -0
- package/locales/nl-NL/models.json +6 -0
- package/locales/nl-NL/plugin.json +1 -0
- package/locales/pl-PL/models.json +6 -0
- package/locales/pl-PL/plugin.json +1 -0
- package/locales/pt-BR/models.json +6 -0
- package/locales/pt-BR/plugin.json +1 -0
- package/locales/ru-RU/models.json +6 -0
- package/locales/ru-RU/plugin.json +1 -0
- package/locales/tr-TR/models.json +6 -0
- package/locales/tr-TR/plugin.json +3 -2
- package/locales/vi-VN/models.json +6 -0
- package/locales/vi-VN/plugin.json +1 -0
- package/locales/zh-CN/models.json +7 -1
- package/locales/zh-CN/plugin.json +1 -0
- package/locales/zh-TW/models.json +6 -0
- package/locales/zh-TW/plugin.json +1 -0
- package/package.json +1 -1
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/WelcomeMessage.tsx +5 -1
- package/src/config/aiModels/anthropic.ts +41 -41
- package/src/config/aiModels/google.ts +70 -1
- package/src/config/aiModels/hunyuan.ts +15 -2
- package/src/config/aiModels/novita.ts +12 -12
- package/src/config/aiModels/xai.ts +38 -43
- package/src/libs/model-runtime/anthropic/index.test.ts +23 -10
- package/src/libs/model-runtime/anthropic/index.ts +20 -8
- package/src/libs/model-runtime/google/index.ts +5 -0
- package/src/libs/model-runtime/xai/index.test.ts +0 -4
- package/src/libs/model-runtime/xai/index.ts +23 -3
- package/src/libs/oidc-provider/provider.ts +1 -1
- package/src/locales/default/plugin.ts +1 -0
@@ -10,16 +10,36 @@ export interface XAIModelCard {
|
|
10
10
|
export const LobeXAI = LobeOpenAICompatibleFactory({
|
11
11
|
baseURL: 'https://api.x.ai/v1',
|
12
12
|
chatCompletion: {
|
13
|
-
// xAI API does not support stream_options: { include_usage: true }
|
14
|
-
excludeUsage: true,
|
15
13
|
handlePayload: (payload) => {
|
16
|
-
const { frequency_penalty, model, presence_penalty, ...rest } = payload;
|
14
|
+
const { enabledSearch, frequency_penalty, model, presence_penalty, ...rest } = payload;
|
17
15
|
|
18
16
|
return {
|
19
17
|
...rest,
|
20
18
|
frequency_penalty: model.includes('grok-3-mini') ? undefined : frequency_penalty,
|
21
19
|
model,
|
22
20
|
presence_penalty: model.includes('grok-3-mini') ? undefined : presence_penalty,
|
21
|
+
stream: true,
|
22
|
+
...(enabledSearch && {
|
23
|
+
search_parameters: {
|
24
|
+
max_search_results: Math.min(Math.max(parseInt(process.env.XAI_MAX_SEARCH_RESULTS ?? '15', 10), 1), 30),
|
25
|
+
mode: 'auto',
|
26
|
+
return_citations: true,
|
27
|
+
sources: [
|
28
|
+
{
|
29
|
+
safe_search: process.env.XAI_SAFE_SEARCH === '1',
|
30
|
+
type: 'news',
|
31
|
+
},
|
32
|
+
/*
|
33
|
+
{ type: 'rss' },
|
34
|
+
*/
|
35
|
+
{
|
36
|
+
safe_search: process.env.XAI_SAFE_SEARCH === '1',
|
37
|
+
type: 'web',
|
38
|
+
},
|
39
|
+
{ type: 'x' },
|
40
|
+
],
|
41
|
+
},
|
42
|
+
}),
|
23
43
|
} as any;
|
24
44
|
},
|
25
45
|
},
|
@@ -256,7 +256,7 @@ export const createOIDCProvider = async (db: LobeChatDatabase): Promise<Provider
|
|
256
256
|
|
257
257
|
// 8. 令牌有效期
|
258
258
|
ttl: {
|
259
|
-
AccessToken:
|
259
|
+
AccessToken: 7 * 24 * 60 * 60, // 1 week temporarily,need to revert 1 hour with better implement
|
260
260
|
AuthorizationCode: 600, // 10 minutes
|
261
261
|
DeviceCode: 600, // 10 minutes (if enabled)
|
262
262
|
|