除了OllamaFunctions可以实现大模型调用函数插件功能外,大模型内置的提示词也可以实现
提示词
You have access to the following tools: {function_to_json(get_weather)} {function_to_json(calculate_mortgage_payment)} {function_to_json(get_directions)} {function_to_json(get_article_details)} You must follow these instructions: Always select one or more of the above tools based on the user query If a tool is found, you must respond in the JSON format matching the following schema: {{ "tools": {{ "tool": "<name of the selected tool>", "tool_input": <parameters for the selected tool, matching the tool's JSON schema }} }} If there are multiple tools required, make sure a list of tools are returned in a JSON array. If there is no tool that match the user request, you will respond with empty json. Do not add any additional Notes or Explanations User Query:问答
What's the weather in Shnaghai, CHINA? { "tools": [ { "tool": "get_weather", "tool_input": { "city": "Shanghai, CHINA" } } ] }只要大模型会返回结构化的json数据,直接调用函数即可。
网友回复
python如何实现声纹识别用户进行验证?
在哪可找到各种影视经典角色的配音并克隆音色根据文本说话?
阿里通义大模型哪些是支持多模态的api的ai模型?
js如何实现浏览器中离线语音唤醒语音聊天小助手?
浏览器中如何将WebM视频转成mp4视频?
parlant如何改成qwen 的apikey与baseurl?
如何写一个chrome插件实现截屏自动生成步骤图文教程转成pdf或网页?
python如何通过阿里云的api对域名进行解析和ecs主机服务器进行启动停止等操作?
Tesla Robotaxi可以让特斯拉车自动无人驾驶跑滴滴为车主赚钱,国内以后也会这样吗?
有没有可以监控安卓手机上的app打开后偷偷摸摸做了啥的监控软件?