-
Notifications
You must be signed in to change notification settings - Fork 1
Add API Key Configuration UI for Streamlit interface #29
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
Conversation
Co-authored-by: merendamattia <[email protected]>
Co-authored-by: merendamattia <[email protected]>
Co-authored-by: merendamattia <[email protected]>
Co-authored-by: merendamattia <[email protected]>
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.
Pull Request Overview
This PR adds a comprehensive API key configuration interface to allow users to configure LLM provider credentials (OpenAI, Google Gemini, Ollama) through the Streamlit UI instead of manually editing the .env file. The settings page includes connection testing, in-memory credential storage, and security validations for Ollama URLs.
Key changes:
- New settings page UI with API key configuration for all supported providers
- Connection testing functions for each provider with sanitized error messages
- Modified provider selection logic to validate API keys before showing providers
- Initial settings prompt when no providers are configured
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ui/settings_page.py | New module providing settings UI with API key configuration, connection tests, and security validations |
| app.py | Integration of settings page with provider validation, new API key validity checks, and initial settings flow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Users currently must manually edit
.envfiles and restart the application to configure API keys. This adds a settings page accessible from the sidebar that allows runtime configuration of OpenAI, Google Gemini, and Ollama credentials.Changes
New Settings Module (
src/ui/settings_page.py)Main App Integration (
app.py)show_settings_page()whenst.session_state.show_settingsis TrueSecurity
SSRF Mitigation
Error Handling
Example Usage
The implementation maintains consistency with existing architecture where client factories read from
os.environ, documented for potential future refactoring to direct credential passing.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.