fixed openai
This commit is contained in:
@@ -16,7 +16,8 @@ class ChatGPTTelegramInferenceBot(BaseTelegramInferenceBot):
|
||||
response = self.client.chat.completions.create(
|
||||
model=self.model,
|
||||
messages=[{"role": "system", "content": self.system_prompt}] + messages,
|
||||
tools=self.functions,
|
||||
functions=self.functions,
|
||||
function_call="auto",
|
||||
max_tokens=self.max_tokens
|
||||
)
|
||||
return response
|
||||
@@ -32,7 +33,7 @@ class ChatGPTTelegramInferenceBot(BaseTelegramInferenceBot):
|
||||
|
||||
tool_calls = []
|
||||
assistant_message = {}
|
||||
|
||||
|
||||
for message_part in response.choices:
|
||||
if message_part.finish_reason == "function_call":
|
||||
tool_calls.append(message_part.message.function_call)
|
||||
|
||||
Reference in New Issue
Block a user