Looks like the latest version fo Retool offers support for the latest OpenAI models and with that, function calls. (Will Retool Update the Models Available from OpenAI)
However, with function calls, you pretty much have to be able to modify the response body (append a new message with
function_response) and re run the query with the additional context.
Currently, I'm not sure this is possible. The OpenAI Query Builder in Retool exposes the ability add an arbitrary amount of specific messages (which can be referenced with variables), but when using the query in my retool code, there doesn't seem to be a way for me to arbitrary add message and re-trigger the request.
For reference, this is how you work with function calling in openai:
- Setup your openai request with a set of function references
- Make a prompt query request that implicitly requests one of your functions.
- OpenAI returns that it thinks you need to call a specific function.
- We make a call to that function in our code and append to the messages with a response type of "function_response".
- OpenAI uses that context to formulate another answer.
- We might need to make another request depending on the response.
The obvious workaround right now would be to now use the OpenAI resource and go with the REST API resource.