mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 12:42:51 +08:00
parent
7beeae2209
commit
93a5c22f92
@ -108,7 +108,7 @@ def create_app(chat_model: "ChatModel") -> "FastAPI":
|
|||||||
tool_list = request.tools
|
tool_list = request.tools
|
||||||
if len(tool_list):
|
if len(tool_list):
|
||||||
try:
|
try:
|
||||||
tools = json.dumps([tool_list[0]["function"]], ensure_ascii=False)
|
tools = json.dumps([tool["function"] for tool in tool_list], ensure_ascii=False)
|
||||||
except Exception:
|
except Exception:
|
||||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid tools")
|
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid tools")
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user