@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.
Files changed (52) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/changelog/v1.json +21 -0
  3. package/locales/ar/models.json +6 -0
  4. package/locales/ar/plugin.json +1 -0
  5. package/locales/bg-BG/models.json +6 -0
  6. package/locales/bg-BG/plugin.json +1 -0
  7. package/locales/de-DE/models.json +6 -0
  8. package/locales/de-DE/plugin.json +1 -0
  9. package/locales/en-US/models.json +6 -0
  10. package/locales/en-US/plugin.json +1 -0
  11. package/locales/es-ES/models.json +6 -0
  12. package/locales/es-ES/plugin.json +1 -0
  13. package/locales/fa-IR/models.json +6 -0
  14. package/locales/fa-IR/plugin.json +1 -0
  15. package/locales/fr-FR/models.json +6 -0
  16. package/locales/fr-FR/plugin.json +1 -0
  17. package/locales/it-IT/models.json +6 -0
  18. package/locales/it-IT/plugin.json +1 -0
  19. package/locales/ja-JP/models.json +6 -0
  20. package/locales/ja-JP/plugin.json +1 -0
  21. package/locales/ko-KR/models.json +6 -0
  22. package/locales/ko-KR/plugin.json +1 -0
  23. package/locales/nl-NL/models.json +6 -0
  24. package/locales/nl-NL/plugin.json +1 -0
  25. package/locales/pl-PL/models.json +6 -0
  26. package/locales/pl-PL/plugin.json +1 -0
  27. package/locales/pt-BR/models.json +6 -0
  28. package/locales/pt-BR/plugin.json +1 -0
  29. package/locales/ru-RU/models.json +6 -0
  30. package/locales/ru-RU/plugin.json +1 -0
  31. package/locales/tr-TR/models.json +6 -0
  32. package/locales/tr-TR/plugin.json +3 -2
  33. package/locales/vi-VN/models.json +6 -0
  34. package/locales/vi-VN/plugin.json +1 -0
  35. package/locales/zh-CN/models.json +7 -1
  36. package/locales/zh-CN/plugin.json +1 -0
  37. package/locales/zh-TW/models.json +6 -0
  38. package/locales/zh-TW/plugin.json +1 -0
  39. package/package.json +1 -1
  40. package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/WelcomeMessage.tsx +5 -1
  41. package/src/config/aiModels/anthropic.ts +41 -41
  42. package/src/config/aiModels/google.ts +70 -1
  43. package/src/config/aiModels/hunyuan.ts +15 -2
  44. package/src/config/aiModels/novita.ts +12 -12
  45. package/src/config/aiModels/xai.ts +38 -43
  46. package/src/libs/model-runtime/anthropic/index.test.ts +23 -10
  47. package/src/libs/model-runtime/anthropic/index.ts +20 -8
  48. package/src/libs/model-runtime/google/index.ts +5 -0
  49. package/src/libs/model-runtime/xai/index.test.ts +0 -4
  50. package/src/libs/model-runtime/xai/index.ts +23 -3
  51. package/src/libs/oidc-provider/provider.ts +1 -1
  52. package/src/locales/default/plugin.ts +1 -0
@@ -10,8 +10,4 @@ testProvider({
10
10
  defaultBaseURL: 'https://api.x.ai/v1',
11
11
  chatDebugEnv: 'DEBUG_XAI_CHAT_COMPLETION',
12
12
  chatModel: 'grok',
13
-
14
- test: {
15
- skipAPICall: true,
16
- },
17
13
  });
@@ -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: 3600, // 1 hour in seconds
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
 
@@ -234,6 +234,7 @@ export default {
234
234
  pluginList: '插件列表',
235
235
  search: {
236
236
  apiName: {
237
+ crawlMultiPages: '读取多个页面内容',
237
238
  crawlSinglePage: '读取页面内容',
238
239
  search: '搜索页面',
239
240
  },