From 39bd5bd52404735a2b7dab7c59fa9faa2c9017eb Mon Sep 17 00:00:00 2001 From: hiyouga Date: Wed, 31 Jan 2024 17:23:56 +0800 Subject: [PATCH] fix #2388 --- src/llmtuner/api/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llmtuner/api/app.py b/src/llmtuner/api/app.py index 428d15de..26ee57ce 100644 --- a/src/llmtuner/api/app.py +++ b/src/llmtuner/api/app.py @@ -108,7 +108,7 @@ def create_app(chat_model: "ChatModel") -> "FastAPI": tool_list = request.tools if len(tool_list): 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: raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid tools") else: