@lobehub/chat 0.20.0 → 0.21.0
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 +33 -0
- package/package.json +1 -1
- package/src/{features → components}/SliderWithInput/index.tsx +1 -0
- package/src/locales/default/setting.ts +1 -0
- package/src/pages/chat/[id]/Conversation/Input/Action.tsx +66 -7
- package/src/pages/chat/[id]/edit/AgentConfig/index.tsx +1 -1
- package/src/pages/setting/SettingForm.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.21.0](https://github.com/lobehub/lobe-chat/compare/v0.20.0...v0.21.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-07-25**</sup>
|
|
8
|
+
|
|
9
|
+
#### ♻ Code Refactoring
|
|
10
|
+
|
|
11
|
+
- **misc**: Move component folder.
|
|
12
|
+
|
|
13
|
+
#### ✨ Features
|
|
14
|
+
|
|
15
|
+
- **misc**: 支持快捷配置模型、温度.
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
21
|
+
|
|
22
|
+
#### Code refactoring
|
|
23
|
+
|
|
24
|
+
- **misc**: Move component folder ([fb85d16](https://github.com/lobehub/lobe-chat/commit/fb85d16))
|
|
25
|
+
|
|
26
|
+
#### What's improved
|
|
27
|
+
|
|
28
|
+
- **misc**: 支持快捷配置模型、温度, closes [#19](https://github.com/lobehub/lobe-chat/issues/19) ([31daee1](https://github.com/lobehub/lobe-chat/commit/31daee1))
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
<div align="right">
|
|
33
|
+
|
|
34
|
+
[](#readme-top)
|
|
35
|
+
|
|
36
|
+
</div>
|
|
37
|
+
|
|
5
38
|
## [Version 0.20.0](https://github.com/lobehub/lobe-chat/compare/v0.19.0...v0.20.0)
|
|
6
39
|
|
|
7
40
|
<sup>Released on **2023-07-25**</sup>
|
package/package.json
CHANGED
|
@@ -1,21 +1,80 @@
|
|
|
1
1
|
import { ActionIcon } from '@lobehub/ui';
|
|
2
|
-
import { Popconfirm } from 'antd';
|
|
3
|
-
import { BrainCog, Eraser, Thermometer
|
|
2
|
+
import { Dropdown, Popconfirm, Popover } from 'antd';
|
|
3
|
+
import { BrainCog, Eraser, Thermometer } from 'lucide-react';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { shallow } from 'zustand/shallow';
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import SliderWithInput from '@/components/SliderWithInput';
|
|
9
|
+
import { agentSelectors, useSessionStore } from '@/store/session';
|
|
10
|
+
import { LanguageModel } from '@/types/llm';
|
|
9
11
|
|
|
10
12
|
const InputActions = memo(() => {
|
|
11
13
|
const { t } = useTranslation('setting');
|
|
12
|
-
const [clearMessage] = useSessionStore(
|
|
14
|
+
const [clearMessage, updateAgentConfig] = useSessionStore(
|
|
15
|
+
(s) => [s.clearMessage, s.updateAgentConfig],
|
|
16
|
+
shallow,
|
|
17
|
+
);
|
|
18
|
+
const [model, temperature] = useSessionStore((s) => {
|
|
19
|
+
const config = agentSelectors.currentAgentConfigSafe(s);
|
|
20
|
+
return [
|
|
21
|
+
config.model,
|
|
22
|
+
config.params.temperature,
|
|
23
|
+
// config.historyCount
|
|
24
|
+
];
|
|
25
|
+
}, shallow);
|
|
13
26
|
|
|
14
27
|
return (
|
|
15
28
|
<>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
<Dropdown
|
|
30
|
+
menu={{
|
|
31
|
+
activeKey: model,
|
|
32
|
+
items: Object.values(LanguageModel).map((i) => ({ key: i, label: i })),
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
updateAgentConfig({ model: e.key as LanguageModel });
|
|
35
|
+
},
|
|
36
|
+
}}
|
|
37
|
+
trigger={['click']}
|
|
38
|
+
>
|
|
39
|
+
<ActionIcon icon={BrainCog} title={t('settingModel.model.title')} />
|
|
40
|
+
</Dropdown>
|
|
41
|
+
<Popover
|
|
42
|
+
content={
|
|
43
|
+
<SliderWithInput
|
|
44
|
+
max={1}
|
|
45
|
+
min={0}
|
|
46
|
+
onChange={(v) => {
|
|
47
|
+
updateAgentConfig({ params: { temperature: v } });
|
|
48
|
+
}}
|
|
49
|
+
step={0.1}
|
|
50
|
+
style={{ width: 120 }}
|
|
51
|
+
value={temperature}
|
|
52
|
+
/>
|
|
53
|
+
}
|
|
54
|
+
trigger={'click'}
|
|
55
|
+
>
|
|
56
|
+
<ActionIcon
|
|
57
|
+
icon={Thermometer}
|
|
58
|
+
title={t('settingModel.temperature.titleWithValue', { value: temperature })}
|
|
59
|
+
/>
|
|
60
|
+
</Popover>
|
|
61
|
+
{/*TODO 历史记录功能实现 */}
|
|
62
|
+
{/*<Popover*/}
|
|
63
|
+
{/* content={*/}
|
|
64
|
+
{/* <SliderWithInput*/}
|
|
65
|
+
{/* min={0}*/}
|
|
66
|
+
{/* onChange={(v) => {*/}
|
|
67
|
+
{/* updateAgentConfig({ historyCount: v });*/}
|
|
68
|
+
{/* }}*/}
|
|
69
|
+
{/* step={1}*/}
|
|
70
|
+
{/* style={{ width: 120 }}*/}
|
|
71
|
+
{/* value={historyCount}*/}
|
|
72
|
+
{/* />*/}
|
|
73
|
+
{/* }*/}
|
|
74
|
+
{/* trigger={'click'}*/}
|
|
75
|
+
{/*>*/}
|
|
76
|
+
{/* <ActionIcon icon={Timer} title={t('settingChat.historyCount.title')} />*/}
|
|
77
|
+
{/*</Popover>*/}
|
|
19
78
|
<Popconfirm
|
|
20
79
|
cancelText={t('cancel', { ns: 'common' })}
|
|
21
80
|
okButtonProps={{ danger: true }}
|
|
@@ -6,10 +6,10 @@ import { debounce } from 'lodash-es';
|
|
|
6
6
|
import { BrainCog, MessagesSquare } from 'lucide-react';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import SliderWithInput from 'src/components/SliderWithInput';
|
|
9
10
|
import { shallow } from 'zustand/shallow';
|
|
10
11
|
|
|
11
12
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
|
12
|
-
import SliderWithInput from '@/features/SliderWithInput';
|
|
13
13
|
import { agentSelectors, useSessionStore } from '@/store/session';
|
|
14
14
|
import { LanguageModel } from '@/types/llm';
|
|
15
15
|
import type { LobeAgentConfig } from '@/types/session';
|
|
@@ -5,11 +5,11 @@ import { debounce } from 'lodash-es';
|
|
|
5
5
|
import { AppWindow, BrainCog, MessagesSquare, Palette, Webhook } from 'lucide-react';
|
|
6
6
|
import { memo, useCallback, useMemo } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import SliderWithInput from 'src/components/SliderWithInput';
|
|
8
9
|
import { shallow } from 'zustand/shallow';
|
|
9
10
|
|
|
10
11
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
|
11
12
|
import AvatarWithUpload from '@/features/AvatarWithUpload';
|
|
12
|
-
import SliderWithInput from '@/features/SliderWithInput';
|
|
13
13
|
import { options } from '@/locales/options';
|
|
14
14
|
import { settingsSelectors, useSettings } from '@/store/settings';
|
|
15
15
|
import { DEFAULT_SETTINGS } from '@/store/settings/initialState';
|