-
Notifications
You must be signed in to change notification settings - Fork 29
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
Extra parameters for FunctionExecutor to pass to execute() #200
Comments
I think that this is an important requirement. The \https://github.com/TheoKanning/openai-java allowed it by actually storing an instance of the function executor class (see https://github.com/TheoKanning/openai-java/blob/main/api/src/main/java/com/theokanning/openai/completion/chat/ChatFunction.java#L33) which could have its own internal state. In https://github.com/sashirestela/simple-openai on the other hand, all that is stored is the class (instead of an instance of the class) that can execute a function. |
Contrast: simple-openai/src/main/java/io/github/sashirestela/openai/common/function/FunctionDef.java Line 18 in 8c46ce7
|
Another way to handle this could be simply return an instantiated Functional object without this line of code, and leave the execution up to the calling code. This may be a much simpler short-term solution. simple-openai/src/main/java/io/github/sashirestela/openai/common/function/FunctionExecutor.java Line 84 in 8c46ce7
|
Until then, I am going to have to instantiate my own Functional and execute it in my own code, so I can provide the required context. |
First of all thanks for your hard work on the projects. It really helped me build my Minecraft Mod with AI equipped. I just added functionality to ask AI to generate a function calling to execute server commands, which requires some context about the sender and the server itself, essentially requiring passing external parameters to the
execute()
function. One alternative way is to add some information to the prompt and hope the AI fill in proper arguments which is of cause only capable of processing text. I wonder if there is a way to pass objects toexecute()
? Thanks.The text was updated successfully, but these errors were encountered: