-
Notifications
You must be signed in to change notification settings - Fork 2k
Add SpringAIFunctions annotation to turn Functions into ToolFunctionCallbacks #16
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
Conversation
|
Thanks so much, I'm a bit behind reviewing PRs, but will get to it this week. Thanks again! |
|
Great job @Kirbstomper! Looking forward to seeing this PR accepted and being able to start function calling with Spring AI |
|
I haven't forgotten, thanks for your patience. |
|
Hi @Kirbstomper, I has taken a while, but now with #299 we are close to start providing tool functions integration. Would do you think about it? Also I like your Cheers, |
|
Let me take a look at that! |
Mind that the PR apparently has just been merged. You should check the main branch. I would still appreciate your feedback and improvements such as the SpringAIFunction annotation ;) |
Adds the ability to register functions to be used in the even the LLM cannot answer something. This is useful for something like realtime data or if you want your LLM to execute code based on user input and return a response. (ULTRA_CHATBOT)
56aa8b7 to
2dcb1e4
Compare
Sometimes the chat bot will remove any decimals from the temp in the response
|
Thanks @Kirbstomper , Indeed the packaging was a bit problematic. So for the time being I've moved everything inside the auto-configuration project under the /common/function package. Btw, if you have an experience implementing function calling for other (non OpenAI) models feel free to contribute ;) Refactored, Squashed, rebased and merged at: b2a4f01 |
|
@Kirbstomper , |
Hey! First contribution, so open for suggestions!
The main reason I found myself drawn to this project is in my quest for making a super discord bot, being able to parse natural language to function calls in spring would be pretty cool. So while kind of basic I think it gives something to build on or get the conversation started on supporting functions. I saw #7 and figured I could take a crack at it.
I liked the idea of it being annotation based so I added
@SpringAIFunctionas a generic annotation. I don't personally know the extent that azure supports functions but I figured it might be useful to live there as spring AI supports different APIs.There might be a way to not need to specify the class directly in the annotation, but my reflection skills are not there 😆
This annotation is used with
OpenAiFunctionManagerto look for anyFunctionannotated with the new annotation, and return them to whoever needs them as aFunctionExecutor. I wasn't sure how to make sure that my functions as beans are created before the manager, but if thats not guaranteed, I can always make the executor a singleton after the first timegetFunctionExecutor()is run.After things get a little bit finalized I can add some documentation around this.
I also updated
open-ai-client.versionto0.16.0for function support