Skip to content
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

Open
himekifee opened this issue Oct 16, 2024 · 4 comments
Open

Extra parameters for FunctionExecutor to pass to execute() #200

himekifee opened this issue Oct 16, 2024 · 4 comments
Labels
research This needs some researching

Comments

@himekifee
Copy link

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 to execute()? Thanks.

@sashirestela sashirestela added the research This needs some researching label Oct 18, 2024
@sualeh
Copy link

sualeh commented Nov 29, 2024

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.

@sualeh
Copy link

sualeh commented Nov 29, 2024

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.

@sualeh
Copy link

sualeh commented Nov 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research This needs some researching
Projects
None yet
Development

No branches or pull requests

3 participants