-
-
Notifications
You must be signed in to change notification settings - Fork 153
[Platform][VertexAI] Add support for API key authentication #1139
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
|
Please add tests |
Sure. Before I spend more time on tests, can you review that the approach/solution is correct? I'm relatively new to the symfony/ai project and not sure how other Bridges handle this. |
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.
Looks good to me. WDYT @chr-hertel ?
@nicodemuz can you please check if it is also supported for Gemini. This should also be configurable via the AiBundle config
@OskarStark You mean to configure whether the key should be sent via a query parameter or the headers? For Gemini, I think the API key is sent via HTTP headers: ai/src/platform/src/Bridge/Gemini/Gemini/ModelClient.php Lines 81 to 86 in 5b89765
|
Thanks for double checking |
| ======================================== | ||
| 1. Application Default Credentials (ADC) | ||
| ======================================== |
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.
| ======================================== | |
| 1. Application Default Credentials (ADC) | |
| ======================================== | |
| Application Default Credentials (ADC) | |
| ------------------------------------- |
Same for the other headlines
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.
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.
Sorry I think we need to go with ........ dots as underline for the next level, can you please try? thanks
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.
Updated! 👍
@OskarStark I'm trying to fix the tests, and there's one test failing with: Is it trying to run code from some other repo/branch? Since it's referring to |
|
Tests still needed |
|
|
||
| require_once __DIR__.'/bootstrap.php'; | ||
|
|
||
| $platform = PlatformFactory::create(env('GOOGLE_CLOUD_LOCATION'), env('GOOGLE_CLOUD_PROJECT'), env('GOOGLE_CLOUD_VERTEX_API_KEY'), httpClient: adc_aware_http_client()); |
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.
but this still uses the adc_aware_http_client
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.
Good catch. Fixed! 👍
|
It looks like your committer email is not associated with your GitHub account |
OskarStark
left a comment
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.
.
chr-hertel
left a comment
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.
Yes, we def need this - thanks @nicodemuz!
only minor comments but broken pipeline
Any ideas about the broken pipeline? See my comment here: |
Will this prevent from the PR getting merged? I remember getting a lot of spam after entering my email address in public repos. |
Did you rebased properly? |
9495255 to
30497c4
Compare
@OskarStark I have rebased just now with the
|
|
Looks like the Order of the arguments is wrong. IIRC @Guikingone had the same issue in the past, right? |
|
Yes, was related to the arguments sent into the factory (don't forget about the |
@Guikingone But I have already updated code to also pass the 3rd parameter as the apiKey: Can you advice where exactly should I add any other additional updates? I'm still a bit confused why it's calling an outdated PlatformFacory via the vendor folder: |
|
Can you please rebase? |
|
Please require package version ^0.2 in ai-bundle composer.json |
39ac2ab to
8efa78a
Compare
I have rebased. |
This seems to already be 0.2: https://github.com/nicodemuz/ai/blob/8efa78a4acb0fb1c5d5e613bcf9462da5ca598e1/src/ai-bundle/composer.json#L92 |
8ecc5f7 to
4c7e3fb
Compare
|
Thank you @nicodemuz. |
|
AI bundle now need to require vertex 0.2 in require dev, no? |
Vertex AI supports multiple methods of authentication. This PR adds support for API keys.