Skip to content

Commit cf3f92e

Browse files
author
xusenlin
committed
Tiny fix
1 parent eec8154 commit cf3f92e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/generation/qwen.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def process_qwen_messages(messages: List[ChatMessage], functions: Union[dict, Li
181181
content = f"Thought: 我可以使用 {f_name} API。"
182182
else:
183183
content = f"Thought: I can use {f_name}."
184-
content = f"\n{content}\nAction: {f_name}\nAction Input: {f_args}"
185184

186185
if messages[-1].role == Role.USER:
187186
messages.append(
@@ -247,7 +246,7 @@ def parse_response(response):
247246

248247
if func_name:
249248
function_call = {"name": func_name, "arguments": func_args}
250-
return response[:i], function_call
249+
return response[:k], function_call
251250

252251
z = response.rfind("\nFinal Answer: ")
253252
if z >= 0:

examples/qwen-7b-chat/get_weather.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def run_conversation(query: str, stream=False, functions=None, max_retry=5):
107107
params["messages"].append(
108108
{
109109
"role": "assistant",
110-
"content": output
110+
"content": output,
111+
"function_call": function_call,
111112
}
112113
)
113114
params["messages"].append(

0 commit comments

Comments
 (0)