~ Fixed the lack of tool calls in assistant message
This commit is contained in:
parent
d078b60f8f
commit
c1cfbfa02d
@ -194,13 +194,14 @@ class ReginaldCog(PermissionsMixin, BlacklistMixin, MemoryMixin, commands.Cog):
|
|||||||
'tool_choice': 'auto',
|
'tool_choice': 'auto',
|
||||||
}
|
}
|
||||||
response = await client.chat.completions.create(**completion_args)
|
response = await client.chat.completions.create(**completion_args)
|
||||||
|
# Checking for function calls
|
||||||
|
tool_calls = response.choices[0].message.tool_calls
|
||||||
# Appending response with tool calls
|
# Appending response with tool calls
|
||||||
messages.append({
|
messages.append({
|
||||||
'role': 'assistant',
|
'role': 'assistant',
|
||||||
'content': response.choices[0].message.content,
|
'content': response.choices[0].message.content,
|
||||||
|
'tool_calls': tool_calls
|
||||||
})
|
})
|
||||||
# Checking for function calls
|
|
||||||
tool_calls = response.choices[0].message.tool_calls
|
|
||||||
if tool_calls:
|
if tool_calls:
|
||||||
for i_call in tool_calls:
|
for i_call in tool_calls:
|
||||||
# Calling for necessary functions
|
# Calling for necessary functions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user