@lobehub/ui 1.50.0 → 1.51.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/es/Chat/types.d.ts +1 -1
- package/es/ChatInputArea/Action.d.ts +11 -0
- package/es/ChatInputArea/Action.js +40 -0
- package/es/ChatInputArea/index.d.ts +2 -15
- package/es/ChatInputArea/index.js +8 -20
- package/es/ChatItem/index.d.ts +2 -1
- package/es/ChatItem/index.js +14 -11
- package/es/ChatList/index.d.ts +4 -1
- package/es/ChatList/index.js +10 -3
- package/es/EditableMessage/index.js +10 -10
- package/es/types/llm.d.ts +1 -1
- package/package.json +1 -1
package/es/Chat/types.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ActionProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description Actions to be displayed in the input area
|
|
5
|
+
*/
|
|
6
|
+
actions?: ReactNode;
|
|
7
|
+
expand?: boolean;
|
|
8
|
+
onExpandChange?: (expand: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Action: import("react").NamedExoticComponent<ActionProps>;
|
|
11
|
+
export default Action;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
import { Maximize2, Minimize2 } from 'lucide-react';
|
|
5
|
+
import { memo, useCallback } from 'react';
|
|
6
|
+
import ActionIcon from "../ActionIcon";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
var useStyles = createStyles(function (_ref) {
|
|
10
|
+
var css = _ref.css;
|
|
11
|
+
return {
|
|
12
|
+
actionLeft: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n gap: 4px;\n align-items: center;\n justify-content: flex-start;\n "]))),
|
|
13
|
+
actionsBar: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n align-items: center;\n justify-content: space-between;\n\n padding: 0 16px;\n "]))),
|
|
14
|
+
actionsRight: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 0;\n gap: 4px;\n align-items: center;\n justify-content: flex-end;\n "])))
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
var Action = /*#__PURE__*/memo(function (_ref2) {
|
|
18
|
+
var actions = _ref2.actions,
|
|
19
|
+
expand = _ref2.expand,
|
|
20
|
+
onExpandChange = _ref2.onExpandChange;
|
|
21
|
+
var _useStyles = useStyles(),
|
|
22
|
+
styles = _useStyles.styles;
|
|
23
|
+
var handleExpandClick = useCallback(function () {
|
|
24
|
+
if (onExpandChange) onExpandChange(!expand);
|
|
25
|
+
}, [expand]);
|
|
26
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
27
|
+
className: styles.actionsBar,
|
|
28
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
29
|
+
className: styles.actionLeft,
|
|
30
|
+
children: actions
|
|
31
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
32
|
+
className: styles.actionsRight,
|
|
33
|
+
children: /*#__PURE__*/_jsx(ActionIcon, {
|
|
34
|
+
icon: expand ? Minimize2 : Maximize2,
|
|
35
|
+
onClick: handleExpandClick
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export default Action;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { type InputRef } from 'antd';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { type TextAreaProps } from "../Input";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @description Actions to be displayed in the input area
|
|
7
|
-
*/
|
|
8
|
-
actions?: ReactNode;
|
|
4
|
+
import { ActionProps } from './Action';
|
|
5
|
+
export interface ChatInputAreaProps extends ActionProps, TextAreaProps {
|
|
9
6
|
/**
|
|
10
7
|
* @description Additional class name for the component
|
|
11
8
|
*/
|
|
@@ -19,11 +16,6 @@ export interface ChatInputAreaProps extends TextAreaProps {
|
|
|
19
16
|
* @default false
|
|
20
17
|
*/
|
|
21
18
|
disabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* @description Whether the input area is expanded
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
expand?: boolean;
|
|
27
19
|
/**
|
|
28
20
|
* @description Footer content to be displayed below the input area
|
|
29
21
|
*/
|
|
@@ -38,11 +30,6 @@ export interface ChatInputAreaProps extends TextAreaProps {
|
|
|
38
30
|
* @default 200
|
|
39
31
|
*/
|
|
40
32
|
minHeight?: number;
|
|
41
|
-
/**
|
|
42
|
-
* @description Callback function when the expand state changes
|
|
43
|
-
* @param expand - Whether the input area is expanded
|
|
44
|
-
*/
|
|
45
|
-
onExpandChange?: (expand: boolean) => void;
|
|
46
33
|
/**
|
|
47
34
|
* @description Callback function when the input value changes
|
|
48
35
|
* @param value - The current value of the input area
|
|
@@ -5,10 +5,9 @@ var _excluded = ["text", "textareaClassName", "style", "textareaStyle", "minHeig
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
import { Button } from 'antd';
|
|
8
|
-
import { Maximize2, Minimize2 } from 'lucide-react';
|
|
9
8
|
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
-
import ActionIcon from "../ActionIcon";
|
|
11
9
|
import { TextArea } from "../Input";
|
|
10
|
+
import Action from "./Action";
|
|
12
11
|
import InputHighlight from "./InputHighlight";
|
|
13
12
|
import { useStyles } from "./style";
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -41,17 +40,14 @@ var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
41
40
|
_ref$textareaId = _ref.textareaId,
|
|
42
41
|
textareaId = _ref$textareaId === void 0 ? 'lobe-chat-input-area' : _ref$textareaId,
|
|
43
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
var _useStyles = useStyles(),
|
|
44
|
+
cx = _useStyles.cx,
|
|
45
|
+
styles = _useStyles.styles;
|
|
44
46
|
var isChineseInput = useRef(false);
|
|
45
47
|
var _useState = useState(defaultValue),
|
|
46
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
49
|
value = _useState2[0],
|
|
48
50
|
setValue = _useState2[1];
|
|
49
|
-
var _useStyles = useStyles(),
|
|
50
|
-
cx = _useStyles.cx,
|
|
51
|
-
styles = _useStyles.styles;
|
|
52
|
-
var handleExpandClick = useCallback(function () {
|
|
53
|
-
if (onExpandChange) onExpandChange(!expand);
|
|
54
|
-
}, [expand]);
|
|
55
51
|
var handleSend = useCallback(function () {
|
|
56
52
|
if (disabled) return;
|
|
57
53
|
if (onSend) onSend(value);
|
|
@@ -65,18 +61,10 @@ var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
65
61
|
style: _objectSpread({
|
|
66
62
|
minHeight: minHeight
|
|
67
63
|
}, style),
|
|
68
|
-
children: [/*#__PURE__*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: actions
|
|
73
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
74
|
-
className: styles.actionsRight,
|
|
75
|
-
children: /*#__PURE__*/_jsx(ActionIcon, {
|
|
76
|
-
icon: expand ? Minimize2 : Maximize2,
|
|
77
|
-
onClick: handleExpandClick
|
|
78
|
-
})
|
|
79
|
-
})]
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Action, {
|
|
65
|
+
actions: actions,
|
|
66
|
+
expand: expand,
|
|
67
|
+
onExpandChange: onExpandChange
|
|
80
68
|
}), /*#__PURE__*/_jsxs("div", {
|
|
81
69
|
className: styles.textareaContainer,
|
|
82
70
|
children: [/*#__PURE__*/_jsx(InputHighlight, {
|
package/es/ChatItem/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface ChatItemProps {
|
|
|
33
33
|
/**
|
|
34
34
|
* @description The message content of the chat item
|
|
35
35
|
*/
|
|
36
|
-
message?:
|
|
36
|
+
message?: ReactNode;
|
|
37
37
|
messageExtra?: ReactNode;
|
|
38
38
|
/**
|
|
39
39
|
* @description Callback when the message content changes
|
|
@@ -54,6 +54,7 @@ export interface ChatItemProps {
|
|
|
54
54
|
* @description Whether the chat item is primary
|
|
55
55
|
*/
|
|
56
56
|
primary?: boolean;
|
|
57
|
+
renderMessage?: (content: ReactNode) => ReactNode;
|
|
57
58
|
/**
|
|
58
59
|
* @description Whether to show the title of the chat item
|
|
59
60
|
*/
|
package/es/ChatItem/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["actions", "className", "primary", "borderSpacing", "loading", "message", "placement", "type", "avatar", "alert", "showTitle", "time", "editing", "onChange", "onEditingChange", "messageExtra"];
|
|
3
|
+
var _excluded = ["actions", "className", "primary", "borderSpacing", "loading", "message", "placement", "type", "avatar", "alert", "showTitle", "time", "editing", "onChange", "onEditingChange", "messageExtra", "renderMessage"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { Alert } from 'antd';
|
|
@@ -34,6 +34,7 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
34
34
|
onChange = _ref.onChange,
|
|
35
35
|
onEditingChange = _ref.onEditingChange,
|
|
36
36
|
messageExtra = _ref.messageExtra,
|
|
37
|
+
renderMessage = _ref.renderMessage,
|
|
37
38
|
properties = _objectWithoutProperties(_ref, _excluded);
|
|
38
39
|
var _useStyles = useStyles({
|
|
39
40
|
avatarSize: AVATAR_SIZE,
|
|
@@ -45,6 +46,17 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
45
46
|
}),
|
|
46
47
|
cx = _useStyles.cx,
|
|
47
48
|
styles = _useStyles.styles;
|
|
49
|
+
var content = /*#__PURE__*/_jsx(EditableMessage, {
|
|
50
|
+
classNames: {
|
|
51
|
+
input: styles.editingInput
|
|
52
|
+
},
|
|
53
|
+
editButtonSize: 'small',
|
|
54
|
+
editing: editing,
|
|
55
|
+
onChange: onChange,
|
|
56
|
+
onEditingChange: onEditingChange,
|
|
57
|
+
value: String(message || '...')
|
|
58
|
+
});
|
|
59
|
+
var messageContent = renderMessage ? renderMessage(content) : content;
|
|
48
60
|
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
49
61
|
className: cx(styles.container, className)
|
|
50
62
|
}, properties), {}, {
|
|
@@ -80,16 +92,7 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
80
92
|
showIcon: true
|
|
81
93
|
}, alert)) : /*#__PURE__*/_jsxs(Flexbox, {
|
|
82
94
|
className: cx(styles.message, editing && styles.editingContainer),
|
|
83
|
-
children: [/*#__PURE__*/_jsx(
|
|
84
|
-
classNames: {
|
|
85
|
-
input: styles.editingInput
|
|
86
|
-
},
|
|
87
|
-
editButtonSize: 'small',
|
|
88
|
-
editing: editing,
|
|
89
|
-
onChange: onChange,
|
|
90
|
-
onEditingChange: onEditingChange,
|
|
91
|
-
value: String(message || '...')
|
|
92
|
-
}), messageExtra && !editing ? /*#__PURE__*/_jsx("div", {
|
|
95
|
+
children: [messageContent, messageExtra && !editing ? /*#__PURE__*/_jsx("div", {
|
|
93
96
|
className: styles.messageExtra,
|
|
94
97
|
children: messageExtra
|
|
95
98
|
}) : null]
|
package/es/ChatList/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { ChatItemProps } from "../ChatItem";
|
|
3
3
|
import type { DivProps } from "../types";
|
|
4
4
|
import { ChatMessage } from "../types/chatMessage";
|
|
5
|
-
declare type MessageExtra = (props: ChatMessage) => ReactNode;
|
|
5
|
+
export declare type MessageExtra = (props: ChatMessage) => ReactNode;
|
|
6
|
+
export declare type RenderMessage = (content: ReactNode, message: ChatMessage) => ReactNode;
|
|
6
7
|
export interface ChatListProps extends DivProps {
|
|
7
8
|
/**
|
|
8
9
|
* @description Data of chat messages to be displayed
|
|
@@ -15,6 +16,7 @@ export interface ChatListProps extends DivProps {
|
|
|
15
16
|
*/
|
|
16
17
|
onActionClick?: (actionKey: string, messageId: string) => void;
|
|
17
18
|
onMessageChange?: (id: string, content: string) => void;
|
|
19
|
+
renderMessage?: RenderMessage;
|
|
18
20
|
renderMessageExtra?: MessageExtra;
|
|
19
21
|
/**
|
|
20
22
|
* @description Whether to show name of the chat item
|
|
@@ -31,6 +33,7 @@ export interface ItemProps extends ChatMessage {
|
|
|
31
33
|
MessageExtra?: MessageExtra;
|
|
32
34
|
onActionClick?: (actionKey: string, messageId: string) => void;
|
|
33
35
|
onMessageChange?: (id: string, content: string) => void;
|
|
36
|
+
renderMessage?: RenderMessage;
|
|
34
37
|
showTitle?: boolean;
|
|
35
38
|
type: 'docs' | 'chat';
|
|
36
39
|
}
|
package/es/ChatList/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["MessageExtra", "showTitle", "onActionClick", "onMessageChange", "type"],
|
|
5
|
-
_excluded2 = ["onActionClick", "renderMessageExtra", "className", "data", "type", "showTitle", "onMessageChange"];
|
|
4
|
+
var _excluded = ["MessageExtra", "showTitle", "onActionClick", "onMessageChange", "type", "renderMessage"],
|
|
5
|
+
_excluded2 = ["onActionClick", "renderMessageExtra", "className", "data", "type", "showTitle", "onMessageChange", "renderMessage"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
import { App } from 'antd';
|
|
9
9
|
import copy from 'copy-to-clipboard';
|
|
10
|
-
import { memo, useState } from 'react';
|
|
10
|
+
import { memo, useCallback, useState } from 'react';
|
|
11
11
|
import ChatItem from "../ChatItem";
|
|
12
12
|
import ActionsBar from "./ActionsBar";
|
|
13
13
|
import { useStyles } from "./style";
|
|
@@ -18,6 +18,7 @@ var Item = function Item(_ref) {
|
|
|
18
18
|
_onActionClick = _ref.onActionClick,
|
|
19
19
|
onMessageChange = _ref.onMessageChange,
|
|
20
20
|
type = _ref.type,
|
|
21
|
+
renderMessage = _ref.renderMessage,
|
|
21
22
|
item = _objectWithoutProperties(_ref, _excluded);
|
|
22
23
|
var renderMessageExtra = MessageExtra ? /*#__PURE__*/_jsx(MessageExtra, _objectSpread({}, item)) : undefined;
|
|
23
24
|
var _useState = useState(false),
|
|
@@ -26,6 +27,9 @@ var Item = function Item(_ref) {
|
|
|
26
27
|
setEditing = _useState2[1];
|
|
27
28
|
var _App$useApp = App.useApp(),
|
|
28
29
|
message = _App$useApp.message;
|
|
30
|
+
var innerRenderMessage = useCallback(function (content) {
|
|
31
|
+
return renderMessage === null || renderMessage === void 0 ? void 0 : renderMessage(content, item);
|
|
32
|
+
}, [renderMessage]);
|
|
29
33
|
return /*#__PURE__*/_jsx(ChatItem, {
|
|
30
34
|
actions: /*#__PURE__*/_jsx(ActionsBar, {
|
|
31
35
|
onActionClick: function onActionClick(actionKey) {
|
|
@@ -56,6 +60,7 @@ var Item = function Item(_ref) {
|
|
|
56
60
|
onEditingChange: setEditing,
|
|
57
61
|
placement: type === 'chat' ? item.role === 'user' ? 'right' : 'left' : 'left',
|
|
58
62
|
primary: item.role === 'user',
|
|
63
|
+
renderMessage: renderMessage ? innerRenderMessage : undefined,
|
|
59
64
|
showTitle: showTitle,
|
|
60
65
|
time: item.updateAt || item.createAt,
|
|
61
66
|
type: type === 'chat' ? 'block' : 'pure'
|
|
@@ -70,6 +75,7 @@ var ChatList = /*#__PURE__*/memo(function (_ref2) {
|
|
|
70
75
|
type = _ref2$type === void 0 ? 'chat' : _ref2$type,
|
|
71
76
|
showTitle = _ref2.showTitle,
|
|
72
77
|
onMessageChange = _ref2.onMessageChange,
|
|
78
|
+
renderMessage = _ref2.renderMessage,
|
|
73
79
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
74
80
|
var _useStyles = useStyles(),
|
|
75
81
|
cx = _useStyles.cx,
|
|
@@ -82,6 +88,7 @@ var ChatList = /*#__PURE__*/memo(function (_ref2) {
|
|
|
82
88
|
MessageExtra: MessageExtra,
|
|
83
89
|
onActionClick: onActionClick,
|
|
84
90
|
onMessageChange: onMessageChange,
|
|
91
|
+
renderMessage: renderMessage,
|
|
85
92
|
showTitle: showTitle,
|
|
86
93
|
type: type
|
|
87
94
|
}, item), item.id);
|
|
@@ -50,16 +50,7 @@ var EditableMessage = /*#__PURE__*/memo(function (_ref) {
|
|
|
50
50
|
placeholder: placeholder,
|
|
51
51
|
style: styles === null || styles === void 0 ? void 0 : styles.input
|
|
52
52
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
|
-
children: [/*#__PURE__*/_jsx(
|
|
54
|
-
editing: isEdit,
|
|
55
|
-
onChange: function onChange(text) {
|
|
56
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
57
|
-
},
|
|
58
|
-
onEditingChange: setTyping,
|
|
59
|
-
onOpenChange: setExpand,
|
|
60
|
-
open: expand,
|
|
61
|
-
value: value
|
|
62
|
-
}), !expand && isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
|
53
|
+
children: [!expand && isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
|
63
54
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.input,
|
|
64
55
|
defaultValue: value,
|
|
65
56
|
editButtonSize: editButtonSize,
|
|
@@ -76,6 +67,15 @@ var EditableMessage = /*#__PURE__*/memo(function (_ref) {
|
|
|
76
67
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.markdown,
|
|
77
68
|
style: styles === null || styles === void 0 ? void 0 : styles.markdown,
|
|
78
69
|
children: value
|
|
70
|
+
}), /*#__PURE__*/_jsx(MessageModal, {
|
|
71
|
+
editing: isEdit,
|
|
72
|
+
onChange: function onChange(text) {
|
|
73
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
74
|
+
},
|
|
75
|
+
onEditingChange: setTyping,
|
|
76
|
+
onOpenChange: setExpand,
|
|
77
|
+
open: expand,
|
|
78
|
+
value: value
|
|
79
79
|
})]
|
|
80
80
|
});
|
|
81
81
|
});
|
package/es/types/llm.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface LMParameters {
|
|
|
34
34
|
*/
|
|
35
35
|
top_p?: number;
|
|
36
36
|
}
|
|
37
|
-
export declare type LLMRoleType = 'user' | 'system' | 'assistant';
|
|
37
|
+
export declare type LLMRoleType = 'user' | 'system' | 'assistant' | 'function';
|
|
38
38
|
export interface LLMMessage {
|
|
39
39
|
content: string;
|
|
40
40
|
role: LLMRoleType;
|