-
Notifications
You must be signed in to change notification settings - Fork 103
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
Support for Tools in Vertex AI Gemini #1169
Conversation
Thanks for looking into it @sberyozkin! There are no obvious error I see, but only some proper testing will show the way :) |
@geoand Sure, I'll experiment |
c7edcc5
to
5987cb8
Compare
I've prototyped the integration test, with a single Tool for now, and it fails, so the next task for early 2025 is to fix it :-) and then make it work for 2 tools |
🎉 |
👍 +1 |
@MisterK91 Sure, I'll resume working on it in a few days |
@geoand How to run integrations tests for Ollama, there is no test code there ? |
I would just take some some sample and use Ollama with it |
5987cb8
to
c8677b8
Compare
@geoand I've got a bit of a progress, with the integration test now failing at the Jackson response deserialization time,
I was not really focusing earlier on using Jackson correctly when I was copying some related Ollama code, but it looks much closer now... If you can spot something obvious in the Jackson related code in this PR, let me know please, np if nothing obvious can be seen, I'll look further sometime next week. |
98768e1
to
bbc7e9b
Compare
It must be something straightforward, I'll have a look next week |
Never mind, this is just requires a bit more concentration |
👍🏽 |
bbc7e9b
to
cccc659
Compare
I'm getting some inconsistent responses from Gemini, using the same request:
Note the
Note no function call is suggested... next,
Again, And
I've no idea what @MisterK91, @waloeen, do you have some comments about the above ? |
2f75fa0
to
2ea9d8c
Compare
After changing the model name to
(I got it once, the same response, a few days back, with gemini-1.0-pro) and then repeating the same request again leads to the same It does look like Gemini model tooling support is very unstable at the moment. I think what I will do is I'll get the integration test working based on the output in this comment, which should be sufficient for users to continue experimenting, and we can keep tuning it as necessary |
2ea9d8c
to
28a26a4
Compare
Hi @geoand I think I may have found a bug, Quarkus LangChain4j continues calling AI when the AI response contains tool executions with a The other question, if one uses |
28a26a4
to
5248520
Compare
This is a minor, just recording here for minor enhancement request be opened later, using |
OK, is getting closer, FYI, continuing the flow causes 400 from Gemini: as it does not currently match its expectation:
But I believe it should already work for tools with In any case, once a multi-turn function calling starts working, I'll open it for review, a bit later |
4942784
to
97d0f50
Compare
How do I reproduce this? |
Hi @geoand, I may have been wrong about it, I'll get the method returning some value working first against live Gemini and then double check. |
Do you mean the integration test of this PR? |
@geoand Sorry, was offline for a bit, yeah, of this PR, but let me make it work with live Gemini first |
Okay, let me know when you want me to have a look |
7237cb7
to
60a7e51
Compare
@geoand It is getting very close now, got a multi-turn working with this response:
where the user name is returned from a Tool which requires a user authentication, which is what I really wanted to try. Let me quickly check what happens with a function with a void response |
Hmm. |
@geoand void tool methods work fine, sorry about the noise |
60a7e51
to
af56cf6
Compare
This comment has been minimized.
This comment has been minimized.
af56cf6
to
d125978
Compare
Opening for review, it will need a follow up, https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode, but what is here now worked for the demo, with a multi-turn mode. Occasional intermittent malfomed function errors can be returned from both I'll deal with https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode after this PR is merged, I need to catch up with a few Q. issues now :-) |
d125978
to
b506fbc
Compare
Status for workflow
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice @sberyozkin, thanks a lot!
Right, tool calling can sometimes be hit and miss with other models as well |
Thanks @geoand , I have to admit, it wasn't boring working on this issue 😀 |
Hi @geoand, I've done a lot of copying from similar Ollama Tools support code and I have to admit I'm not sure I'm on the right track, Ollama code has some similarities but the the code there is much more involved compared to the Gemini one which does not offer non-streaming support yet.
Can you please have a quick look tomorrow and point to some obvious errors, before I attempt to test it :-) ?