-
Notifications
You must be signed in to change notification settings - Fork 62
Copilot/implement gemini api tool #60
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
Open
trabalhefabricio
wants to merge
71
commits into
hyperfield:main
Choose a base branch
from
trabalhefabricio:copilot/implement-gemini-api-tool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Copilot/implement gemini api tool #60
trabalhefabricio
wants to merge
71
commits into
hyperfield:main
from
trabalhefabricio:copilot/implement-gemini-api-tool
+4,572
−327
Conversation
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
- Detached threads now capture state by value instead of using 'this' - Eliminates potential use-after-free if object is destroyed while thread runs - Makes save operation fully independent from object lifetime - Applied to both GeminiClient and LLMClient PersistentState classes Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Use atomic<bool> instead of bool for save_pending_ flag - Use atomic exchange() to atomically check and set the flag - Thread now resets flag after save completes, preventing concurrent saves - Eliminates risk of file corruption from simultaneous writes - Applied to both GeminiClient and LLMClient Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…tors - Modified WhitelistEntry to include context field and advanced_subcategories flag - Changed separator from comma to semicolon (with backward compatibility) - Updated WhitelistStore to save/load context and advanced settings - Enhanced WhitelistManagerDialog to support context input and advanced options - Added user_context field to Settings class - Integrated context into CategorizationService prompt building - Added context_input UI field to MainApp - Connected context input to settings and whitelist selection Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added "Save Categories to Whitelist" button to CategorizationDialog - Implemented callback mechanism for saving refined categories - Extract unique categories and subcategories from review dialog - Allow users to save refined categories with custom whitelist name - Categories are now reviewable/modifiable before sorting - Integrated context from categorization into saved whitelists Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Updated all LLM client prompts (Gemini, OpenAI, Local) to be more intelligent - Added file extension analysis to categorization prompts - Prompts now ask LLMs to consider what file types are used for - Enhanced with semantic meaning and common purpose analysis - Added file path context when available - Improved prompt structure for better categorization accuracy - LLMs now analyze files based on format purpose, not just filename Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added user_context persistence to Settings load/save - Added context_input restoration in restore_tree_settings - Ensure user context is saved across app sessions - Fix UI state synchronization on startup Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added null pointer checks in on_save_categories_button_clicked - Fixed context input to always update when switching whitelists (even if empty) - Ensures proper UI state synchronization when context is cleared Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…t-feature-overhaul Refactor whitelist system with context-aware categorization and intelligent file analysis
- Increased remote LLM timeout from 10s to 300s (5 min) to accommodate Gemini's adaptive timeout system (20-240s) - Added user_provided column to database to track user-provided categorizations - Created UserCategorizationDialog for manual categorization when AI fails - Added "Clear Categorization Cache" menu item in Settings menu with options for current folder or all data - Implemented DatabaseManager::close() and initialize() for cache clearing - Updated UI translations for new cache management feature Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Simplified cache clearing logic with better error handling - Added missing QString include to UserCategorizationDialog - Ensured database reinitialize after deletion - Verified default parameter for user_provided works with existing call sites Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added validation feedback to UserCategorizationDialog when fields are empty - Added comment about thread safety assumption in cache clearing - Added QMessageBox include for validation dialog - Acknowledged cached_results.clear() behavior is intentional given current data structure Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Modified prompts in GeminiClient and LLMClient to request confidence indication - LLM now responds with "UNCERTAIN : filename" when confidence < 70% - Added heuristic detection for generic categories (Uncategorized, Miscellaneous, Other, Unknown) - Uncertain cases return empty result and log AI-UNCERTAIN message - Both confidence-based (remote APIs) and heuristic (all models) approaches work together - Lays foundation for future UserCategorizationDialog integration Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Changed GeminiClient to use placeholder "[filename]" instead of actual filename in prompt - Ensures consistency between GeminiClient and LLMClient implementations - Prevents potential prompt injection attacks from malicious filenames - Detection logic works uniformly across all LLM providers Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…context handling Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…control Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…categorization Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…egory structures Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…te matching logic Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…ation-locally Implement adaptive user profiling system with organizational template learning and per-folder control
…s-and-improvements Fix Gemini timeout errors, add cache management, and implement uncertainty detection
…ormance-issues Fix critical thread safety and resource management bugs
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.
No description provided.