@lobehub/lobehub 2.0.0-next.186 → 2.0.0-next.188

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 (140) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/locales/ar/models.json +89 -5
  4. package/locales/ar/plugin.json +5 -0
  5. package/locales/ar/providers.json +1 -0
  6. package/locales/bg-BG/models.json +68 -0
  7. package/locales/bg-BG/plugin.json +5 -0
  8. package/locales/bg-BG/providers.json +1 -0
  9. package/locales/de-DE/models.json +85 -0
  10. package/locales/de-DE/plugin.json +5 -0
  11. package/locales/de-DE/providers.json +1 -0
  12. package/locales/en-US/models.json +11 -10
  13. package/locales/en-US/plugin.json +5 -0
  14. package/locales/en-US/providers.json +1 -0
  15. package/locales/es-ES/models.json +72 -0
  16. package/locales/es-ES/plugin.json +5 -0
  17. package/locales/es-ES/providers.json +1 -0
  18. package/locales/fa-IR/models.json +86 -0
  19. package/locales/fa-IR/plugin.json +5 -0
  20. package/locales/fa-IR/providers.json +1 -0
  21. package/locales/fr-FR/models.json +49 -0
  22. package/locales/fr-FR/plugin.json +5 -0
  23. package/locales/fr-FR/providers.json +1 -0
  24. package/locales/it-IT/models.json +82 -0
  25. package/locales/it-IT/plugin.json +5 -0
  26. package/locales/it-IT/providers.json +1 -0
  27. package/locales/ja-JP/models.json +42 -5
  28. package/locales/ja-JP/plugin.json +5 -0
  29. package/locales/ja-JP/providers.json +1 -0
  30. package/locales/ko-KR/models.json +54 -0
  31. package/locales/ko-KR/plugin.json +5 -0
  32. package/locales/ko-KR/providers.json +1 -0
  33. package/locales/nl-NL/models.json +12 -1
  34. package/locales/nl-NL/plugin.json +5 -0
  35. package/locales/nl-NL/providers.json +1 -0
  36. package/locales/pl-PL/models.json +46 -0
  37. package/locales/pl-PL/plugin.json +5 -0
  38. package/locales/pl-PL/providers.json +1 -0
  39. package/locales/pt-BR/models.json +59 -0
  40. package/locales/pt-BR/plugin.json +5 -0
  41. package/locales/pt-BR/providers.json +1 -0
  42. package/locales/ru-RU/models.json +85 -0
  43. package/locales/ru-RU/plugin.json +5 -0
  44. package/locales/ru-RU/providers.json +1 -0
  45. package/locales/tr-TR/models.json +81 -0
  46. package/locales/tr-TR/plugin.json +5 -0
  47. package/locales/tr-TR/providers.json +1 -0
  48. package/locales/vi-VN/models.json +54 -0
  49. package/locales/vi-VN/plugin.json +5 -0
  50. package/locales/vi-VN/providers.json +1 -0
  51. package/locales/zh-CN/models.json +42 -5
  52. package/locales/zh-CN/plugin.json +5 -0
  53. package/locales/zh-CN/providers.json +1 -0
  54. package/locales/zh-TW/models.json +85 -0
  55. package/locales/zh-TW/plugin.json +5 -0
  56. package/locales/zh-TW/providers.json +1 -0
  57. package/package.json +1 -1
  58. package/packages/builtin-tool-gtd/src/manifest.ts +13 -8
  59. package/packages/builtin-tool-gtd/src/systemRole.ts +54 -19
  60. package/packages/builtin-tool-knowledge-base/package.json +1 -0
  61. package/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx +97 -0
  62. package/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx +75 -0
  63. package/packages/builtin-tool-knowledge-base/src/client/Inspector/index.ts +11 -0
  64. package/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx +12 -12
  65. package/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/index.tsx +16 -25
  66. package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/Item/index.tsx +21 -47
  67. package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/index.tsx +19 -31
  68. package/packages/builtin-tool-knowledge-base/src/client/Render/index.ts +0 -5
  69. package/packages/builtin-tool-knowledge-base/src/client/index.ts +5 -1
  70. package/packages/builtin-tool-knowledge-base/src/executor/index.ts +119 -0
  71. package/packages/builtin-tool-local-system/package.json +1 -0
  72. package/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx +44 -29
  73. package/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx +20 -18
  74. package/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx +76 -0
  75. package/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx +8 -32
  76. package/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx +62 -0
  77. package/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx +17 -11
  78. package/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx +61 -0
  79. package/packages/builtin-tool-local-system/src/client/Inspector/index.ts +6 -0
  80. package/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx +6 -1
  81. package/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/SearchView.tsx +19 -31
  82. package/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx +2 -42
  83. package/packages/builtin-tool-local-system/src/client/Render/index.ts +0 -2
  84. package/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsx +56 -0
  85. package/packages/builtin-tool-local-system/src/client/components/index.ts +2 -0
  86. package/packages/builtin-tool-local-system/src/executor/index.ts +435 -0
  87. package/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx +32 -5
  88. package/packages/fetch-sse/src/__tests__/request.test.ts +608 -0
  89. package/packages/model-bank/src/aiModels/aihubmix.ts +44 -8
  90. package/packages/model-bank/src/aiModels/google.ts +49 -17
  91. package/packages/model-bank/src/aiModels/hunyuan.ts +20 -0
  92. package/packages/model-bank/src/aiModels/infiniai.ts +48 -7
  93. package/packages/model-bank/src/aiModels/lobehub.ts +13 -11
  94. package/packages/model-bank/src/aiModels/minimax.ts +46 -2
  95. package/packages/model-bank/src/aiModels/ollamacloud.ts +40 -5
  96. package/packages/model-bank/src/aiModels/openai.ts +6 -3
  97. package/packages/model-bank/src/aiModels/qwen.ts +1 -1
  98. package/packages/model-bank/src/aiModels/siliconcloud.ts +60 -0
  99. package/packages/model-bank/src/aiModels/vertexai.ts +77 -44
  100. package/packages/model-bank/src/aiModels/volcengine.ts +111 -2
  101. package/packages/model-bank/src/aiModels/zenmux.ts +19 -13
  102. package/packages/model-bank/src/aiModels/zhipu.ts +64 -2
  103. package/packages/model-bank/src/types/aiModel.ts +3 -0
  104. package/packages/model-runtime/src/core/contextBuilders/google.test.ts +84 -0
  105. package/packages/model-runtime/src/core/contextBuilders/google.ts +37 -1
  106. package/packages/model-runtime/src/providers/volcengine/index.ts +2 -1
  107. package/packages/model-runtime/src/providers/zhipu/index.test.ts +0 -27
  108. package/packages/model-runtime/src/providers/zhipu/index.ts +1 -1
  109. package/packages/model-runtime/src/utils/modelParse.ts +26 -21
  110. package/packages/types/src/agent/chatConfig.ts +6 -2
  111. package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +40 -1
  112. package/src/features/ChatInput/ActionBar/Model/GPT52ProReasoningEffortSlider.tsx +59 -0
  113. package/src/features/ChatInput/ActionBar/Model/GPT52ReasoningEffortSlider.tsx +61 -0
  114. package/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx +1 -1
  115. package/src/features/ChatInput/ActionBar/Model/ThinkingLevel2Slider.tsx +58 -0
  116. package/src/features/ChatInput/ActionBar/Model/ThinkingLevelSlider.tsx +10 -8
  117. package/src/helpers/toolEngineering/index.ts +1 -1
  118. package/src/locales/default/plugin.ts +6 -0
  119. package/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts +1 -1
  120. package/src/server/modules/Mecha/AgentToolsEngine/index.ts +1 -1
  121. package/src/services/chat/mecha/modelParamsResolver.ts +11 -0
  122. package/src/store/chat/slices/builtinTool/actions/index.ts +1 -11
  123. package/src/store/tool/slices/builtin/executors/index.ts +4 -0
  124. package/src/styles/text.ts +1 -1
  125. package/src/tools/executionRuntimes.ts +3 -8
  126. package/src/tools/identifiers.ts +1 -1
  127. package/src/tools/index.ts +1 -1
  128. package/src/tools/inspectors.ts +5 -0
  129. package/src/tools/renders.ts +6 -12
  130. package/packages/builtin-tool-local-system/src/client/Render/RenameLocalFile/index.tsx +0 -37
  131. package/src/store/chat/slices/builtinTool/actions/__tests__/localSystem.test.ts +0 -201
  132. package/src/store/chat/slices/builtinTool/actions/knowledgeBase.ts +0 -163
  133. package/src/store/chat/slices/builtinTool/actions/localSystem.ts +0 -241
  134. package/src/tools/knowledge-base/ExecutionRuntime/index.ts +0 -25
  135. package/src/tools/knowledge-base/Render/ReadKnowledge/index.tsx +0 -29
  136. package/src/tools/knowledge-base/Render/SearchKnowledgeBase/index.tsx +0 -29
  137. package/src/tools/knowledge-base/Render/index.ts +0 -7
  138. package/src/tools/knowledge-base/index.ts +0 -12
  139. package/src/tools/local-system/ExecutionRuntime/index.ts +0 -9
  140. package/src/tools/local-system/systemRole.ts +0 -1
@@ -1028,6 +1028,90 @@ describe('google contextBuilders', () => {
1028
1028
 
1029
1029
  expect(result.parameters?.description).toBe('Test parameters');
1030
1030
  });
1031
+
1032
+ it('should convert const to enum for Google compatibility', () => {
1033
+ const tool: ChatCompletionTool = {
1034
+ function: {
1035
+ description: 'A tool with const values',
1036
+ name: 'constTool',
1037
+ parameters: {
1038
+ properties: {
1039
+ action: { const: 'insert', type: 'string' },
1040
+ nested: {
1041
+ properties: {
1042
+ operation: { const: 'create', type: 'string' },
1043
+ },
1044
+ type: 'object',
1045
+ },
1046
+ },
1047
+ type: 'object',
1048
+ },
1049
+ },
1050
+ type: 'function',
1051
+ };
1052
+
1053
+ const result = buildGoogleTool(tool);
1054
+
1055
+ // const should be converted to enum with single value
1056
+ expect(result.parameters?.properties).toEqual({
1057
+ action: { enum: ['insert'], type: 'string' },
1058
+ nested: {
1059
+ properties: {
1060
+ operation: { enum: ['create'], type: 'string' },
1061
+ },
1062
+ type: 'object',
1063
+ },
1064
+ });
1065
+ });
1066
+
1067
+ it('should handle oneOf with const values (like page-agent modifyNodes)', () => {
1068
+ const tool: ChatCompletionTool = {
1069
+ function: {
1070
+ description: 'Modify nodes operation',
1071
+ name: 'modifyNodes',
1072
+ parameters: {
1073
+ properties: {
1074
+ operations: {
1075
+ items: {
1076
+ oneOf: [
1077
+ {
1078
+ properties: {
1079
+ action: { const: 'insert', type: 'string' },
1080
+ beforeId: { type: 'string' },
1081
+ },
1082
+ type: 'object',
1083
+ },
1084
+ {
1085
+ properties: {
1086
+ action: { const: 'modify', type: 'string' },
1087
+ content: { type: 'string' },
1088
+ },
1089
+ type: 'object',
1090
+ },
1091
+ ],
1092
+ },
1093
+ type: 'array',
1094
+ },
1095
+ },
1096
+ type: 'object',
1097
+ },
1098
+ },
1099
+ type: 'function',
1100
+ };
1101
+
1102
+ const result = buildGoogleTool(tool);
1103
+
1104
+ // All const values in nested oneOf should be converted to enum
1105
+ const operations = result.parameters?.properties?.operations as any;
1106
+ expect(operations.items.oneOf[0].properties.action).toEqual({
1107
+ enum: ['insert'],
1108
+ type: 'string',
1109
+ });
1110
+ expect(operations.items.oneOf[1].properties.action).toEqual({
1111
+ enum: ['modify'],
1112
+ type: 'string',
1113
+ });
1114
+ });
1031
1115
  });
1032
1116
 
1033
1117
  describe('buildGoogleTools', () => {
@@ -209,6 +209,39 @@ export const buildGoogleMessages = async (messages: OpenAIChatMessage[]): Promis
209
209
  return filteredContents;
210
210
  };
211
211
 
212
+ /**
213
+ * Sanitize JSON Schema for Google GenAI compatibility
214
+ * Google's API doesn't support certain JSON Schema keywords like 'const'
215
+ * This function recursively processes the schema and converts unsupported keywords
216
+ */
217
+ const sanitizeSchemaForGoogle = (schema: Record<string, any>): Record<string, any> => {
218
+ if (!schema || typeof schema !== 'object') return schema;
219
+
220
+ // Handle arrays
221
+ if (Array.isArray(schema)) {
222
+ return schema.map((item) => sanitizeSchemaForGoogle(item));
223
+ }
224
+
225
+ const result: Record<string, any> = {};
226
+
227
+ for (const [key, value] of Object.entries(schema)) {
228
+ // Convert 'const' to 'enum' with single value (Google doesn't support 'const')
229
+ if (key === 'const') {
230
+ result['enum'] = [value];
231
+ continue;
232
+ }
233
+
234
+ // Recursively process nested objects
235
+ if (value && typeof value === 'object') {
236
+ result[key] = sanitizeSchemaForGoogle(value);
237
+ } else {
238
+ result[key] = value;
239
+ }
240
+ }
241
+
242
+ return result;
243
+ };
244
+
212
245
  /**
213
246
  * Convert ChatCompletionTool to Google FunctionDeclaration
214
247
  */
@@ -216,11 +249,14 @@ export const buildGoogleTool = (tool: ChatCompletionTool): FunctionDeclaration =
216
249
  const functionDeclaration = tool.function;
217
250
  const parameters = functionDeclaration.parameters;
218
251
  // refs: https://github.com/lobehub/lobe-chat/pull/5002
219
- const properties =
252
+ const rawProperties =
220
253
  parameters?.properties && Object.keys(parameters.properties).length > 0
221
254
  ? parameters.properties
222
255
  : { dummy: { type: 'string' } }; // dummy property to avoid empty object
223
256
 
257
+ // Sanitize properties to remove unsupported JSON Schema keywords for Google
258
+ const properties = sanitizeSchemaForGoogle(rawProperties);
259
+
224
260
  return {
225
261
  description: functionDeclaration.description,
226
262
  name: functionDeclaration.name,
@@ -7,12 +7,13 @@ export const LobeVolcengineAI = createOpenAICompatibleRuntime({
7
7
  baseURL: 'https://ark.cn-beijing.volces.com/api/v3',
8
8
  chatCompletion: {
9
9
  handlePayload: (payload) => {
10
- const { model, thinking, ...rest } = payload;
10
+ const { model, thinking, reasoning_effort, ...rest } = payload;
11
11
 
12
12
  return {
13
13
  ...rest,
14
14
  model,
15
15
  ...(thinking?.type && { thinking: { type: thinking.type } }),
16
+ ...(reasoning_effort && { reasoning_effort }),
16
17
  } as any;
17
18
  },
18
19
  },
@@ -382,33 +382,6 @@ describe('LobeZhipuAI - custom features', () => {
382
382
  expect.anything(),
383
383
  );
384
384
  });
385
-
386
- it('should not include thinking for non-4.5 models', async () => {
387
- await instance.chat({
388
- messages: [{ content: 'Hello', role: 'user' }],
389
- model: 'glm-4',
390
- temperature: 0.5,
391
- thinking: { type: 'enabled', budget_tokens: 1000 },
392
- });
393
-
394
- const callArgs = (instance['client'].chat.completions.create as any).mock.calls[0][0];
395
- expect(callArgs.thinking).toBeUndefined();
396
- });
397
-
398
- it('should handle undefined thinking gracefully for 4.5 models', async () => {
399
- await instance.chat({
400
- messages: [{ content: 'Hello', role: 'user' }],
401
- model: 'glm-4.5',
402
- temperature: 0.5,
403
- });
404
-
405
- expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
406
- expect.objectContaining({
407
- thinking: { type: undefined },
408
- }),
409
- expect.anything(),
410
- );
411
- });
412
385
  });
413
386
 
414
387
  describe('Stream parameter', () => {
@@ -61,7 +61,7 @@ export const params = {
61
61
  ...resolvedParams,
62
62
  model,
63
63
  stream: true,
64
- thinking: model.includes('-4.5') ? { type: thinking?.type } : undefined,
64
+ thinking: thinking ? { type: thinking.type } : undefined,
65
65
  tools: zhipuTools,
66
66
  } as any;
67
67
  },
@@ -38,9 +38,9 @@ export const MODEL_LIST_CONFIGS = {
38
38
  excludeKeywords: ['tts'],
39
39
  functionCallKeywords: ['gemini', '!-image-'],
40
40
  imageOutputKeywords: ['-image-'],
41
- reasoningKeywords: ['thinking', '-2.5-', '!-image-'],
41
+ reasoningKeywords: ['thinking', '-2.5-', '!-image-', '-3-'],
42
42
  searchKeywords: ['-search', '!-image-'],
43
- videoKeywords: ['-2.5-', '!-image-'],
43
+ videoKeywords: ['-2.5-', '!-image-', '-3-'],
44
44
  visionKeywords: ['gemini', 'learnlm'],
45
45
  },
46
46
  inclusionai: {
@@ -126,8 +126,8 @@ export const MODEL_LIST_CONFIGS = {
126
126
  },
127
127
  zhipu: {
128
128
  functionCallKeywords: ['glm-4', 'glm-z1'],
129
- reasoningKeywords: ['glm-zero', 'glm-z1', 'glm-4.5'],
130
- visionKeywords: ['glm-4v', 'glm-4.1v', 'glm-4.5v'],
129
+ reasoningKeywords: ['glm-zero', 'glm-z1', 'glm-4.'],
130
+ visionKeywords: ['re:glm-4(\\.\\d)?v'],
131
131
  },
132
132
  } as const;
133
133
 
@@ -183,36 +183,41 @@ export const EMBEDDING_MODEL_KEYWORDS = ['embedding', 'embed', 'bge', 'm3e'] as
183
183
  * @param keywords 关键词列表,支持以下前缀:
184
184
  * - ^ 开头:只在模型ID开头匹配
185
185
  * - ! 开头:排除匹配,优先级最高
186
+ * - re: 开头:正则表达式匹配(支持 !re: 正则排除)
186
187
  * - 无前缀:包含匹配(默认行为)
187
188
  * @returns 是否匹配(排除逻辑优先)
188
189
  */
189
190
  const isKeywordListMatch = (modelId: string, keywords: readonly string[]): boolean => {
190
- // 先检查排除规则(感叹号开头)
191
+ const matchKeyword = (keyword: string): boolean => {
192
+ const rawKeyword = keyword.startsWith('!') ? keyword.slice(1) : keyword;
193
+
194
+ if (rawKeyword.startsWith('re:')) {
195
+ try {
196
+ return new RegExp(rawKeyword.slice(3)).test(modelId);
197
+ } catch {
198
+ return false;
199
+ }
200
+ }
201
+
202
+ if (rawKeyword.startsWith('^')) {
203
+ return modelId.startsWith(rawKeyword.slice(1));
204
+ }
205
+
206
+ return modelId.includes(rawKeyword);
207
+ };
208
+
209
+ // 先检查排除规则(感叹号开头,包括 !re:)
191
210
  const excludeKeywords = keywords.filter((keyword) => keyword.startsWith('!'));
192
211
  const includeKeywords = keywords.filter((keyword) => !keyword.startsWith('!'));
193
212
 
194
- // 如果匹配任何排除规则,直接返回 false
195
213
  for (const excludeKeyword of excludeKeywords) {
196
- const keywordWithoutPrefix = excludeKeyword.slice(1);
197
- const isMatch = keywordWithoutPrefix.startsWith('^')
198
- ? modelId.startsWith(keywordWithoutPrefix.slice(1))
199
- : modelId.includes(keywordWithoutPrefix);
200
-
201
- if (isMatch) {
214
+ if (matchKeyword(excludeKeyword)) {
202
215
  return false;
203
216
  }
204
217
  }
205
218
 
206
219
  // 检查包含规则
207
- return includeKeywords.some((keyword) => {
208
- if (keyword.startsWith('^')) {
209
- // ^ 开头则只在开头匹配
210
- const keywordWithoutPrefix = keyword.slice(1);
211
- return modelId.startsWith(keywordWithoutPrefix);
212
- }
213
- // 默认行为:包含匹配
214
- return modelId.includes(keyword);
215
- });
220
+ return includeKeywords.some((keyword) => matchKeyword(keyword));
216
221
  };
217
222
 
218
223
  /**
@@ -31,12 +31,14 @@ export interface LobeAgentChatConfig {
31
31
  reasoningEffort?: 'low' | 'medium' | 'high';
32
32
  gpt5ReasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
33
33
  gpt5_1ReasoningEffort?: 'none' | 'low' | 'medium' | 'high';
34
+ gpt5_2ReasoningEffort?: 'none' | 'low' | 'medium' | 'high' | 'xhigh';
35
+ gpt5_2ProReasoningEffort?: 'medium' | 'high' | 'xhigh';
34
36
  /**
35
37
  * Output text verbosity control
36
38
  */
37
39
  textVerbosity?: 'low' | 'medium' | 'high';
38
40
  thinking?: 'disabled' | 'auto' | 'enabled';
39
- thinkingLevel?: 'low' | 'high';
41
+ thinkingLevel?: 'minimal' | 'low' | 'medium' | 'high';
40
42
  thinkingBudget?: number;
41
43
  /**
42
44
  * Image aspect ratio for image generation models
@@ -84,6 +86,8 @@ export const AgentChatConfigSchema = z.object({
84
86
  enableStreaming: z.boolean().optional(),
85
87
  gpt5ReasoningEffort: z.enum(['minimal', 'low', 'medium', 'high']).optional(),
86
88
  gpt5_1ReasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(),
89
+ gpt5_2ProReasoningEffort: z.enum(['medium', 'high', 'xhigh']).optional(),
90
+ gpt5_2ReasoningEffort: z.enum(['none', 'low', 'medium', 'high', 'xhigh']).optional(),
87
91
  historyCount: z.number().optional(),
88
92
  imageAspectRatio: z.string().optional(),
89
93
  imageResolution: z.enum(['1K', '2K', '4K']).optional(),
@@ -99,7 +103,7 @@ export const AgentChatConfigSchema = z.object({
99
103
  textVerbosity: z.enum(['low', 'medium', 'high']).optional(),
100
104
  thinking: z.enum(['disabled', 'auto', 'enabled']).optional(),
101
105
  thinkingBudget: z.number().optional(),
102
- thinkingLevel: z.enum(['low', 'high']).optional(),
106
+ thinkingLevel: z.enum(['minimal', 'low', 'medium', 'high']).optional(),
103
107
  urlContext: z.boolean().optional(),
104
108
  useModelBuiltinSearch: z.boolean().optional(),
105
109
  });
@@ -15,12 +15,15 @@ import { useUpdateAgentConfig } from '../../hooks/useUpdateAgentConfig';
15
15
  import ContextCachingSwitch from './ContextCachingSwitch';
16
16
  import GPT5ReasoningEffortSlider from './GPT5ReasoningEffortSlider';
17
17
  import GPT51ReasoningEffortSlider from './GPT51ReasoningEffortSlider';
18
+ import GPT52ProReasoningEffortSlider from './GPT52ProReasoningEffortSlider';
19
+ import GPT52ReasoningEffortSlider from './GPT52ReasoningEffortSlider';
18
20
  import ImageAspectRatioSelect from './ImageAspectRatioSelect';
19
21
  import ImageResolutionSlider from './ImageResolutionSlider';
20
22
  import ReasoningEffortSlider from './ReasoningEffortSlider';
21
23
  import ReasoningTokenSlider from './ReasoningTokenSlider';
22
24
  import TextVerbositySlider from './TextVerbositySlider';
23
25
  import ThinkingBudgetSlider from './ThinkingBudgetSlider';
26
+ import ThinkingLevel2Slider from './ThinkingLevel2Slider';
24
27
  import ThinkingLevelSlider from './ThinkingLevelSlider';
25
28
  import ThinkingSlider from './ThinkingSlider';
26
29
 
@@ -140,6 +143,28 @@ const ControlsForm = memo(() => {
140
143
  paddingBottom: 0,
141
144
  },
142
145
  },
146
+ {
147
+ children: <GPT52ReasoningEffortSlider />,
148
+ desc: 'reasoning_effort',
149
+ label: t('extendParams.reasoningEffort.title'),
150
+ layout: 'horizontal',
151
+ minWidth: undefined,
152
+ name: 'gpt5_2ReasoningEffort',
153
+ style: {
154
+ paddingBottom: 0,
155
+ },
156
+ },
157
+ {
158
+ children: <GPT52ProReasoningEffortSlider />,
159
+ desc: 'reasoning_effort',
160
+ label: t('extendParams.reasoningEffort.title'),
161
+ layout: 'horizontal',
162
+ minWidth: undefined,
163
+ name: 'gpt5_2ProReasoningEffort',
164
+ style: {
165
+ paddingBottom: 0,
166
+ },
167
+ },
143
168
  {
144
169
  children: <TextVerbositySlider />,
145
170
  desc: 'text_verbosity',
@@ -173,7 +198,7 @@ const ControlsForm = memo(() => {
173
198
  layout: isNarrow ? 'vertical' : 'horizontal',
174
199
  minWidth: undefined,
175
200
  name: 'urlContext',
176
- style: isNarrow ? undefined : { width: 445 },
201
+ style: isNarrow ? undefined : { minWidth: 360 },
177
202
  tag: 'urlContext',
178
203
  },
179
204
  {
@@ -193,8 +218,22 @@ const ControlsForm = memo(() => {
193
218
  minWidth: undefined,
194
219
  name: 'thinkingLevel',
195
220
  style: {
221
+ minWidth: 400,
222
+ paddingBottom: 0,
223
+ },
224
+ tag: 'thinkingLevel',
225
+ },
226
+ {
227
+ children: <ThinkingLevel2Slider />,
228
+ label: t('extendParams.thinkingLevel.title'),
229
+ layout: 'horizontal',
230
+ minWidth: undefined,
231
+ name: 'thinkingLevel2',
232
+ style: {
233
+ minWidth: 400,
196
234
  paddingBottom: 0,
197
235
  },
236
+ tag: 'thinkingLevel',
198
237
  },
199
238
  {
200
239
  children: <ImageAspectRatioSelect />,
@@ -0,0 +1,59 @@
1
+ import { Flexbox } from '@lobehub/ui';
2
+ import { Slider } from 'antd';
3
+ import { memo, useCallback } from 'react';
4
+
5
+ import { useAgentStore } from '@/store/agent';
6
+ import { chatConfigByIdSelectors } from '@/store/agent/selectors';
7
+
8
+ import { useAgentId } from '../../hooks/useAgentId';
9
+ import { useUpdateAgentConfig } from '../../hooks/useUpdateAgentConfig';
10
+
11
+ const GPT52ProReasoningEffortSlider = memo(() => {
12
+ const agentId = useAgentId();
13
+ const { updateAgentChatConfig } = useUpdateAgentConfig();
14
+ const config = useAgentStore((s) => chatConfigByIdSelectors.getChatConfigById(agentId)(s));
15
+
16
+ const gpt5_2ProReasoningEffort = config.gpt5_2ProReasoningEffort || 'medium';
17
+
18
+ const marks = {
19
+ 0: 'medium',
20
+ 1: 'high',
21
+ 2: 'xhigh',
22
+ };
23
+
24
+ const effortValues = ['medium', 'high', 'xhigh'];
25
+ const indexValue = effortValues.indexOf(gpt5_2ProReasoningEffort);
26
+ const currentValue = indexValue === -1 ? 0 : indexValue;
27
+
28
+ const updateGPT52ProReasoningEffort = useCallback(
29
+ (value: number) => {
30
+ const effort = effortValues[value] as 'medium' | 'high' | 'xhigh';
31
+ updateAgentChatConfig({ gpt5_2ProReasoningEffort: effort });
32
+ },
33
+ [updateAgentChatConfig],
34
+ );
35
+
36
+ return (
37
+ <Flexbox
38
+ align={'center'}
39
+ gap={12}
40
+ horizontal
41
+ paddingInline={'0 20px'}
42
+ style={{ minWidth: 160, width: '100%' }}
43
+ >
44
+ <Flexbox flex={1}>
45
+ <Slider
46
+ marks={marks}
47
+ max={2}
48
+ min={0}
49
+ onChange={updateGPT52ProReasoningEffort}
50
+ step={1}
51
+ tooltip={{ open: false }}
52
+ value={currentValue}
53
+ />
54
+ </Flexbox>
55
+ </Flexbox>
56
+ );
57
+ });
58
+
59
+ export default GPT52ProReasoningEffortSlider;
@@ -0,0 +1,61 @@
1
+ import { Flexbox } from '@lobehub/ui';
2
+ import { Slider } from 'antd';
3
+ import { memo, useCallback } from 'react';
4
+
5
+ import { useAgentStore } from '@/store/agent';
6
+ import { chatConfigByIdSelectors } from '@/store/agent/selectors';
7
+
8
+ import { useAgentId } from '../../hooks/useAgentId';
9
+ import { useUpdateAgentConfig } from '../../hooks/useUpdateAgentConfig';
10
+
11
+ const GPT52ReasoningEffortSlider = memo(() => {
12
+ const agentId = useAgentId();
13
+ const { updateAgentChatConfig } = useUpdateAgentConfig();
14
+ const config = useAgentStore((s) => chatConfigByIdSelectors.getChatConfigById(agentId)(s));
15
+
16
+ const gpt5_2ReasoningEffort = config.gpt5_2ReasoningEffort || 'none';
17
+
18
+ const marks = {
19
+ 0: 'none',
20
+ 1: 'low',
21
+ 2: 'medium',
22
+ 3: 'high',
23
+ 4: 'xhigh',
24
+ };
25
+
26
+ const effortValues = ['none', 'low', 'medium', 'high', 'xhigh'];
27
+ const indexValue = effortValues.indexOf(gpt5_2ReasoningEffort);
28
+ const currentValue = indexValue === -1 ? 0 : indexValue;
29
+
30
+ const updateGPT52ReasoningEffort = useCallback(
31
+ (value: number) => {
32
+ const effort = effortValues[value] as 'none' | 'low' | 'medium' | 'high' | 'xhigh';
33
+ updateAgentChatConfig({ gpt5_2ReasoningEffort: effort });
34
+ },
35
+ [updateAgentChatConfig],
36
+ );
37
+
38
+ return (
39
+ <Flexbox
40
+ align={'center'}
41
+ gap={12}
42
+ horizontal
43
+ paddingInline={'0 20px'}
44
+ style={{ minWidth: 230, width: '100%' }}
45
+ >
46
+ <Flexbox flex={1}>
47
+ <Slider
48
+ marks={marks}
49
+ max={4}
50
+ min={0}
51
+ onChange={updateGPT52ReasoningEffort}
52
+ step={1}
53
+ tooltip={{ open: false }}
54
+ value={currentValue}
55
+ />
56
+ </Flexbox>
57
+ </Flexbox>
58
+ );
59
+ });
60
+
61
+ export default GPT52ReasoningEffortSlider;
@@ -39,7 +39,7 @@ const TextVerbositySlider = memo(() => {
39
39
  gap={12}
40
40
  horizontal
41
41
  paddingInline={'0 20px'}
42
- style={{ minWidth: 200, width: '100%' }}
42
+ style={{ minWidth: 160, width: '100%' }}
43
43
  >
44
44
  <Flexbox flex={1}>
45
45
  <Slider
@@ -0,0 +1,58 @@
1
+ import { Flexbox } from '@lobehub/ui';
2
+ import { Slider } from 'antd';
3
+ import { memo, useCallback } from 'react';
4
+
5
+ import { useAgentStore } from '@/store/agent';
6
+ import { chatConfigByIdSelectors } from '@/store/agent/selectors';
7
+
8
+ import { useAgentId } from '../../hooks/useAgentId';
9
+ import { useUpdateAgentConfig } from '../../hooks/useUpdateAgentConfig';
10
+
11
+ const ThinkingLevel2Slider = memo(() => {
12
+ const agentId = useAgentId();
13
+ const { updateAgentChatConfig } = useUpdateAgentConfig();
14
+ const config = useAgentStore((s) => chatConfigByIdSelectors.getChatConfigById(agentId)(s));
15
+
16
+ const thinkingLevel = config.thinkingLevel || 'high'; // Default to 'high' if not set
17
+
18
+ const marks = {
19
+ 0: 'low',
20
+ 1: 'high',
21
+ };
22
+
23
+ const levelValues = ['low', 'high'];
24
+ const indexValue = levelValues.indexOf(thinkingLevel as any);
25
+ const currentValue = indexValue === -1 ? 1 : indexValue;
26
+
27
+ const updateThinkingLevel = useCallback(
28
+ (value: number) => {
29
+ const level = levelValues[value] as 'low' | 'high';
30
+ updateAgentChatConfig({ thinkingLevel: level });
31
+ },
32
+ [updateAgentChatConfig],
33
+ );
34
+
35
+ return (
36
+ <Flexbox
37
+ align={'center'}
38
+ gap={12}
39
+ horizontal
40
+ paddingInline={'0 20px'}
41
+ style={{ minWidth: 110, width: '100%' }}
42
+ >
43
+ <Flexbox flex={1}>
44
+ <Slider
45
+ marks={marks}
46
+ max={1}
47
+ min={0}
48
+ onChange={updateThinkingLevel}
49
+ step={1}
50
+ tooltip={{ open: false }}
51
+ value={currentValue}
52
+ />
53
+ </Flexbox>
54
+ </Flexbox>
55
+ );
56
+ });
57
+
58
+ export default ThinkingLevel2Slider;
@@ -16,17 +16,19 @@ const ThinkingLevelSlider = memo(() => {
16
16
  const thinkingLevel = config.thinkingLevel || 'high'; // Default to 'high' if not set
17
17
 
18
18
  const marks = {
19
- 0: 'low',
20
- 1: 'high',
19
+ 0: 'minimal',
20
+ 1: 'low',
21
+ 2: 'medium',
22
+ 3: 'high',
21
23
  };
22
24
 
23
- const levelValues = ['low', 'high'];
24
- const indexValue = levelValues.indexOf(thinkingLevel);
25
- const currentValue = indexValue === -1 ? 1 : indexValue;
25
+ const levelValues = ['minimal', 'low', 'medium', 'high'];
26
+ const indexValue = levelValues.indexOf(thinkingLevel as any);
27
+ const currentValue = indexValue === -1 ? 3 : indexValue;
26
28
 
27
29
  const updateThinkingLevel = useCallback(
28
30
  (value: number) => {
29
- const level = levelValues[value] as 'low' | 'high';
31
+ const level = levelValues[value] as 'minimal' | 'low' | 'medium' | 'high';
30
32
  updateAgentChatConfig({ thinkingLevel: level });
31
33
  },
32
34
  [updateAgentChatConfig],
@@ -38,12 +40,12 @@ const ThinkingLevelSlider = memo(() => {
38
40
  gap={12}
39
41
  horizontal
40
42
  paddingInline={'0 20px'}
41
- style={{ minWidth: 130, width: '100%' }} // 三项时宽度需改回 200
43
+ style={{ minWidth: 200, width: '100%' }}
42
44
  >
43
45
  <Flexbox flex={1}>
44
46
  <Slider
45
47
  marks={marks}
46
- max={1}
48
+ max={3}
47
49
  min={0}
48
50
  onChange={updateThinkingLevel}
49
51
  step={1}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Tools Engineering - Unified tools processing using ToolsEngine
3
3
  */
4
+ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base';
4
5
  import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
5
6
  import { ToolsEngine } from '@lobechat/context-engine';
6
7
  import type { PluginEnableChecker } from '@lobechat/context-engine';
@@ -11,7 +12,6 @@ import { getAgentStoreState } from '@/store/agent';
11
12
  import { agentSelectors } from '@/store/agent/selectors';
12
13
  import { getToolStoreState } from '@/store/tool';
13
14
  import { klavisStoreSelectors, pluginSelectors } from '@/store/tool/selectors';
14
- import { KnowledgeBaseManifest } from '@/tools/knowledge-base';
15
15
 
16
16
  import { getSearchConfig } from '../getSearchConfig';
17
17
  import { isCanUseFC } from '../isCanUseFC';
@@ -73,6 +73,8 @@ export default {
73
73
  'builtins.lobe-gtd.title': 'Task Tools',
74
74
  'builtins.lobe-knowledge-base.apiName.readKnowledge': 'Read Library content',
75
75
  'builtins.lobe-knowledge-base.apiName.searchKnowledgeBase': 'Search Library',
76
+ 'builtins.lobe-knowledge-base.inspector.andMoreFiles': 'and {{count}} more',
77
+ 'builtins.lobe-knowledge-base.inspector.noResults': 'No results',
76
78
  'builtins.lobe-knowledge-base.title': 'Library',
77
79
  'builtins.lobe-local-system.apiName.editLocalFile': 'Edit file',
78
80
  'builtins.lobe-local-system.apiName.getCommandOutput': 'Get command output',
@@ -86,6 +88,9 @@ export default {
86
88
  'builtins.lobe-local-system.apiName.runCommand': 'Run command',
87
89
  'builtins.lobe-local-system.apiName.searchLocalFiles': 'Search files',
88
90
  'builtins.lobe-local-system.apiName.writeLocalFile': 'Write file',
91
+ 'builtins.lobe-local-system.inspector.noResults': 'No results',
92
+ 'builtins.lobe-local-system.inspector.rename.result':
93
+ '<old>{{oldName}}</old> → <new>{{newName}}</new>',
89
94
  'builtins.lobe-local-system.title': 'Local System',
90
95
  'builtins.lobe-page-agent.apiName.batchUpdate': 'Batch update nodes',
91
96
  'builtins.lobe-page-agent.apiName.compareSnapshots': 'Compare snapshots',
@@ -143,6 +148,7 @@ export default {
143
148
  'builtins.lobe-web-browsing.apiName.crawlMultiPages': 'Read multiple pages',
144
149
  'builtins.lobe-web-browsing.apiName.crawlSinglePage': 'Read page content',
145
150
  'builtins.lobe-web-browsing.apiName.search': 'Search pages',
151
+ 'builtins.lobe-web-browsing.inspector.noResults': 'No results',
146
152
  'builtins.lobe-web-browsing.title': 'Web Search',
147
153
  'confirm': 'Confirm',
148
154
  'debug.arguments': 'Arguments',