点击插件+号
点击创建插件
输入插件名称
然后添加工具,工具可以添加多个,名称必须是英文
在元数据中添加输入与输出,插件工具代码支持python与nodejs,我们以nodejs为例
然后在代码中修改,记得添加axios的依赖,使用axios请求自己的api服务器提供服务:
import { Args } from '@/runtime'; import { Input, Output } from "@/typings/find_codes/find_codes"; import axios from 'axios'; /** * Each file needs to export a function named `handler`. This function is the entrance to the Tool. * @param {Object} args.input - input parameters, you can get test input value by input.xxx. * @param {Object} args.logger - logger instance used to print logs, injected by runtime * @returns {*} The return data of the function, which should match the declared output parameters. * * Remember to fill in input/output in Metadata, it helps LLM to recognize and use tool. */ export async function handler({ input, logger }: Args<Input>): Promise<Output> { // 发送一个GET请求 const response = await axios.post('https://www.bfw.wiki/', { firstName: 'Fred', lastName: 'Flintstone' }); return { codes: "您的代码链接:https://www.bfw.wiki/"+input.name, }; };然后运行查看效果
最后点击发布,发布成功后
我们在插件中+号选择自己刚添加的插件局,然后问答中coze就会自动调用插件了。
网友回复
python+Quill如何实现多人实时文档编辑html?
什么是ai的6A工作流规则?
&、nohup、screen、tmux在linux中后台执行的区别?
python如何将调用ai大模型生成的文件修改行操作指令修改原文件后保存?
python如何将2d平面线图转换成数字2d线稿图?
acejs代码编辑器如何调用openai api实现选择代码修改与代码自动补全?
ace.js如何获取选择文本的开始和结束行数?
如何把qwen code cli或gemini cli的免费调用额度换成http api对外开放接口?
如何限制windows10电脑只能打开指定的程序?
python如何调用ai大模型实现web网页系统的功能测试并生成测试报告?