feat: Add proxy support for Google Gemini API in MindsDB agents#1
Open
buallen wants to merge 3 commits into
Open
feat: Add proxy support for Google Gemini API in MindsDB agents#1buallen wants to merge 3 commits into
buallen wants to merge 3 commits into
Conversation
- Change default behavior to display all schemas instead of only public schema - Particularly beneficial for data warehouses like Redshift, PostgreSQL, etc. - Users can still explicitly set all_schemas=false to get old behavior - Improves user experience by making all available data visible by default Fixes issue where databases with multiple schemas appeared empty in the web UI
- Change default behavior to display all schemas instead of only public schema - Particularly beneficial for data warehouses like Redshift, PostgreSQL, etc. - Users can still explicitly set all_schemas=false to get old behavior - Improves user experience by making all available data visible by default Fixes issue where databases with multiple schemas appeared empty in the web UI
- Add comprehensive proxy configuration for Google Gemini handler - Force REST transport instead of gRPC to support HTTP proxies - Configure LangChain agents to use proxy for Google Gemini models - Add fallback mechanisms for proxy configuration failures - Enable MindsDB agents to work behind corporate firewalls Key changes: * GoogleGeminiHandler: Add _configure_proxy() and _configure_genai_with_proxy() methods * LangchainAgent: Add proxy configuration in __init__ and create_chat_model() * Support HTTP_PROXY, HTTPS_PROXY, and ALL_PROXY environment variables * Use direct REST API calls with requests library for better proxy support Fixes: Agent connectivity issues when running behind proxy networks Tested: Successfully verified with StoreHub business intelligence agent
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.
🎯 Overview
This PR adds comprehensive proxy support for Google Gemini API integration in MindsDB agents, enabling the platform to work behind corporate firewalls and proxy networks.
🔧 Technical Changes
Google Gemini Handler (
google_gemini_handler.py)_configure_proxy()method for initialization-time proxy configuration_configure_genai_with_proxy()method for runtime proxy configuration_generate_content_with_proxy()method for direct REST API callsLangChain Agent (
langchain_agent.py)LangchainAgent.__init__()create_chat_model()to configure proxy for Google providerChatGoogleGenerativeAIto use REST transport🚀 Key Features
🧪 Testing
📊 Business Impact
This change enables MindsDB to be deployed in enterprise environments where:
🔍 Code Quality
📋 Checklist
🎯 Related Issues
Fixes connectivity issues for MindsDB agents in proxy network environments.
Testing Environment: macOS with HTTP proxy (127.0.0.1:7890)
Agent Model: Google Gemini 2.0 Flash
Verification: StoreHub business analysis agent successfully analyzed 100+ business records
Pull Request opened by Augment Code with guidance from the PR author