Gemini API Setup
        
        Overview
        Tag-AI can use Google's Gemini API for enhanced cloud-based image tagging. This offers improved tag quality
            and quantity but requires an API key and internet connectivity.
        
        The Gemini API offers both free and paid tiers, with different rate limits and capabilities.
        Getting a Gemini API Key
        Step 1: Create a Google AI Studio Account
        
            - Visit Google AI Studio
 
            - Sign in with your Google account
 
            - Accept the terms of service
 
        
        Step 2: Create an API Key
        
            - In Google AI Studio, click on the "Get API key" button
 
            - If you already have a project, select it; otherwise, create a new one
 
            - Click "Create API key"
 
            - Your new API key will be displayed - copy it immediately
 
        
        
            Your API key is sensitive information. Never share it publicly or check it into version control systems.
            
         
        Step 3: Enable Billing (Optional - For Paid Tier)
        If you want to use the paid tier with higher rate limits:
        
            - Go to the Google Cloud Console
 
            - Select your project
 
            - Go to "Billing"
 
            - Set up a billing account and link it to your project
 
            - Return to Google AI Studio and verify your paid tier is active
 
        
        Configuring Tag-AI
        Step 1: Open Configuration Editor
        
            - In Tag-AI, click "Actions" in the menu bar
 
            - Select "Edit Config"
 
        
        Step 2: Enter API Key
        
            - Locate the 
[tagger_gemini] section 
            - Paste your API key into the 
gemini_api_key field 
            - If you're using the paid tier, set 
paid_version to true 
        
        
        Step 3: Switch to Gemini Processing
        
            - In the configuration editor, scroll to the 
[script_to_run] section 
            - Change 
llm_script from local to gemini 
            - Click "Save" to apply your changes
 
        
        Step 4: Test the Connection
        
            - Return to the main interface
 
            - Click "Scan" to open the scan window
 
            - Start a scan to process a few images
 
            - Check for successful API responses in the output log
 
        
        Free vs. Paid Tiers
        
            
                | Feature | 
                Free Tier | 
                Paid Tier | 
            
            
                | Cost | 
                Free | 
                Pay-as-you-go based on usage | 
            
            
                | Rate Limit | 
                15 requests per minute | 
                Up to 2000 requests per minute | 
            
            
                | Monthly Quota | 
                Limited (subject to Google's policies) | 
                Based on your billing setup | 
            
            
                | API Availability | 
                Subject to usage restrictions | 
                Higher availability, SLA options | 
            
            
                | Image Resolution | 
                Same | 
                Same | 
            
            
                | Model Quality | 
                Same | 
                Same | 
            
        
        Rate Limits
        Free Tier Limitations
        Tag-AI automatically respects the free tier rate limits by:
        
            - Limiting requests to 15 per minute
 
            - Queuing image processing jobs
 
            - Providing progress indicators during processing
 
        
        Paid Tier Benefits
        With the paid tier:
        
            - Process up to 2000 requests per minute
 
            - Tag large image libraries much faster
 
            - No monthly quotas (pay for what you use)
 
        
        Rate Limit Configuration
        Tag-AI automatically detects your tier based on the paid_version setting:
        
            paid_version = false: Enforces 15 RPM limit 
            paid_version = true: Removes rate limiting (subject to your Google Cloud quota) 
        
        Troubleshooting
        API Key Issues
        If you receive API key errors:
        
            - Verify the key is correctly copied without extra spaces
 
            - Check if the key is still valid in Google AI Studio
 
            - Try generating a new key if problems persist
 
            - Ensure you're using a Gemini API key (not a general Google Cloud API key)
 
        
        
        Quota Exceeded
        If you see "quota exceeded" errors:
        
            - For free tier: Wait until your quota resets (typically hourly)
 
            - For paid tier: Check your Google Cloud Console for any billing issues
 
            - Consider switching to local LLaVA processing temporarily
 
        
        
        Network Issues
        If Tag-AI can't connect to the Gemini API:
        
            - Check your internet connection
 
            - Verify no firewall is blocking the connection
 
            - Ensure proxy settings are configured correctly if you use a proxy
 
        
        
        Processing Errors
        If images fail to process with Gemini:
        
            - Check if the image format is supported
 
            - Verify the image isn't corrupt or too large
 
            - Try reducing the 
max_image_size value in configuration 
            - Check the scan window output for specific error messages
 
        
        
        Privacy Considerations
        
        Data Transmission
        When using the Gemini API:
        
            - Your images are transmitted to Google's servers for processing
 
            - Images are resized before transmission (based on 
max_image_size setting) 
            - Transmission occurs over encrypted HTTPS connections
 
        
        
        Google's Data Usage
        According to Google's terms:
        
            - Google may use your data to improve their services
 
            - Your content remains your property
 
            - Google doesn't claim ownership of your images
 
        
        
        
            For complete privacy, use the local LLaVA processing option instead of Gemini API.
         
        
        Sensitive Data
        Consider these guidelines for sensitive images:
        
            - Do not process confidential documents
 
            - Avoid sending images with personal identification information
 
            - Use local processing for medical, legal, or private images
 
            - Review Google's current API terms for
                up-to-date policies