feat(adk): support custom CA for non-openai model providers#1799
Merged
EItanya merged 3 commits intokagent-dev:mainfrom May 5, 2026
Merged
feat(adk): support custom CA for non-openai model providers#1799EItanya merged 3 commits intokagent-dev:mainfrom
EItanya merged 3 commits intokagent-dev:mainfrom
Conversation
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends non-Vertex provider transport configuration so custom CA handling (and Gemini custom headers) flow through both the Python ADK runtime and the Go ADK runtime. It refactors shared TLS plumbing, adds a dedicated Gemini wrapper on the Python side, and updates tests around the new transport behavior.
Changes:
- Added shared Python TLS transport helpers and applied them to OpenAI, Anthropic, Ollama, Bedrock, SAP AI Core, and a new Gemini wrapper.
- Switched Python model creation for
geminito returnKAgentGeminiLlm, enabling custom headers/TLS options instead of returning the raw model name. - Updated Go Gemini and SAP AI Core model creation to use shared HTTP client construction for TLS/header support.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
python/packages/kagent-adk/tests/unittests/models/test_tls_integration.py |
Updates TLS integration tests and adds Gemini transport assertions. |
python/packages/kagent-adk/tests/unittests/models/test_openai.py |
Adjusts OpenAI TLS mocks to patch the shared SSL helper. |
python/packages/kagent-adk/src/kagent/adk/types.py |
Refactors shared transport kwarg handling and routes Gemini configs to the new wrapper. |
python/packages/kagent-adk/src/kagent/adk/models/_ssl.py |
Introduces a reusable TLS mixin for model wrappers. |
python/packages/kagent-adk/src/kagent/adk/models/_sap_ai_core.py |
Reuses shared TLS client creation for SAP AI Core requests and token fetches. |
python/packages/kagent-adk/src/kagent/adk/models/_openai.py |
Replaces OpenAI-specific TLS code with the shared mixin. |
python/packages/kagent-adk/src/kagent/adk/models/_ollama.py |
Adds TLS support to the Ollama wrapper and factory. |
python/packages/kagent-adk/src/kagent/adk/models/_gemini.py |
Adds a new Gemini wrapper with custom headers and TLS-aware HTTP options. |
python/packages/kagent-adk/src/kagent/adk/models/_bedrock.py |
Threads TLS settings into Bedrock client creation. |
python/packages/kagent-adk/src/kagent/adk/models/_anthropic.py |
Adds TLS-aware HTTP client creation for Anthropic. |
python/packages/kagent-adk/src/kagent/adk/models/__init__.py |
Exports the new Gemini wrapper. |
go/adk/pkg/models/sapaicore.go |
Switches SAP AI Core to shared HTTP client construction. |
go/adk/pkg/agent/agent.go |
Wires shared transport config into Gemini and SAP AI Core model creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
EItanya
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, only OpenAI BYO models support custom CA. This PR extends the existing API to all non-Vertex-AI model providers (Claude API, Gemini API, Bedrock, Ollama) for both python and go runtimes. This reuses most of existing plumbings and refactors some TLS related code. It also adds a
GeminiLmwrapper class in order to support custom CA and custom headers (close #1714 as well).