@lobehub/chat 1.111.7 → 1.111.8
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/.i18nrc.js +1 -1
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +9 -0
- package/locales/ar/chat.json +3 -0
- package/locales/bg-BG/chat.json +3 -0
- package/locales/de-DE/chat.json +3 -0
- package/locales/en-US/chat.json +3 -0
- package/locales/es-ES/chat.json +3 -0
- package/locales/fa-IR/chat.json +3 -0
- package/locales/fr-FR/chat.json +3 -0
- package/locales/it-IT/chat.json +3 -0
- package/locales/ja-JP/chat.json +3 -0
- package/locales/ko-KR/chat.json +3 -0
- package/locales/nl-NL/chat.json +3 -0
- package/locales/pl-PL/chat.json +3 -0
- package/locales/pt-BR/chat.json +3 -0
- package/locales/ru-RU/chat.json +3 -0
- package/locales/tr-TR/chat.json +3 -0
- package/locales/vi-VN/chat.json +3 -0
- package/locales/zh-CN/chat.json +3 -0
- package/locales/zh-TW/chat.json +3 -0
- package/package.json +1 -1
- package/packages/model-runtime/src/azureOpenai/index.ts +22 -5
- package/packages/model-runtime/src/openai/index.ts +4 -1
- package/packages/model-runtime/src/types/chat.ts +5 -1
- package/packages/types/src/agent/chatConfig.ts +6 -0
- package/packages/types/src/aiModel.ts +2 -0
- package/src/config/aiModels/aihubmix.ts +10 -12
- package/src/config/aiModels/openai.ts +7 -4
- package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +24 -0
- package/src/features/ChatInput/ActionBar/Model/GPT5ReasoningEffortSlider.tsx +58 -0
- package/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx +57 -0
- package/src/locales/default/chat.ts +3 -0
- package/src/services/chat.ts +8 -0
package/.i18nrc.js
CHANGED
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.111.8](https://github.com/lobehub/lobe-chat/compare/v1.111.7...v1.111.8)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-11**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Support new GPT-5 Verbosity params.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Support new GPT-5 Verbosity params, closes [#8715](https://github.com/lobehub/lobe-chat/issues/8715) ([0a724aa](https://github.com/lobehub/lobe-chat/commit/0a724aa))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.111.7](https://github.com/lobehub/lobe-chat/compare/v1.111.6...v1.111.7)
|
6
31
|
|
7
32
|
<sup>Released on **2025-08-11**</sup>
|
package/changelog/v1.json
CHANGED
package/locales/ar/chat.json
CHANGED
package/locales/bg-BG/chat.json
CHANGED
package/locales/de-DE/chat.json
CHANGED
package/locales/en-US/chat.json
CHANGED
package/locales/es-ES/chat.json
CHANGED
package/locales/fa-IR/chat.json
CHANGED
package/locales/fr-FR/chat.json
CHANGED
package/locales/it-IT/chat.json
CHANGED
package/locales/ja-JP/chat.json
CHANGED
package/locales/ko-KR/chat.json
CHANGED
package/locales/nl-NL/chat.json
CHANGED
package/locales/pl-PL/chat.json
CHANGED
package/locales/pt-BR/chat.json
CHANGED
package/locales/ru-RU/chat.json
CHANGED
package/locales/tr-TR/chat.json
CHANGED
package/locales/vi-VN/chat.json
CHANGED
package/locales/zh-CN/chat.json
CHANGED
package/locales/zh-TW/chat.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.111.
|
3
|
+
"version": "1.111.8",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -56,16 +56,33 @@ export class LobeAzureOpenAI implements LobeRuntimeAI {
|
|
56
56
|
}));
|
57
57
|
|
58
58
|
try {
|
59
|
-
|
59
|
+
// Create parameters with proper typing for OpenAI SDK, handling reasoning_effort compatibility
|
60
|
+
const { reasoning_effort, ...otherParams } = params;
|
61
|
+
|
62
|
+
// Convert 'minimal' to 'low' for OpenAI SDK compatibility
|
63
|
+
const compatibleReasoningEffort = reasoning_effort === 'minimal' ? 'low' : reasoning_effort;
|
64
|
+
|
65
|
+
const baseParams = {
|
60
66
|
messages: await convertOpenAIMessages(
|
61
67
|
updatedMessages as OpenAI.ChatCompletionMessageParam[],
|
62
68
|
),
|
63
69
|
model,
|
64
|
-
...
|
70
|
+
...otherParams,
|
65
71
|
max_completion_tokens: undefined,
|
66
|
-
|
67
|
-
|
68
|
-
|
72
|
+
tool_choice: params.tools ? ('auto' as const) : undefined,
|
73
|
+
};
|
74
|
+
|
75
|
+
// Add reasoning_effort only if it exists and cast to proper type
|
76
|
+
const openaiParams = compatibleReasoningEffort
|
77
|
+
? {
|
78
|
+
...baseParams,
|
79
|
+
reasoning_effort: compatibleReasoningEffort as 'low' | 'medium' | 'high',
|
80
|
+
}
|
81
|
+
: baseParams;
|
82
|
+
|
83
|
+
const response = enableStreaming
|
84
|
+
? await this.client.chat.completions.create({ ...openaiParams, stream: true })
|
85
|
+
: await this.client.chat.completions.create({ ...openaiParams, stream: false });
|
69
86
|
if (enableStreaming) {
|
70
87
|
const stream = response as Stream<OpenAI.ChatCompletionChunk>;
|
71
88
|
const [prod, debug] = stream.tee();
|
@@ -60,7 +60,7 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
|
|
60
60
|
provider: ModelProvider.OpenAI,
|
61
61
|
responses: {
|
62
62
|
handlePayload: (payload) => {
|
63
|
-
const { enabledSearch, model, tools, ...rest } = payload;
|
63
|
+
const { enabledSearch, model, tools, verbosity, ...rest } = payload;
|
64
64
|
|
65
65
|
const openaiTools = enabledSearch
|
66
66
|
? [
|
@@ -85,6 +85,9 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
|
|
85
85
|
tools: openaiTools as any,
|
86
86
|
// computer-use series must set truncation as auto
|
87
87
|
...(model.startsWith('computer-use') && { truncation: 'auto' }),
|
88
|
+
text: verbosity
|
89
|
+
? { verbosity }
|
90
|
+
: undefined,
|
88
91
|
}) as any;
|
89
92
|
}
|
90
93
|
|
@@ -107,7 +107,7 @@ export interface ChatStreamPayload {
|
|
107
107
|
effort?: string;
|
108
108
|
summary?: string;
|
109
109
|
};
|
110
|
-
reasoning_effort?: 'low' | 'medium' | 'high';
|
110
|
+
reasoning_effort?: 'minimal' | 'low' | 'medium' | 'high';
|
111
111
|
responseMode?: 'stream' | 'json';
|
112
112
|
/**
|
113
113
|
* @title 是否开启流式请求
|
@@ -119,6 +119,9 @@ export interface ChatStreamPayload {
|
|
119
119
|
* @default 1
|
120
120
|
*/
|
121
121
|
temperature: number;
|
122
|
+
text?: {
|
123
|
+
verbosity?: 'low' | 'medium' | 'high';
|
124
|
+
};
|
122
125
|
/**
|
123
126
|
* use for Claude and Gemini
|
124
127
|
*/
|
@@ -135,6 +138,7 @@ export interface ChatStreamPayload {
|
|
135
138
|
*/
|
136
139
|
top_p?: number;
|
137
140
|
truncation?: 'auto' | 'disabled';
|
141
|
+
verbosity?: 'low' | 'medium' | 'high';
|
138
142
|
}
|
139
143
|
|
140
144
|
export interface ChatMethodOptions {
|
@@ -26,6 +26,11 @@ export interface LobeAgentChatConfig {
|
|
26
26
|
enableReasoningEffort?: boolean;
|
27
27
|
reasoningBudgetToken?: number;
|
28
28
|
reasoningEffort?: 'low' | 'medium' | 'high';
|
29
|
+
gpt5ReasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
|
30
|
+
/**
|
31
|
+
* 输出文本详细程度控制
|
32
|
+
*/
|
33
|
+
textVerbosity?: 'low' | 'medium' | 'high';
|
29
34
|
thinking?: 'disabled' | 'auto' | 'enabled';
|
30
35
|
thinkingBudget?: number;
|
31
36
|
/**
|
@@ -71,4 +76,5 @@ export const AgentChatConfigSchema = z.object({
|
|
71
76
|
})
|
72
77
|
.optional(),
|
73
78
|
searchMode: z.enum(['off', 'on', 'auto']).optional(),
|
79
|
+
textVerbosity: z.enum(['low', 'medium', 'high']).optional(),
|
74
80
|
});
|
@@ -20,12 +20,12 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
20
20
|
units: [
|
21
21
|
{ name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
|
22
22
|
{ name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
23
|
-
{ name: 'textInput_cacheRead', rate: 0.
|
23
|
+
{ name: 'textInput_cacheRead', rate: 0.125, strategy: 'fixed', unit: 'millionTokens' },
|
24
24
|
],
|
25
25
|
},
|
26
26
|
releasedAt: '2025-08-07',
|
27
27
|
settings: {
|
28
|
-
extendParams: ['
|
28
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
29
29
|
searchImpl: 'params',
|
30
30
|
},
|
31
31
|
type: 'chat',
|
@@ -48,12 +48,12 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
48
48
|
units: [
|
49
49
|
{ name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
|
50
50
|
{ name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
51
|
-
{ name: 'textInput_cacheRead', rate: 0.
|
51
|
+
{ name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
|
52
52
|
],
|
53
53
|
},
|
54
54
|
releasedAt: '2025-08-07',
|
55
55
|
settings: {
|
56
|
-
extendParams: ['
|
56
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
57
57
|
searchImpl: 'params',
|
58
58
|
},
|
59
59
|
type: 'chat',
|
@@ -61,13 +61,13 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
61
61
|
{
|
62
62
|
abilities: {
|
63
63
|
functionCall: true,
|
64
|
+
imageOutput: true,
|
64
65
|
reasoning: true,
|
65
66
|
vision: true,
|
66
67
|
},
|
67
68
|
contextWindowTokens: 400_000,
|
68
69
|
description: '最快、最经济高效的 GPT-5 版本。非常适合需要快速响应且成本敏感的应用场景。',
|
69
70
|
displayName: 'GPT-5 nano',
|
70
|
-
enabled: true,
|
71
71
|
id: 'gpt-5-nano',
|
72
72
|
maxOutput: 128_000,
|
73
73
|
pricing: {
|
@@ -78,10 +78,14 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
78
78
|
],
|
79
79
|
},
|
80
80
|
releasedAt: '2025-08-07',
|
81
|
+
settings: {
|
82
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
83
|
+
},
|
81
84
|
type: 'chat',
|
82
85
|
},
|
83
86
|
{
|
84
87
|
abilities: {
|
88
|
+
reasoning: true,
|
85
89
|
vision: true,
|
86
90
|
},
|
87
91
|
contextWindowTokens: 400_000,
|
@@ -95,7 +99,7 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
95
99
|
units: [
|
96
100
|
{ name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
|
97
101
|
{ name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
98
|
-
{ name: 'textInput_cacheRead', rate: 0.
|
102
|
+
{ name: 'textInput_cacheRead', rate: 0.125, strategy: 'fixed', unit: 'millionTokens' },
|
99
103
|
],
|
100
104
|
},
|
101
105
|
releasedAt: '2025-08-07',
|
@@ -112,7 +116,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
112
116
|
description:
|
113
117
|
'o4-mini 是我们最新的小型 o 系列模型。 它专为快速有效的推理而优化,在编码和视觉任务中表现出极高的效率和性能。',
|
114
118
|
displayName: 'o4-mini',
|
115
|
-
enabled: true,
|
116
119
|
id: 'o4-mini',
|
117
120
|
maxOutput: 100_000,
|
118
121
|
pricing: {
|
@@ -193,7 +196,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
193
196
|
description:
|
194
197
|
'o3 是一款全能强大的模型,在多个领域表现出色。它为数学、科学、编程和视觉推理任务树立了新标杆。它也擅长技术写作和指令遵循。用户可利用它分析文本、代码和图像,解决多步骤的复杂问题。',
|
195
198
|
displayName: 'o3',
|
196
|
-
enabled: true,
|
197
199
|
id: 'o3',
|
198
200
|
maxOutput: 100_000,
|
199
201
|
pricing: {
|
@@ -699,7 +701,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
699
701
|
description:
|
700
702
|
'基于Qwen3的思考模式开源模型,相较上一版本(通义千问3-235B-A22B)逻辑能力、通用能力、知识增强及创作能力均有大幅提升,适用于高难度强推理场景。',
|
701
703
|
displayName: 'Qwen3 235B A22B Thinking 2507',
|
702
|
-
enabled: true,
|
703
704
|
id: 'qwen3-235b-a22b-thinking-2507',
|
704
705
|
maxOutput: 32_768,
|
705
706
|
organization: 'Qwen',
|
@@ -721,7 +722,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
721
722
|
description:
|
722
723
|
'基于Qwen3的非思考模式开源模型,相较上一版本(通义千问3-235B-A22B)主观创作能力与模型安全性均有小幅度提升。',
|
723
724
|
displayName: 'Qwen3 235B A22B Instruct 2507',
|
724
|
-
enabled: true,
|
725
725
|
id: 'qwen3-235b-a22b-instruct-2507',
|
726
726
|
maxOutput: 32_768,
|
727
727
|
organization: 'Qwen',
|
@@ -744,7 +744,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
744
744
|
description:
|
745
745
|
'基于Qwen3的思考模式开源模型,相较上一版本(通义千问3-30B-A3B)逻辑能力、通用能力、知识增强及创作能力均有大幅提升,适用于高难度强推理场景。',
|
746
746
|
displayName: 'Qwen3 30B A3B Thinking 2507',
|
747
|
-
enabled: true,
|
748
747
|
id: 'qwen3-30b-a3b-thinking-2507',
|
749
748
|
maxOutput: 32_768,
|
750
749
|
organization: 'Qwen',
|
@@ -766,7 +765,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
766
765
|
description:
|
767
766
|
'相较上一版本(Qwen3-30B-A3B)中英文和多语言整体通用能力有大幅提升。主观开放类任务专项优化,显著更加符合用户偏好,能够提供更有帮助性的回复。',
|
768
767
|
displayName: 'Qwen3 30B A3B Instruct 2507',
|
769
|
-
enabled: true,
|
770
768
|
id: 'qwen3-30b-a3b-instruct-2507',
|
771
769
|
maxOutput: 32_768,
|
772
770
|
organization: 'Qwen',
|
@@ -42,7 +42,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
42
42
|
},
|
43
43
|
releasedAt: '2025-08-07',
|
44
44
|
settings: {
|
45
|
-
extendParams: ['
|
45
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
46
46
|
searchImpl: 'params',
|
47
47
|
},
|
48
48
|
type: 'chat',
|
@@ -70,7 +70,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
70
70
|
},
|
71
71
|
releasedAt: '2025-08-07',
|
72
72
|
settings: {
|
73
|
-
extendParams: ['
|
73
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
74
74
|
searchImpl: 'params',
|
75
75
|
},
|
76
76
|
type: 'chat',
|
@@ -78,6 +78,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
78
78
|
{
|
79
79
|
abilities: {
|
80
80
|
functionCall: true,
|
81
|
+
imageOutput: true,
|
81
82
|
reasoning: true,
|
82
83
|
vision: true,
|
83
84
|
},
|
@@ -94,10 +95,14 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
94
95
|
],
|
95
96
|
},
|
96
97
|
releasedAt: '2025-08-07',
|
98
|
+
settings: {
|
99
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
100
|
+
},
|
97
101
|
type: 'chat',
|
98
102
|
},
|
99
103
|
{
|
100
104
|
abilities: {
|
105
|
+
reasoning: true,
|
101
106
|
vision: true,
|
102
107
|
},
|
103
108
|
contextWindowTokens: 400_000,
|
@@ -128,7 +133,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
128
133
|
description:
|
129
134
|
'o4-mini 是我们最新的小型 o 系列模型。 它专为快速有效的推理而优化,在编码和视觉任务中表现出极高的效率和性能。',
|
130
135
|
displayName: 'o4-mini',
|
131
|
-
enabled: true,
|
132
136
|
id: 'o4-mini',
|
133
137
|
maxOutput: 100_000,
|
134
138
|
pricing: {
|
@@ -209,7 +213,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
209
213
|
description:
|
210
214
|
'o3 是一款全能强大的模型,在多个领域表现出色。它为数学、科学、编程和视觉推理任务树立了新标杆。它也擅长技术写作和指令遵循。用户可利用它分析文本、代码和图像,解决多步骤的复杂问题。',
|
211
215
|
displayName: 'o3',
|
212
|
-
enabled: true,
|
213
216
|
id: 'o3',
|
214
217
|
maxOutput: 100_000,
|
215
218
|
pricing: {
|
@@ -11,8 +11,10 @@ import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selector
|
|
11
11
|
import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
|
12
12
|
|
13
13
|
import ContextCachingSwitch from './ContextCachingSwitch';
|
14
|
+
import GPT5ReasoningEffortSlider from './GPT5ReasoningEffortSlider';
|
14
15
|
import ReasoningEffortSlider from './ReasoningEffortSlider';
|
15
16
|
import ReasoningTokenSlider from './ReasoningTokenSlider';
|
17
|
+
import TextVerbositySlider from './TextVerbositySlider';
|
16
18
|
import ThinkingBudgetSlider from './ThinkingBudgetSlider';
|
17
19
|
import ThinkingSlider from './ThinkingSlider';
|
18
20
|
|
@@ -95,6 +97,28 @@ const ControlsForm = memo(() => {
|
|
95
97
|
paddingBottom: 0,
|
96
98
|
},
|
97
99
|
},
|
100
|
+
{
|
101
|
+
children: <GPT5ReasoningEffortSlider />,
|
102
|
+
desc: 'reasoning_effort',
|
103
|
+
label: t('extendParams.reasoningEffort.title'),
|
104
|
+
layout: 'horizontal',
|
105
|
+
minWidth: undefined,
|
106
|
+
name: 'gpt5ReasoningEffort',
|
107
|
+
style: {
|
108
|
+
paddingBottom: 0,
|
109
|
+
},
|
110
|
+
},
|
111
|
+
{
|
112
|
+
children: <TextVerbositySlider />,
|
113
|
+
desc: 'text_verbosity',
|
114
|
+
label: t('extendParams.textVerbosity.title'),
|
115
|
+
layout: 'horizontal',
|
116
|
+
minWidth: undefined,
|
117
|
+
name: 'textVerbosity',
|
118
|
+
style: {
|
119
|
+
paddingBottom: 0,
|
120
|
+
},
|
121
|
+
},
|
98
122
|
{
|
99
123
|
children: <ThinkingBudgetSlider />,
|
100
124
|
label: t('extendParams.reasoningBudgetToken.title'),
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { Slider } from 'antd';
|
2
|
+
import { memo, useCallback } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
import { useAgentStore } from '@/store/agent';
|
6
|
+
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
7
|
+
|
8
|
+
const GPT5ReasoningEffortSlider = memo(() => {
|
9
|
+
const [config, updateAgentChatConfig] = useAgentStore((s) => [
|
10
|
+
agentChatConfigSelectors.currentChatConfig(s),
|
11
|
+
s.updateAgentChatConfig,
|
12
|
+
]);
|
13
|
+
|
14
|
+
const gpt5ReasoningEffort = config.gpt5ReasoningEffort || 'medium'; // Default to 'medium' if not set
|
15
|
+
|
16
|
+
const marks = {
|
17
|
+
0: 'minimal',
|
18
|
+
1: 'low',
|
19
|
+
2: 'medium',
|
20
|
+
3: 'high',
|
21
|
+
};
|
22
|
+
|
23
|
+
const effortValues = ['minimal', 'low', 'medium', 'high'];
|
24
|
+
const indexValue = effortValues.indexOf(gpt5ReasoningEffort);
|
25
|
+
const currentValue = indexValue === -1 ? 2 : indexValue;
|
26
|
+
|
27
|
+
const updateGPT5ReasoningEffort = useCallback(
|
28
|
+
(value: number) => {
|
29
|
+
const effort = effortValues[value] as 'minimal' | 'low' | 'medium' | 'high';
|
30
|
+
updateAgentChatConfig({ gpt5ReasoningEffort: effort });
|
31
|
+
},
|
32
|
+
[updateAgentChatConfig],
|
33
|
+
);
|
34
|
+
|
35
|
+
return (
|
36
|
+
<Flexbox
|
37
|
+
align={'center'}
|
38
|
+
gap={12}
|
39
|
+
horizontal
|
40
|
+
paddingInline={'0 20px'}
|
41
|
+
style={{ minWidth: 200, width: '100%' }}
|
42
|
+
>
|
43
|
+
<Flexbox flex={1}>
|
44
|
+
<Slider
|
45
|
+
marks={marks}
|
46
|
+
max={3}
|
47
|
+
min={0}
|
48
|
+
onChange={updateGPT5ReasoningEffort}
|
49
|
+
step={1}
|
50
|
+
tooltip={{ open: false }}
|
51
|
+
value={currentValue}
|
52
|
+
/>
|
53
|
+
</Flexbox>
|
54
|
+
</Flexbox>
|
55
|
+
);
|
56
|
+
});
|
57
|
+
|
58
|
+
export default GPT5ReasoningEffortSlider;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { Slider } from 'antd';
|
2
|
+
import { memo, useCallback } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
import { useAgentStore } from '@/store/agent';
|
6
|
+
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
7
|
+
|
8
|
+
const TextVerbositySlider = memo(() => {
|
9
|
+
const [config, updateAgentChatConfig] = useAgentStore((s) => [
|
10
|
+
agentChatConfigSelectors.currentChatConfig(s),
|
11
|
+
s.updateAgentChatConfig,
|
12
|
+
]);
|
13
|
+
|
14
|
+
const textVerbosity = config.textVerbosity || 'medium'; // Default to 'medium' if not set
|
15
|
+
|
16
|
+
const marks = {
|
17
|
+
0: 'low',
|
18
|
+
1: 'medium',
|
19
|
+
2: 'high',
|
20
|
+
};
|
21
|
+
|
22
|
+
const verbosityValues = ['low', 'medium', 'high'];
|
23
|
+
const indexValue = verbosityValues.indexOf(textVerbosity);
|
24
|
+
const currentValue = indexValue === -1 ? 1 : indexValue;
|
25
|
+
|
26
|
+
const updateTextVerbosity = useCallback(
|
27
|
+
(value: number) => {
|
28
|
+
const verbosity = verbosityValues[value] as 'low' | 'medium' | 'high';
|
29
|
+
updateAgentChatConfig({ textVerbosity: verbosity });
|
30
|
+
},
|
31
|
+
[updateAgentChatConfig],
|
32
|
+
);
|
33
|
+
|
34
|
+
return (
|
35
|
+
<Flexbox
|
36
|
+
align={'center'}
|
37
|
+
gap={12}
|
38
|
+
horizontal
|
39
|
+
paddingInline={'0 20px'}
|
40
|
+
style={{ minWidth: 200, width: '100%' }}
|
41
|
+
>
|
42
|
+
<Flexbox flex={1}>
|
43
|
+
<Slider
|
44
|
+
marks={marks}
|
45
|
+
max={2}
|
46
|
+
min={0}
|
47
|
+
onChange={updateTextVerbosity}
|
48
|
+
step={1}
|
49
|
+
tooltip={{ open: false }}
|
50
|
+
value={currentValue}
|
51
|
+
/>
|
52
|
+
</Flexbox>
|
53
|
+
</Flexbox>
|
54
|
+
);
|
55
|
+
});
|
56
|
+
|
57
|
+
export default TextVerbositySlider;
|
package/src/services/chat.ts
CHANGED
@@ -280,6 +280,14 @@ class ChatService {
|
|
280
280
|
extendParams.reasoning_effort = chatConfig.reasoningEffort;
|
281
281
|
}
|
282
282
|
|
283
|
+
if (modelExtendParams!.includes('gpt5ReasoningEffort') && chatConfig.gpt5ReasoningEffort) {
|
284
|
+
extendParams.reasoning_effort = chatConfig.gpt5ReasoningEffort;
|
285
|
+
}
|
286
|
+
|
287
|
+
if (modelExtendParams!.includes('textVerbosity') && chatConfig.textVerbosity) {
|
288
|
+
extendParams.verbosity = chatConfig.textVerbosity;
|
289
|
+
}
|
290
|
+
|
283
291
|
if (modelExtendParams!.includes('thinking') && chatConfig.thinking) {
|
284
292
|
extendParams.thinking = { type: chatConfig.thinking };
|
285
293
|
}
|