areless
150 天前
读 mem0 的源码就会发现大模型接口有一行 tools ,他有一个必须准确记录的 facts 的回参。他通过 function call 去问答大模型,格式参数为
"function": {
"name": "establish_relationships",
"description": "Establish relationships among the entities based on the provided text.",
"parameters": {
"type": "object",
"properties": {
"entities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {"type": "string", "description": "The source entity of the relationship."},
"relationship": {
"type": "string",
"description": "The relationship between the source and destination entities.",
},
"destination": {
"type": "string",
"description": "The destination entity of the relationship.",
},
},
"required": [
"source",
"relationship",
"destination",
],
"additionalProperties": False,
},
}
},
"required": ["entities"],
"additionalProperties": False,
},
}
结果除了官方自带的不能本地部署的 OPENAI LLM 以外,所有能本地部署的大模型( qwen\deepseeek\llama\gemma\phi\granite ,ollama 上所有带 TOOLS 的模型)要么不能输出,要么只输出了
item:{***},type:{***}
然后程序报错