fix for openai call
This commit is contained in:
@@ -102,7 +102,7 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
|
||||
tool_calls = None
|
||||
else:
|
||||
assistant_message = response.choices[0].message
|
||||
if hasattr(assistant_message, 'function_call'):
|
||||
if hasattr(assistant_message, 'function_call') and assistant_message.function_call is not None:
|
||||
tool_calls.append(assistant_message.function_call)
|
||||
|
||||
toolUseCount = 0
|
||||
@@ -132,7 +132,7 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
|
||||
tool_calls = None
|
||||
else:
|
||||
assistant_message = response.choices[0].message
|
||||
if assistant_message.function_call is not None:
|
||||
if hasattr(assistant_message, 'function_call') and assistant_message.function_call is not None:
|
||||
tool_calls.append(assistant_message.function_call)
|
||||
|
||||
toolUseCount += 1
|
||||
|
||||
Reference in New Issue
Block a user