Merge pull request #24 from T-BENZIN/development

~ Fixed the initial assistant response with tool calls not being appended
This commit is contained in:
Hatt 2025-03-16 12:23:08 +01:00 committed by GitHub
commit a25c9dd4bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,6 +194,11 @@ class ReginaldCog(PermissionsMixin, BlacklistMixin, MemoryMixin, commands.Cog):
'tool_choice': 'auto',
}
response = await client.chat.completions.create(**completion_args)
# Appending response with tool calls
messages.append({
'role': 'assistant',
'content': response.choices[0].message.content,
})
# Checking for function calls
tool_calls = response.choices[0].message.tool_calls
if tool_calls: