feat(client): allow custom HTTP configuration and Google Credentials #2308
#2308 [Go] Allow users to provide custom http configuration to go-genai client #2308
Description
This PR adds support for using custom HTTP configurations and Google Credentials with the Gemini API backend, similar to how they're already supported for the Vertex AI backend.
Changes
- Updated [NewClient](go-genai/client_test.go: function to properly handle custom credentials for Gemini API
- Added comprehensive unit tests in client_test.go to verify the functionality
- Added a usage example in example_test.go to demonstrate the feature
Testing
All tests pass, including the new test cases for custom credentials and HTTP configuration.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
First open source contribution. Kindly let me know if there are any changes or standards that I should follow.
@nair-shubh The Gemini API backend supports API Key authorization https://ai.google.dev/gemini-api/docs/api-key. I cannot find any public docs about custom credential support in Gemini API backend.
For my education, could you help me understand how to use credential to authorize to Gemini API backend. Thanks