除了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数据,直接调用函数即可。
网友回复
ai先写功能代码通过chrome mcp来进行测试功能最后ai美化页面这个流程能行吗?
vue在手机端上下拖拽元素的时候如何禁止父元素及body的滚动导致无法拖拽完成?
使用tailwindcss如何去掉响应式自适应?
有没有直接在浏览器中运行的离线linux系统?
nginx如何保留post或get数据进行url重定向?
python有没有能绕过Cloudflare人机验证的爬虫库?
有没有免费的股票量化交易本地部署预测模型?
如何根据一张人脸照片全网人肉搜索这个人的其他照片或信息?
js版本iife esm umd cjs有啥区别?
如何将ctrl+c复制的网页图文列表自动解析成可编辑的电子表格?