Skip to content

Commit 20f7d69

Browse files
committed
feat: action tools add retrun params need_llm_call
1 parent 7b3c89f commit 20f7d69

File tree

1 file changed

+24
-7
lines changed
  • src/agentcraft-all/agentcraft-fe/features/actionTools

1 file changed

+24
-7
lines changed

src/agentcraft-all/agentcraft-fe/features/actionTools/index.tsx

+24-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from "react";
2-
import { Card, Flex, Button, Box, Table, Modal, TextInput, Text, Highlight, LoadingOverlay, Select, Textarea, Code, Loader, Badge } from '@mantine/core';
2+
import { Group, Card, Flex, Button, Box, Table, Modal, TextInput, Text, Highlight, LoadingOverlay, Select, Textarea, Code, Loader, Badge, Radio } from '@mantine/core';
33
import { useForm } from '@mantine/form';
44
import { modals } from '@mantine/modals';
55
import { notifications } from '@mantine/notifications';
@@ -78,12 +78,28 @@ function AddOrUpdate() {
7878
data={functionList}
7979
{...form.getInputProps('name')}
8080
/>
81-
<TextInput label="名称" placeholder="工具名" {...form.getInputProps('alias')} />
82-
<Textarea withAsterisk label="描述" placeholder="输入工具描述" {...form.getInputProps('description')} description={<div><span >参考示例:</span><CopyToClipboard value={"文生图是一个AI绘画(图像生成)服务,输入文本描述,返回根据文本作画得到的图片的URL"} content={"文生图是一个AI绘画(图像生成)服务,输入文本描述,返回根据文本作画得到的图片的URL"} position={"none"} /> </div>} />
83-
<Textarea withAsterisk label="输入参数" placeholder="输入参数" {...form.getInputProps('input_schema')} description={<div><span >参考示例:</span><CopyToClipboard value={"[ { 'name': 'prompt', 'description': '英文关键词,描述了希望图像具有什么内容', 'required': True, 'schema': {'type': 'string'}, } ]"} content={"[ { 'name': 'prompt', 'description': '英文关键词,描述了希望图像具有什么内容', 'required': True, 'schema': {'type': 'string'}, } ]"} position={"none"} /> </div>} />
84-
<Textarea label="输出参数" placeholder="输入参数" {...form.getInputProps('output_schema')} />
85-
86-
<TextInput label="作者" placeholder="请输入作者" {...form.getInputProps('author')} />
81+
<TextInput mt={4} label="名称" placeholder="工具名" {...form.getInputProps('alias')} />
82+
<Textarea mt={4} withAsterisk label="描述" placeholder="输入工具描述" {...form.getInputProps('description')} description={<div><span >参考示例:</span><CopyToClipboard value={"文生图是一个AI绘画(图像生成)服务,输入文本描述,返回根据文本作画得到的图片的URL"} content={"文生图是一个AI绘画(图像生成)服务,输入文本描述,返回根据文本作画得到的图片的URL"} position={"none"} /> </div>} />
83+
<Textarea mt={4} withAsterisk label="输入参数" placeholder="输入参数" {...form.getInputProps('input_schema')} description={<div><span >参考示例:</span><CopyToClipboard value={"[ { 'name': 'prompt', 'description': '英文关键词,描述了希望图像具有什么内容', 'required': True, 'schema': {'type': 'string'}, } ]"} content={"[ { 'name': 'prompt', 'description': '英文关键词,描述了希望图像具有什么内容', 'required': True, 'schema': {'type': 'string'}, } ]"} position={"none"} /> </div>} />
84+
<Textarea mt={4} label="输出参数" placeholder="输入参数" {...form.getInputProps('output_schema')} />
85+
<Radio.Group
86+
mt={4}
87+
withAsterisk
88+
name="need_llm_call"
89+
value={form.getInputProps('need_llm_call') ?.value as any}
90+
label="工具执行结果反馈与否"
91+
description="如果选择否,智能体调用完工具会直接返回"
92+
onChange={(value:any) => {
93+
const _value = parseInt(value, 10);
94+
form.setFieldValue('need_llm_call', _value);
95+
}}
96+
>
97+
<Group mt={4}>
98+
<Radio value={1} label="是" />
99+
<Radio value={2} label="否" />
100+
</Group>
101+
</Radio.Group>
102+
<TextInput mt={8} label="作者" placeholder="请输入作者" {...form.getInputProps('author')} />
87103
</Box>
88104
<Box mx="auto" pt={12} style={{ textAlign: 'right' }}>
89105
<Button onClick={async () => {
@@ -153,6 +169,7 @@ export function ChooseModal() {
153169
output_schema: '',
154170
author: '',
155171
proxy_url: '',
172+
need_llm_call: 1,
156173
});
157174
if (data) {
158175
await getToolList();

0 commit comments

Comments
 (0)