@agentscope-ai/chat 1.1.52 → 1.1.53-beta.1773107147910

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.
@@ -25,7 +25,9 @@ export default function Input(props: InputProps) {
25
25
  beforeUI,
26
26
  afterUI,
27
27
  scalable = true,
28
- attachments
28
+ attachments,
29
+ prefix,
30
+ allowSpeech,
29
31
  } = senderOptions || {};
30
32
 
31
33
  const {
@@ -61,12 +63,14 @@ export default function Input(props: InputProps) {
61
63
  value={content}
62
64
  prefix={<>
63
65
  {uploadIconButton}
66
+ {prefix}
64
67
  </>}
65
68
  header={uploadFileListHeader}
66
69
  onChange={setContent}
67
70
  maxLength={maxLength}
68
71
  onSubmit={handleSubmit}
69
72
  onCancel={handleCancel}
73
+ allowSpeech={allowSpeech}
70
74
  />
71
75
  {afterUI}
72
76
  </div>
@@ -228,6 +228,16 @@ export interface IAgentScopeRuntimeWebUISenderOptions {
228
228
  * @descriptionEn Attachments configuration
229
229
  */
230
230
  attachments?: IAgentScopeRuntimeWebUISenderAttachmentsOptions;
231
+ /**
232
+ * @description 输入框前缀 UI,显示在输入框底部操作栏
233
+ * @descriptionEn Prefix UI displayed in the bottom action bar of the input
234
+ */
235
+ prefix?: React.ReactNode | React.ReactNode[];
236
+ /**
237
+ * @description 是否支持语音输入
238
+ * @descriptionEn Whether to allow speech input
239
+ */
240
+ allowSpeech?: boolean;
231
241
  }
232
242
 
233
243
  /**
@@ -15,8 +15,8 @@ import { useGetState } from 'ahooks';
15
15
  import { useChatAnywhereInput } from "../../Context/ChatAnywhereInputContext";
16
16
  import useAttachments from "./useAttachments";
17
17
  import { Fragment as _Fragment } from "react/jsx-runtime";
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  export default function Input(props) {
21
21
  var _useGetState = useGetState(''),
22
22
  _useGetState2 = _slicedToArray(_useGetState, 3),
@@ -44,7 +44,9 @@ export default function Input(props) {
44
44
  afterUI = _ref.afterUI,
45
45
  _ref$scalable = _ref.scalable,
46
46
  scalable = _ref$scalable === void 0 ? true : _ref$scalable,
47
- attachments = _ref.attachments;
47
+ attachments = _ref.attachments,
48
+ prefix = _ref.prefix,
49
+ allowSpeech = _ref.allowSpeech;
48
50
  var _useAttachments = useAttachments(attachments, {
49
51
  disabled: !!inputContext.disabled
50
52
  }),
@@ -96,14 +98,15 @@ export default function Input(props) {
96
98
  scalable: scalable,
97
99
  placeholder: placeholder,
98
100
  value: content,
99
- prefix: /*#__PURE__*/_jsx(_Fragment, {
100
- children: uploadIconButton
101
+ prefix: /*#__PURE__*/_jsxs(_Fragment, {
102
+ children: [uploadIconButton, prefix]
101
103
  }),
102
104
  header: uploadFileListHeader,
103
105
  onChange: setContent,
104
106
  maxLength: maxLength,
105
107
  onSubmit: handleSubmit,
106
- onCancel: handleCancel
108
+ onCancel: handleCancel,
109
+ allowSpeech: allowSpeech
107
110
  }), afterUI]
108
111
  }), disclaimer ? /*#__PURE__*/_jsx(Disclaimer, {
109
112
  desc: disclaimer
@@ -218,6 +218,16 @@ export interface IAgentScopeRuntimeWebUISenderOptions {
218
218
  * @descriptionEn Attachments configuration
219
219
  */
220
220
  attachments?: IAgentScopeRuntimeWebUISenderAttachmentsOptions;
221
+ /**
222
+ * @description 输入框前缀 UI,显示在输入框底部操作栏
223
+ * @descriptionEn Prefix UI displayed in the bottom action bar of the input
224
+ */
225
+ prefix?: React.ReactNode | React.ReactNode[];
226
+ /**
227
+ * @description 是否支持语音输入
228
+ * @descriptionEn Whether to allow speech input
229
+ */
230
+ allowSpeech?: boolean;
221
231
  }
222
232
  /**
223
233
  * @description 附件配置选项
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/chat",
3
- "version": "1.1.52",
3
+ "version": "1.1.53-beta.1773107147910",
4
4
  "description": "a free and open-source chat framework for building excellent LLM-powered chat experiences",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": [