Describe the bug
if for example the enum for the function looks like this:
enums = ['Life cycle', 'App developer', 'Games reporting', 'User', None]
which is later used in the functions call:
...
"parameters": {
"type": "object",
"properties": {
"parent": {
"type": "string",
"enum": enums,
},
...
the case with None is not handled and server responds with the 500
Logs:
"outputs": [
{
"ename": "APIError",
"evalue": "The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID cdee293f61742a79122d04d81a0b9465 in your email.) {\n \"error\": {\n \"message\": \"The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the **request ID cdee293f61742a79122d04d81a0b9465** in your email.)\",\n \"type\": \"server_error\",\n \"param\": null,\n \"code\": null\n }\n}\n 500 {'error': {'message': 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID cdee293f61742a79122d04d81a0b9465 in your email.)',
...
request ID cdee293f61742a79122d04d81a0b9465
To Reproduce
- create an enum with None as a variable
- trigger a function call
Code snippets
functions = [
{
"name": "get_relevant_action",
"description": "",
"parameters": {
"type": "object",
"properties": {
"parent": {
"type": "string",
"enum": ['Life cycle', 'App developer', 'Games reporting', 'User', None],
"description": "parent text of the button to click",
}
},
"required": ["parent"],
},
}
]
response = openai.ChatCompletion.create(
model="gpt-4",
messages=messages,
functions=functions,
function_call={"name": "get_relevant_action"},
)
response_message = response["choices"][0]["message"]
OS
macos
Python version
3.10
Library version
v0.27.8
Describe the bug
if for example the enum for the function looks like this:
enums = ['Life cycle', 'App developer', 'Games reporting', 'User', None]which is later used in the functions call:
the case with None is not handled and server responds with the 500
Logs:
request ID cdee293f61742a79122d04d81a0b9465
To Reproduce
Code snippets
OS
macos
Python version
3.10
Library version
v0.27.8