mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-09 00:23:38 +00:00
API: Fix tool_calls placement and other response compatibility issues
This commit is contained in:
parent
f06583b2b9
commit
d0ac58ad31
3 changed files with 6 additions and 7 deletions
|
|
@ -456,11 +456,11 @@ for _ in range(10):
|
|||
messages.append({
|
||||
"role": "assistant",
|
||||
"content": choice["message"]["content"],
|
||||
"tool_calls": choice["tool_calls"],
|
||||
"tool_calls": choice["message"]["tool_calls"],
|
||||
})
|
||||
|
||||
# Execute each tool and add results to history
|
||||
for tool_call in choice["tool_calls"]:
|
||||
for tool_call in choice["message"]["tool_calls"]:
|
||||
name = tool_call["function"]["name"]
|
||||
arguments = json.loads(tool_call["function"]["arguments"])
|
||||
result = execute_tool(name, arguments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue