除了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数据,直接调用函数即可。
网友回复
为啥所有的照片分辨率提升工具都会修改照片上的图案细节?
js如何在浏览器中将webm视频的声音分离为单独音频?
微信小程序如何播放第三方域名url的mp4视频?
ai多模态大模型能实时识别视频中的手语为文字吗?
如何远程调试别人的chrome浏览器获取调试信息?
为啥js打开新网页window.open设置窗口宽高无效?
浏览器中js的navigator.mediaDevices.getDisplayMedia屏幕录像无法录制SpeechSynthesisUtterance产生的说话声音?
js中mediaRecorder如何录制window.speechSynthesis声音音频并下载?
python如何直接获取抖音短视频的音频文件url?
js在浏览器中如何使用MediaStream与MediaRecorder实现声音音频多轨道混流?