Update prompting.py
This commit is contained in:
parent
80c793047b
commit
9ab493f67e
1 changed files with 4 additions and 0 deletions
|
@ -162,6 +162,10 @@ class ChatTemplate(BaseModel):
|
|||
sys.stderr.write(f'Unexpected message role: {message.role}\n')
|
||||
current_content.append(f'[ROLE={messages[i].role}]{messages[i].content}[/ROLE]')
|
||||
|
||||
current_content.extend(
|
||||
f'<tool_call>{json.dumps(tc.model_dump())}</tool_call>'
|
||||
for tc in (message.tool_calls or [])
|
||||
)
|
||||
if current_content:
|
||||
flush()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue