🐛 fix(openaicaller.py): fix error in generate_response method where error_call argument is not properly handled

 feat(openaicaller.py): add default value for error_call argument in generate_response method to prevent potential errors
This commit is contained in:
2023-08-23 15:39:19 +02:00
parent c7071ce7af
commit cc28f3d4a1

View File

@@ -83,10 +83,16 @@ class openai_caller:
# async def generate_response(self, error_call=None, **kwargs):
async def generate_response(*args, **kwargs):
self = args[0]
if args.get("error_call", None) != None:
error_call = args[1]
if len(args) > 1:
error_call = args[1] or nothing
else:
async def nothing(x):
return x
error_call = nothing
if error_call == None:
async def nothing(x):
return x