除了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大模型能力排行榜有吗?
国产图片大模型seedream-5及qwen-image-3都无法生成360度全景图片?
听说OpenAI的Astra太强了可能会失控?
qwen3.8-max比较适合那些场景?
python有没有免费的股市行情数据api可用?
UUIDv7、nanoid、Snowflake、ULID与sparkid这些id生成器区别?
get请求报错NS_BINDING_ABORTED是什么原因?
happyhorse与seedance及minmax h3到底哪个更好?
scriptc为啥能生成一个不带nodejs的原生二进制可执行程序?
为啥huggingface那么多ai图片和视频模型都能一键脱衣没人管呢?


