@lobehub/chat 0.89.8 → 0.89.9

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.89.9](https://github.com/lobehub/lobe-chat/compare/v0.89.8...v0.89.9)
6
+
7
+ <sup>Released on **2023-10-17**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix ChatList FC Render.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix ChatList FC Render ([4b8bdbd](https://github.com/lobehub/lobe-chat/commit/4b8bdbd))
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.89.8](https://github.com/lobehub/lobe-chat/compare/v0.89.7...v0.89.8)
6
31
 
7
32
  <sup>Released on **2023-10-16**</sup>
package/README.md CHANGED
@@ -86,14 +86,14 @@ Please be aware that LobeChat is currently under active development, and feedbac
86
86
 
87
87
  ## ✨ Features
88
88
 
89
- - [x] 💨 **Quick Deployment**: Using the Vercel platform, you can deploy with just one click and complete the process within 1 minute without any complex configuration;
90
- - [x] 💎 **Exquisite UI Design**: With a carefully designed interface, it offers an elegant appearance and smooth interaction. It supports light and dark themes and is mobile-friendly. PWA support provides a more native-like experience;
91
- - [x] 🗣️ **Smooth Conversation Experience**: Fluid responses ensure a smooth conversation experience. It fully supports Markdown rendering, including code highlighting, LaTex formulas, Mermaid flowcharts, and more;
92
- - [x] 🧩 **Plugin Support & Custom Plugin Development**: Conversations are extendable with plugins. Users can install and use various plugins, such as search engines, web extraction, etc. It also supports the development of custom plugins to meet custom needs;
89
+ - [x] 💨 **Quick Deployment**: Using the Vercel platform, you can deploy with just one click and complete the process within 1 minute without any complex configuration.
90
+ - [x] 💎 **Exquisite UI Design**: With a carefully designed interface, it offers an elegant appearance and smooth interaction. It supports light and dark themes and is mobile-friendly. PWA support provides a more native-like experience.
91
+ - [x] 🗣️ **Smooth Conversation Experience**: Fluid responses ensure a smooth conversation experience. It fully supports Markdown rendering, including code highlighting, LaTex formulas, Mermaid flowcharts, and more.
92
+ - [x] 🧩 **Plugin Support & Custom Plugin Development**: Conversations are extendable with plugins. Users can install and use various plugins, such as search engines, web extraction, etc. It also supports the development of custom plugins to meet custom needs.
93
93
  - [x] 🔒 **Privacy Protection**: All data is stored locally in the user's browser, ensuring user privacy;
94
94
  - [x] 🤖 **Customizable Agent Roles**: Users can create, share, and debug personalized dialogue agent roles according to their needs, providing more flexible and customized dialogue functions;
95
95
  - [x] 🌐 **Custom Domain**: If users have their own domain, they can bind it to the platform for quick access to the dialogue agent from anywhere.
96
- - [x] 🏬 **Role Market**: A Role Market is provided where users can select their preferred dialogue agent roles, enriching the content and style of the dialogue;
96
+ - [x] 🏬 **Role Market**: A Role Market is provided where users can select their preferred dialogue agent roles, enriching the content and style of the dialogue.
97
97
 
98
98
  > **Note**\
99
99
  > You can find our upcoming [Roadmap][github-project-link] plans in the Projects section.
@@ -183,8 +183,8 @@ LobeChat provides Self-Hosted Version with Vercel and [Docker Image][docker-rele
183
183
  If you want to deploy this service yourself on Vercel, you can follow these steps:
184
184
 
185
185
  - Prepare your [OpenAI API Key](https://platform.openai.com/account/api-keys).
186
- - Click the button below to start deployment: Deploy with Vercel. Log in directly with your GitHub account, and remember to fill in the `OPENAI_API_KEY`(required) and `ACCESS_CODE` (recommended) on the environment variable section;
187
- - After deployment, you can start using it;
186
+ - Click the button below to start deployment: Deploy with Vercel. Log in directly with your GitHub account, and remember to fill in the `OPENAI_API_KEY`(required) and `ACCESS_CODE` (recommended) on the environment variable section.
187
+ - After deployment, you can start using it.
188
188
  - Bind a custom domain (optional): The DNS of the domain assigned by Vercel is polluted in some areas; binding a custom domain can connect directly.
189
189
 
190
190
  <div align="center">
@@ -279,8 +279,8 @@ Plugins provide a means to extend the [Function Calling][fc-link] capabilities o
279
279
  > The plugin system is currently undergoing major development. You can learn more in the following issues:
280
280
  >
281
281
  > - [x] [**Plugin Phase 1**](https://github.com/lobehub/lobe-chat/issues/73): Implement separation of the plugin from the main body, split the plugin into an independent repository for maintenance, and realize dynamic loading of the plugin.
282
- > - [x] [**Plugin Phase 2**](https://github.com/lobehub/lobe-chat/issues/97): The security and stability of the plugin's use, more accurately presenting abnormal states, the maintainability of the plugin architecture and developer-friendly.
283
- > - [ ] [**Plugin Phase 3**](https://github.com/lobehub/lobe-chat/issues/149): Higher-level and more comprehensive customization capabilities, support for plugin authentication and examples.
282
+ > - [x] [**Plugin Phase 2**](https://github.com/lobehub/lobe-chat/issues/97): The security and stability of the plugin's use, more accurately presenting abnormal states, the maintainability of the plugin architecture, and developer-friendly.
283
+ > - [ ] [**Plugin Phase 3**](https://github.com/lobehub/lobe-chat/issues/149): Higher-level and more comprehensive customization capabilities, support for plugin authentication, and examples.
284
284
 
285
285
  | Official Plugin | Description |
286
286
  | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -335,7 +335,7 @@ Contributions of all types are more than welcome; if you are interested in contr
335
335
 
336
336
  ## 🔗 More Products
337
337
 
338
- - **[🤯 Lobe Theme][lobe-theme]:** The modern theme for stable diffusion webui, exquisite interface design, highly customizable UI, and efficiency-boosting features.
338
+ - **[🤯 Lobe Theme][lobe-theme]:** The modern theme for stable diffusion WebUI, exquisite interface design, highly customizable UI, and efficiency-boosting features.
339
339
  - **[🌏 Lobe i18n][lobe-i18n] :** Lobe i18n is an automation tool for the i18n (internationalization) translation process, powered by ChatGPT. It supports features such as automatic splitting of large files, incremental updates, and customization options for the OpenAI model, API proxy, and temperature.
340
340
  - **[💌 Lobe Commit][lobe-commit]:** Lobe Commit is a CLI tool that leverages Langchain/ChatGPT to generate Gitmoji-based commit messages.
341
341
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.89.8",
3
+ "version": "0.89.9",
4
4
  "description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -13,6 +13,7 @@ import { Flexbox } from 'react-layout-kit';
13
13
 
14
14
  import { useSessionStore } from '@/store/session';
15
15
  import { agentSelectors } from '@/store/session/slices/agentConfig';
16
+ import { currentFunctionCallProps } from '@/store/session/slices/chat/selectors/chat';
16
17
  import { isFunctionMessage } from '@/utils/message';
17
18
 
18
19
  import FunctionCall from '../Plugins/FunctionCall';
@@ -33,23 +34,14 @@ const useStyles = createStyles(({ css }) => ({
33
34
 
34
35
  export const AssistantMessage: RenderMessage = memo(
35
36
  ({ id, plugin, function_call, content, ...props }) => {
36
- const chatLoadingId = useSessionStore((s) => s.chatLoadingId);
37
+ const genFunctionCallProps = useSessionStore(currentFunctionCallProps);
37
38
 
38
39
  if (!isFunctionMessage(content)) return <DefautMessage content={content} id={id} {...props} />;
39
40
 
40
- const itemId = plugin?.identifier || function_call?.name;
41
- const command = plugin ?? function_call;
42
- const args = command?.arguments;
43
- const fcProps = {
44
- arguments: args,
45
- command,
46
- content: content,
47
- id: itemId,
48
- loading: id === chatLoadingId,
49
- };
41
+ const fcProps = genFunctionCallProps({ content, function_call, id, plugin });
50
42
 
51
43
  return (
52
- <div id={itemId}>
44
+ <div id={id}>
53
45
  <FunctionCall {...fcProps} />
54
46
  </div>
55
47
  );
@@ -1,6 +1,6 @@
1
1
  import { RenderMessage } from '@lobehub/ui';
2
2
  import { memo } from 'react';
3
3
 
4
- export const DefautMessage: RenderMessage = memo(({ id, content }) => {
5
- return <div id={id}>{content}</div>;
4
+ export const DefautMessage: RenderMessage = memo(({ id, editableContent }) => {
5
+ return <div id={id}>{editableContent}</div>;
6
6
  });
@@ -3,32 +3,24 @@ import { memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
4
 
5
5
  import { useSessionStore } from '@/store/session';
6
+ import { currentFunctionCallProps } from '@/store/session/slices/chat/selectors/chat';
6
7
 
7
8
  import FunctionCall from '../Plugins/FunctionCall';
8
9
  import PluginMessage from '../Plugins/PluginMessage';
9
10
 
10
11
  export const FunctionMessage: RenderMessage = memo(
11
12
  ({ id, content, plugin, function_call, ...props }) => {
12
- const chatLoadingId = useSessionStore((s) => s.chatLoadingId);
13
- const itemId = plugin?.identifier || function_call?.name;
14
- const command = plugin ?? function_call;
15
- const args = command?.arguments;
16
- const fcProps = {
17
- arguments: args,
18
- command,
19
- content,
20
- id,
21
- loading: id === chatLoadingId,
22
- };
13
+ const genFunctionCallProps = useSessionStore(currentFunctionCallProps);
14
+ const fcProps = genFunctionCallProps({ content, function_call, id, plugin });
23
15
 
24
16
  return (
25
- <Flexbox gap={12} id={itemId}>
17
+ <Flexbox gap={12} id={id}>
26
18
  <FunctionCall {...fcProps} />
27
19
  <PluginMessage
28
20
  content={content}
29
21
  function_call={function_call}
30
22
  id={id}
31
- loading={id === chatLoadingId}
23
+ loading={fcProps.loading}
32
24
  plugin={plugin}
33
25
  {...props}
34
26
  />
@@ -30,6 +30,8 @@ const FunctionCall = memo<FunctionCallProps>(
30
30
  const pluginAvatar = pluginHelpers.getPluginAvatar(item?.meta);
31
31
  const pluginTitle = pluginHelpers.getPluginTitle(item?.meta);
32
32
 
33
+ console.log(item?.meta);
34
+
33
35
  const avatar = pluginAvatar ? (
34
36
  <Avatar avatar={pluginAvatar} size={32} />
35
37
  ) : (
@@ -1,5 +1,6 @@
1
1
  import { t } from 'i18next';
2
2
 
3
+ import { FunctionCallProps } from '@/app/chat/features/Conversation/ChatList/Plugins/FunctionCall';
3
4
  import { DEFAULT_INBOX_AVATAR, DEFAULT_USER_AVATAR } from '@/const/meta';
4
5
  import { INBOX_SESSION_ID } from '@/const/session';
5
6
  import { useGlobalStore } from '@/store/global';
@@ -84,3 +85,23 @@ export const chatsMessageString = (s: SessionStore): string => {
84
85
  const chats = currentChatsWithHistoryConfig(s);
85
86
  return chats.map((m) => m.content).join('');
86
87
  };
88
+
89
+ export const currentFunctionCallProps = (
90
+ s: SessionStore,
91
+ ): ((
92
+ props: Pick<ChatMessage, 'plugin' | 'function_call' | 'content' | 'id'>,
93
+ ) => FunctionCallProps) => {
94
+ const chatLoadingId = s.chatLoadingId;
95
+ return ({ plugin, function_call, content, id }) => {
96
+ const itemId = plugin?.identifier || function_call?.name;
97
+ const command = plugin ?? function_call;
98
+ const args = command?.arguments;
99
+ return {
100
+ arguments: args,
101
+ command,
102
+ content,
103
+ id: itemId,
104
+ loading: id === chatLoadingId,
105
+ };
106
+ };
107
+ };