Skip to content

feat(client): allow custom HTTP configuration and Google Credentials #2308#324

Open
nair-shubh wants to merge 2 commits intogoogleapis:mainfrom
nair-shubh:main
Open

feat(client): allow custom HTTP configuration and Google Credentials #2308#324
nair-shubh wants to merge 2 commits intogoogleapis:mainfrom
nair-shubh:main

Conversation

@nair-shubh
Copy link
Copy Markdown

#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.

@google-cla
Copy link
Copy Markdown

google-cla bot commented May 26, 2025

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.

Add support for using custom HTTP configurations and Google Credentials
with the Gemini API backend, similar to existing Vertex AI support.

- Update NewClient function to handle custom credentials for Gemini API
- Add unit tests to verify functionality
- Include example demonstrating the feature

Fixes #2308
@nair-shubh
Copy link
Copy Markdown
Author

First open source contribution. Kindly let me know if there are any changes or standards that I should follow.

@nair-shubh nair-shubh changed the title Allow users to provide custom HTTP configuration and Google Credentfeat feat(client): allow custom HTTP configuration and Google Credentials #2308 May 26, 2025
@qiaodev
Copy link
Copy Markdown
Contributor

qiaodev commented Oct 6, 2025

@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

@Sivasankaran25 Sivasankaran25 added the api:gemini-api Issues related to Gemini API label Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:gemini-api Issues related to Gemini API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants