@lobehub/chat 0.40.1 → 0.40.2

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 CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.40.2](https://github.com/lobehub/lobe-chat/compare/v0.40.1...v0.40.2)
6
+
7
+ <sup>Released on **2023-08-08**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: 修正 defaults 造成的 config 报错.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: 修正 defaults 造成的 config 报错 ([0857fa7](https://github.com/lobehub/lobe-chat/commit/0857fa7))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 0.40.1](https://github.com/lobehub/lobe-chat/compare/v0.40.0...v0.40.1)
6
31
 
7
32
  <sup>Released on **2023-08-06**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.40.1",
3
+ "version": "0.40.2",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -1,5 +1,5 @@
1
1
  import { t } from 'i18next';
2
- import { defaults } from 'lodash-es';
2
+ import { merge } from 'lodash-es';
3
3
 
4
4
  import { DEFAULT_AVATAR, DEFAULT_BACKGROUND_COLOR } from '@/const/meta';
5
5
  import { Autocomplete } from '@/features/AgentSetting/AgentMeta';
@@ -37,12 +37,13 @@ const currentAgentBackgroundColor = (s: SessionStore) => {
37
37
  const currentAgentAvatar = (s: SessionStore) => {
38
38
  const session = sessionSelectors.currentSession(s);
39
39
  if (!session) return DEFAULT_AVATAR;
40
+
40
41
  return session.meta.avatar || DEFAULT_AVATAR;
41
42
  };
42
43
 
43
44
  const currentAgentConfig = (s: SessionStore) => {
44
45
  const session = sessionSelectors.currentSession(s);
45
- return defaults(session?.config, initialLobeAgentConfig);
46
+ return merge({}, initialLobeAgentConfig, session?.config);
46
47
  };
47
48
 
48
49
  const currentAgentSystemRole = (s: SessionStore) => {
@@ -67,8 +68,8 @@ const hasSystemRole = (s: SessionStore) => {
67
68
  return !!config.systemRole;
68
69
  };
69
70
 
70
- export const getAvatar = (s: MetaData) => s.avatar || DEFAULT_AVATAR;
71
- export const getTitle = (s: MetaData) => s.title || t('defaultSession', { ns: 'common' });
71
+ const getAvatar = (s: MetaData) => s.avatar || DEFAULT_AVATAR;
72
+ const getTitle = (s: MetaData) => s.title || t('defaultSession', { ns: 'common' });
72
73
 
73
74
  export const getDescription = (s: MetaData) =>
74
75
  s.description || t('noDescription', { ns: 'common' });