quarkiverse / quarkus-langchain4j

Quarkus Langchain4j extension
https://docs.quarkiverse.io/quarkus-langchain4j/dev/index.html
Apache License 2.0
115 stars 64 forks source link

Update Vertex AI Gemini provider to use ModelAuthProvider #708

Open sberyozkin opened 3 days ago

sberyozkin commented 3 days ago

This PR builds on the #694 PR created by @csotiriou and updates Vertex AI Gemini model provider to use ModelAuthProvider. It also adds a demo which depends on the quarkus-langchain4j-oidc-model-auth-provider extension which can help to pick up OIDC bearer or authorization code flow tokens.

I'm yet to test it works.

sberyozkin commented 3 days ago

@csotiriou @geoand It all works great, thanks, I'll have a couple of minor suggestions/questions at #694 a bit later, and once #694 is merged, I'll rebase this PR, thanks

sberyozkin commented 2 days ago

This is the latest from Gemini:

Oh, Java, language of bytecode and beans,
Where objects dance and methods preen.
From applets to servlets, your reach is wide,
A platform for dreams, where code can confide. 

- Gemini

PR is ready for review :-), @geoand, @jmartisk, please have a look next week. Jan, since you have tested secure-fraud-detection, can you please check that this demo works for you as well ? You'll need to enable Vertex AI in your Google Cloud project, also note this project's id and set in properties, as mentioned in README.

My plan, later, is to add one more OIDC authentication into the same (to be renamed) demo, and then also use another model, hopefully with Azure OpenAI, so the demo will evolve to show a fairly complex case but also how easily it can be done wit Quarkus LangChain4j and Quarkus security

Thanks