-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional callback execution after function call #58
base: main
Are you sure you want to change the base?
Conversation
Hi @iwamot, thanks for the suggestion. I understand this could be valuable in certain use cases, however, I hesitate to add a custom property to OpenAI's function module data structure. Additionally, passing |
Hi @seratch, thank you for your review. I fully concur with your feedback. To be frank, the use cases I've outlined are the features I'm particularly eager to utilise myself. However, I also believe that their incorporation could significantly broaden the range of applications for this software. At present, one improvement idea that comes to mind is passing |
Still thinking further about this... 🤔 Firstly, I believe that this project should avoid polluting OpenAI's function_callbacks = [
{
"function_name": "get_current_weather",
"callback_type": "before",
"callback_function_name": "before_get_current_weather",
# parameters: client, context, messages, wip_reply
},
{
"function_name": "get_current_weather",
"callback_type": "after",
"callback_function_name": "after_get_current_weather",
# parameters: function_response, client, context, messages, wip_reply
},
] With this concept, developers are able to define callback functions in the module code in an even more flexible way. If we add something like this, the README, of course, should provide clear guidance on it, as it's entirely specific to this app. However, I am yet to be confident that this would be a sufficiently good design in terms of the maintainability of an app. Modifying In conclusion, I am not yet convinced about adding what we're discussing here. If others have thoughts on this topic, please feel free to jump in! |
The introduction of File upload, while really handy, might not be absolutely necessary. We can simply choose to post the URLs of the generated images. However, at the moment, there's no method available to implement RAG. It would become possible if we could handle |
In light of our previous discussions, I have reexamined and revised the implementation of the function call callbacks. |
This PR introduces the concept of optional callbacks, named
{original_function_name}_called
, executed directly after a corresponding function call.I envisage the following two use cases:
create_image
function with acreate_image_called
callback, we could handle the task of uploading the generated image to Slack.search_faq
function with asearch_faq_called
callback, we could incorporate the search results into the user prompt.I would appreciate your review and feedback on this implementation. Thank you for all your efforts in making this wonderful software available.