You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to test the recent function calling feature. The OpenAI API docs around this new feature are a bit confusing. The top level field "function_call" in a chat completion request can be either a string or object according to their examples and docs. The value is defaulted to "none" when "functions" are not provided and "auto" when functions are provided. "auto" allows the model to decide whether to use a function or not. To force the model to call a function, an object needs to be passed: Ex: {"name": "<function_name>"}. Right now, I can't force the model to use a function with the current implementation.
Tested using curl as well and both type of string and object are accepted. Not sure why the API is designed this way but I think it makes sense to just support an object when providing the "function_call" value since the other two values are defaulted by OpenAI and depend on "functions" being available.
I am trying to test the recent function calling feature. The OpenAI API docs around this new feature are a bit confusing. The top level field "function_call" in a chat completion request can be either a string or object according to their examples and docs. The value is defaulted to "none" when "functions" are not provided and "auto" when functions are provided. "auto" allows the model to decide whether to use a function or not. To force the model to call a function, an object needs to be passed: Ex: {"name": "<function_name>"}. Right now, I can't force the model to use a function with the current implementation.
Reference: https://platform.openai.com/docs/guides/gpt/function-calling
Examples: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_with_chat_models.ipynb
Tested using curl as well and both type of string and object are accepted. Not sure why the API is designed this way but I think it makes sense to just support an object when providing the "function_call" value since the other two values are defaulted by OpenAI and depend on "functions" being available.
Here is where the updates should happen.
https://github.com/sashabaranov/go-openai/blob/master/chat.go#LL43C1-L59C2
The text was updated successfully, but these errors were encountered: