Commit 886b4c2d authored by Your Name's avatar Your Name

Fix _to_oa to return OpenAI format with 'function' key

parent 55ebbc3b
......@@ -80,7 +80,14 @@ class BaseParser:
args = json.loads(args)
except:
args = {}
return {"name": name, "arguments": args}
# Return in OpenAI format with 'function' key
return {
"type": "function",
"function": {
"name": name,
"arguments": json.dumps(args) if isinstance(args, dict) else args
}
}
# 1. QWEN PARSER (Instruct & Coder Style)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment