-
-
Notifications
You must be signed in to change notification settings - Fork 148
[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
base: main
Are you sure you want to change the base?
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.
@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.
.
| if (null !== $this->apiKey) { | ||
| $url .= '?key='.$this->apiKey; | ||
| } |
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.
same as above
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.
Fixed.
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? |
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
Co-authored-by: Oskar Stark <[email protected]>
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? |

Vertex AI supports multiple methods of authentication. This PR adds support for API keys.