@agentscope-ai/chat 1.1.45-beta.1766394603804 → 1.1.45-beta.1766406069468
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/components/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Actions.tsx +3 -1
- package/components/AgentScopeRuntimeWebUI/core/types/IChatAnywhere.ts +6 -0
- package/lib/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Actions.js +6 -2
- package/lib/AgentScopeRuntimeWebUI/core/types/IChatAnywhere.d.ts +5 -0
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ export default function Tools(props: {
|
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
35
|
|
|
36
|
+
const replace = useChatAnywhereOptions(v => v.actions?.replace) ?? true;
|
|
37
|
+
|
|
36
38
|
const actions = compact([
|
|
37
39
|
...actionsOptionsList.map(i => {
|
|
38
40
|
const res = i;
|
|
@@ -46,7 +48,7 @@ export default function Tools(props: {
|
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
}),
|
|
49
|
-
props.isLast ? {
|
|
51
|
+
replace && props.isLast ? {
|
|
50
52
|
icon: <Tooltip title="重新生成"><SparkReplaceLine /></Tooltip>,
|
|
51
53
|
onClick: () => {
|
|
52
54
|
emit({
|
|
@@ -345,6 +345,12 @@ export interface IAgentScopeRuntimeWebUIActionsOptions {
|
|
|
345
345
|
}) => React.ReactElement;
|
|
346
346
|
onClick?: ({ data }: { data: IAgentScopeRuntimeResponse }) => void;
|
|
347
347
|
}[];
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @description 是否显示重新生成按钮
|
|
351
|
+
* @descriptionEn Whether to show the replace button
|
|
352
|
+
*/
|
|
353
|
+
replace?: boolean;
|
|
348
354
|
}
|
|
349
355
|
|
|
350
356
|
/**
|
|
@@ -26,7 +26,7 @@ function Usage(props) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
export default function Tools(props) {
|
|
29
|
-
var _props$data$usage, _props$data$usage2;
|
|
29
|
+
var _useChatAnywhereOptio, _props$data$usage, _props$data$usage2;
|
|
30
30
|
var actionsOptionsList = useChatAnywhereOptions(function (v) {
|
|
31
31
|
var _v$actions;
|
|
32
32
|
return (_v$actions = v.actions) === null || _v$actions === void 0 ? void 0 : _v$actions.list;
|
|
@@ -36,6 +36,10 @@ export default function Tools(props) {
|
|
|
36
36
|
copy(JSON.stringify(props.data));
|
|
37
37
|
}
|
|
38
38
|
}];
|
|
39
|
+
var replace = (_useChatAnywhereOptio = useChatAnywhereOptions(function (v) {
|
|
40
|
+
var _v$actions2;
|
|
41
|
+
return (_v$actions2 = v.actions) === null || _v$actions2 === void 0 ? void 0 : _v$actions2.replace;
|
|
42
|
+
})) !== null && _useChatAnywhereOptio !== void 0 ? _useChatAnywhereOptio : true;
|
|
39
43
|
var actions = compact([].concat(_toConsumableArray(actionsOptionsList.map(function (i) {
|
|
40
44
|
var res = i;
|
|
41
45
|
if (i.render) {
|
|
@@ -49,7 +53,7 @@ export default function Tools(props) {
|
|
|
49
53
|
(_i$onClick = i.onClick) === null || _i$onClick === void 0 || _i$onClick.call(i, props);
|
|
50
54
|
}
|
|
51
55
|
});
|
|
52
|
-
})), [props.isLast ? {
|
|
56
|
+
})), [replace && props.isLast ? {
|
|
53
57
|
icon: /*#__PURE__*/_jsx(Tooltip, {
|
|
54
58
|
title: "\u91CD\u65B0\u751F\u6210",
|
|
55
59
|
children: /*#__PURE__*/_jsx(SparkReplaceLine, {})
|
|
@@ -332,6 +332,11 @@ export interface IAgentScopeRuntimeWebUIActionsOptions {
|
|
|
332
332
|
data: IAgentScopeRuntimeResponse;
|
|
333
333
|
}) => void;
|
|
334
334
|
}[];
|
|
335
|
+
/**
|
|
336
|
+
* @description 是否显示重新生成按钮
|
|
337
|
+
* @descriptionEn Whether to show the replace button
|
|
338
|
+
*/
|
|
339
|
+
replace?: boolean;
|
|
335
340
|
}
|
|
336
341
|
/**
|
|
337
342
|
* @description 输入框上下文状态接口
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentscope-ai/chat",
|
|
3
|
-
"version": "1.1.45-beta.
|
|
3
|
+
"version": "1.1.45-beta.1766406069468",
|
|
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": [
|