Describe the bug
Firstly I noticed how you have integrated the chat_completion_request function into the Python OpenAI package instead of writing it out in code. I have used prior version and the new version but am finding the newer integrated version giving me issues.
Specificaly it seems that it does not handle the case where functions = None very well. There does not appear to be a way to tell 'ChatCompletion' to not run any functions other than giving it a fake function and then setting the function_call flag to 'none'.
Example error:
error_code=None error_message="None is not of type 'array' - 'functions'" error_param=None error_type=invalid_request_error message='OpenAI API error received' stream_error=False
It would be good if it could proces requests when functions is set to none and function_call is set to 'none'.
To Reproduce
Pass in functions=Non and function_call='none' to the code below.
Code snippets
def chat_completion_request(messages, functions=None, function_call="auto", model=GPT_MODEL):
if functions is None:
function_call ="none"
r= openai.ChatCompletion.create(
model=GPT_MODEL,
messages=messages,
functions=functions,
function_call=function_call, # auto is default, but we'll be explicit
)
return r
OS
Windows 11
Python version
Latest
Library version
Latest
Describe the bug
Firstly I noticed how you have integrated the chat_completion_request function into the Python OpenAI package instead of writing it out in code. I have used prior version and the new version but am finding the newer integrated version giving me issues.
Specificaly it seems that it does not handle the case where functions = None very well. There does not appear to be a way to tell 'ChatCompletion' to not run any functions other than giving it a fake function and then setting the function_call flag to 'none'.
Example error:
error_code=None error_message="None is not of type 'array' - 'functions'" error_param=None error_type=invalid_request_error message='OpenAI API error received' stream_error=False
It would be good if it could proces requests when functions is set to none and function_call is set to 'none'.
To Reproduce
Pass in functions=Non and function_call='none' to the code below.
Code snippets
OS
Windows 11
Python version
Latest
Library version
Latest