1. 25 Aug, 2025 2 commits
    • nextime's avatar
      Improve Gemini integration and update documentation · 9fe0a109
      nextime authored
      - Enhanced Gemini prompt template with expert-level assistant designation
      - Added HTML code block enclosure for better response formatting
      - Fixed typos in Gemini prompt template
      - Updated browser data directory to use user home directory (~/.playwright_data)
      - Updated CHANGELOG.md and README.md with latest changes
      9fe0a109
    • nextime's avatar
      Working on the prompt... · 5295c979
      nextime authored
      5295c979
  2. 24 Aug, 2025 13 commits
    • nextime's avatar
      Added status to the README · fdcca785
      nextime authored
      fdcca785
    • nextime's avatar
      Remove pycache and other useless files · 1dc263e7
      nextime authored
      1dc263e7
    • nextime's avatar
      Refining gemini prompt · cc183599
      nextime authored
      cc183599
    • nextime's avatar
      Removed unused files · db125400
      nextime authored
      db125400
    • nextime's avatar
      feat: comprehensive Gemini response detection and tool usage improvements · a5374419
      nextime authored
      - Enhanced response detection with increased timeouts and better reliability
      - Added HTML entity decoding for clean tool representation
      - Optimized Gemini prompt template with specific tool mapping
      - Improved error handling and debugging capabilities
      - Fixed JavaScript regex syntax warnings
      - Added comprehensive logging and validation
      - Updated changelog with detailed feature documentation
      a5374419
    • nextime's avatar
      Improve response detection timing and add delay for Gemini · 5aa7a365
      nextime authored
      - Added 2-second delay before response detection to allow Gemini to finish generating
      - Enhanced JavaScript fallback logic to better handle response waiting
      - Improved timing for response detection to avoid returning setup acknowledgments
      - Better synchronization between prompt sending and response detection
      5aa7a365
    • nextime's avatar
      Add response ID tracking to debug logs · ca9b223c
      nextime authored
      - Log which response ID was matched for each reply
      - Track exact matches vs fallback responses
      - Include response ID in prompts.log for correlation
      - Enhanced debugging visibility for response detection
      - Console logging for JavaScript fallback cases
      ca9b223c
    • nextime's avatar
      Enhanced debug logging with request ID tracking and response logging · 2a54a34e
      nextime authored
      - Added request ID logging to prompts.log for proper correlation
      - Log decoded responses in prompts.log to show what gets sent back via API
      - Improved HTML debug output with body-only extraction and response markers
      - Better request ID consistency throughout the system
      - Enhanced debug information for troubleshooting response detection
      2a54a34e
    • nextime's avatar
      Improve response detection to ignore example content · d8fe0d7a
      nextime authored
      - Enhanced filtering to ignore example responses from prompt template
      - Added filtering for TEST123 and example-specific keywords
      - Better detection of actual responses vs setup/template content
      - More robust response identification for Gemini
      d8fe0d7a
    • nextime's avatar
      Fix --debug argument parsing · 27dfe6e0
      nextime authored
      - Added --debug argument to the main argument parser
      - Fixed duplicate argument parser issue
      - --debug switch now works correctly
      27dfe6e0
    • nextime's avatar
      Enhanced debug functionality with comprehensive logging · b1a474ac
      nextime authored
      - Added --debug switch that creates timestamped directory
      - Saves all prompts sent to chatbots in prompts.log
      - Saves debug execution logs in debug.log
      - Captures HTML content of chatbot page when response is detected
      - Directory structure: debug_[unix_epoch]/
        - prompts.log: All prompts sent to chatbots
        - debug.log: Detailed execution logs
        - response_[id]_[timestamp].html: HTML snapshots
      - Improved response detection to correctly identify actual responses vs setup acknowledgments
      - Enhanced JavaScript detection logic with better filtering
      b1a474ac
    • nextime's avatar
      Improve Gemini prompt to allow plain text formatting · 543f244f
      nextime authored
      - Updated Gemini prompt template to allow basic text formatting
      - Added support for new lines, tabs, and basic markup language
      - Maintained RESPONSE_ID markers for reliable parsing
      - Enhanced example with formatting demonstration
      - Preserved tool usage requirements and response structure
      543f244f
    • nextime's avatar
      Add Python client for OLProxy API · 142522c1
      nextime authored
      - Created olproxy_client.py with full API support
      - Supports both Ollama and OpenAI API formats
      - Includes command-line interface for easy testing
      - Provides methods for all major API endpoints
      - Added proper error handling and JSON formatting
      142522c1
  3. 23 Aug, 2025 20 commits
    • nextime's avatar
      Fix syntax warnings and improve Gemini prompt template · 62fc2340
      nextime authored
      - Fixed Python syntax warnings for invalid escape sequences in JS regex
      - Updated Gemini prompt template to emphasize mandatory tool usage
      - Changed Gemini response format from HTML tags to plain text with RESPONSE_ID markers
      - Updated response detection logic for improved reliability
      - Added Gemini model to supported models list in README
      - Updated CHANGELOG with detailed changes
      62fc2340
    • nextime's avatar
      Fix JavaScript regex escaping and improve Enter key submission · 437b2d53
      nextime authored
      - Fixed JavaScript regex patterns by properly escaping requestId with replace() method
      - Added proper regex escaping to prevent 'Invalid or unexpected token' errors
      - Simplified regex patterns to use only two main patterns instead of four complex ones
      - Enhanced Enter key submission with proper focus timing and delays
      - Added 0.5 second delays before and after Enter key press for better reliability
      - Ensures proper input focus before sending Enter key for Gemini chatbot
      437b2d53
    • nextime's avatar
      Update logo image · 9ae958d3
      nextime authored
      9ae958d3
    • nextime's avatar
      Enhance prompt and parser to prevent XML/code block responses · f506afc4
      nextime authored
      - Clarified prompt to prevent XML tags and code blocks around JSON output
      - Specified that formatting restrictions apply only to JSON wrapper, not answer content
      - Enhanced JavaScript parser to detect JSON in span elements and other containers
      - Added comprehensive container detection including spans, divs, and paragraphs
      - Improved JSON detection to handle responses outside of code blocks
      - Maintained backward compatibility with existing code block detection
      f506afc4
    • nextime's avatar
      Fix JavaScript regex pattern causing 'Invalid or unexpected token' error · 12dedbaf
      nextime authored
      - Removed problematic regex pattern with nested quotes that caused JavaScript syntax error
      - Simplified JSON detection patterns to avoid complex quote escaping issues
      - Fixed regex patterns on lines 499-500 that were causing 'Invalid or unexpected token'
      - Maintained JSON detection functionality while eliminating syntax errors
      - Improved JavaScript code reliability and parsing
      12dedbaf
    • nextime's avatar
      Fix Python SyntaxWarning for invalid escape sequence · 06d12f91
      nextime authored
      - Fixed invalid escape sequence '\s' on line 523 in JavaScript regex pattern
      - Changed from single backslash to double backslash for proper escaping
      - Ensures Python interpreter correctly handles the JavaScript string literal
      - Eliminates SyntaxWarning while maintaining JavaScript regex functionality
      06d12f91
    • nextime's avatar
      Optimize prompt to prevent chatbot explanations and reduce encoding time · 51c28026
      nextime authored
      - Redesigned prompt to be more direct and system-like
      - Added explicit instructions to NOT explain the encoding process
      - Removed verbose explanations that were causing chatbots to add commentary
      - Streamlined format requirements to prevent 'I'll encode this in JSON' responses
      - Made instructions more concise and command-like for faster processing
      - Maintained all functionality while reducing response time
      51c28026
    • nextime's avatar
      Simplify JavaScript code structure for better reliability · 10316371
      nextime authored
      - Removed complex escape sequence handling that caused syntax errors
      - Simplified cleanJsonText function to focus on essential HTML entity decoding
      - Streamlined malformed JSON handling with cleaner pattern matching
      - Reduced nested try-catch complexity for better maintainability
      - Maintained core functionality while improving code reliability
      10316371
    • nextime's avatar
      Fix JavaScript syntax errors in complex regex patterns · d5d6c396
      nextime authored
      - Simplified regex patterns to avoid escaping issues
      - Removed overly complex regex constructions that caused 'missing ) after argument list' errors
      - Maintained functionality while improving reliability
      - Fixed responseMatch pattern extraction for malformed JSON handling
      d5d6c396
    • nextime's avatar
      Increase button selector timeout to 70 seconds · c8610caf
      nextime authored
      - Set explicit timeout of 70 seconds for button click operation
      - This is 10 seconds more than the 60-second final response timeout
      - Prevents button selector timeouts that were causing failures
      - Ensures button click waits long enough for slow-loading pages
      - Addresses user feedback about button selector timeout issues
      
      The timeout hierarchy is now:
      - Button click: 70 seconds
      - Final response detection: 60 seconds
      - Main JSON detection: 45 seconds
      - Container selector: 48 seconds
      c8610caf
    • nextime's avatar
      Improve prompt to ensure complete response capture in base64 encoding · 2cf42f1e
      nextime authored
      - Add explicit step-by-step instructions for chatbot to follow
      - Emphasize waiting for COMPLETE response before JSON formatting
      - Use numbered list format for clarity and better compliance
      - Add example JSON format to reduce ambiguity
      - Separate user question clearly from formatting instructions
      - Address issue where chatbot was truncating responses before base64 encoding
      
      This should resolve the problem where the chatbot wasn't including
      the whole reply correctly in the base64 encoded response key.
      2cf42f1e
    • nextime's avatar
      Fix JavaScript string literal syntax error in array join · 0e320d63
      nextime authored
      - Change '\\n' to '\n' in allTexts.join() call
      - This was causing 'missing ) after argument list' error in page.evaluate
      - JavaScript string literals need single backslash, not double backslash
      - Resolves the remaining JavaScript syntax error in JSON response detection
      0e320d63
    • nextime's avatar
      Fix JavaScript null pointer error in regex match chaining · c9f87350
      nextime authored
      - Add proper null checking for chained .match() calls
      - Prevent 'missing ) after argument list' error when second match returns null
      - Improve error handling in malformed JSON response extraction
      - This resolves the JavaScript syntax error in page.evaluate function
      c9f87350
    • nextime's avatar
      Fix JavaScript syntax errors in page.evaluate regex patterns · c101dd9f
      nextime authored
      - Replace inline regex literals with RegExp constructors for dynamic requestId
      - Fix 'missing ) after argument list' error in JSON pattern matching
      - Update all regex patterns to use proper RegExp constructor syntax
      - Ensure proper string concatenation with requestId variable
      - Fix jsonMatch pattern to use separate RegExp objects
      
      This resolves the JavaScript syntax error that was causing
      page.evaluate to fail during JSON response detection.
      c101dd9f
    • nextime's avatar
      Increase page click timeout to 48 seconds (3 seconds more than reply timeout) · a5320424
      nextime authored
      - Update wait_for_selector timeout from 60 seconds to 48 seconds
      - Align page timeout with reply timeout (45s) plus 3 second buffer
      - Ensure page operations don't timeout before response detection completes
      - Improve coordination between page interaction and response waiting phases
      
      This prevents page timeout issues while maintaining reasonable wait times
      for container selector detection during chatbot interactions.
      a5320424
    • nextime's avatar
      Implement base64 encoding for chatbot responses to avoid formatting issues · dd4e12a0
      nextime authored
      - Change prompt instruction to request base64 encoded responses instead of escaped text
      - Add base64 import and decoding logic in forward_to_chatbot function
      - Update JSON validation to verify base64 format using regex and atob() validation
      - Add comprehensive error handling for base64 decoding with fallback to raw response
      - Enhanced logging to track base64 decoding success/failure
      - Prevent issues with special characters, HTML entities, and complex formatting
      
      This approach eliminates problems with HTML encoding, escape sequences,
      and special characters by having the chatbot encode the entire response
      in base64 format, which we then decode on the proxy side.
      dd4e12a0
    • nextime's avatar
      Enforce strict ID matching and complete JSON validation before serving responses · 9920f907
      nextime authored
      - Add comprehensive logging with emojis for better debugging visibility
      - Implement strict validation requiring exact ID match and non-empty response
      - Enhanced observer logic to only resolve on complete, validated JSON
      - Add priority-based detection: HTML code blocks first, then text content
      - Prevent premature response serving until complete JSON with matching ID is found
      - Add detailed console logging for tracking detection progress
      - Ensure system waits for complete ID match before serving any API response
      
      This ensures the API absolutely waits for the complete JSON response
      with the matching request ID before serving any reply to clients.
      9920f907
    • nextime's avatar
      Improve JSON response validation and increase timeout to 45 seconds · c0d398f4
      nextime authored
      - Increase main timeout to 45 seconds as requested for complete response detection
      - Add strict JSON validation requiring both 'response' and 'id' keys
      - Implement isCompleteValidJson() function to ensure JSON completeness
      - Only return responses when JSON is complete and valid
      - Add enhanced logging for debugging partial matches
      - Prevent premature response extraction from incomplete JSON
      - Add safety timeout at 60 seconds to prevent hanging
      - Improve observer logic to only resolve on complete, valid JSON
      
      This ensures the API only serves responses when we have complete,
      valid JSON with both required keys, preventing partial or corrupted responses.
      c0d398f4
    • nextime's avatar
      Implement improved JSON-based response detection system · 41cc9c97
      nextime authored
      - Replace spy word detection with robust JSON-based response extraction
      - Add UUID-based unique request identification for better reliability
      - Implement comprehensive JSON parsing with error recovery mechanisms
      - Add support for partial JSON response extraction
      - Enhance error handling for malformed JSON responses
      - Improve detection of responses containing code blocks and special formatting
      - Better handling of dynamic content and progressive response loading
      - Update CHANGELOG.md to document breaking changes and improvements
      
      This addresses the core issue with complex HTML parsing by requesting
      structured JSON responses from chatbots, making response extraction
      much more reliable and accurate.
      41cc9c97
    • nextime's avatar
      Initial commit: Add OLProxy with comprehensive documentation and GPLv3 licensing · 862ec611
      nextime authored
      - Add olproxy.py: Python proxy server bridging web chatbots to Ollama API
      - Add README.md: Comprehensive documentation with logo, usage examples, and API reference
      - Add CHANGELOG.md: Structured changelog following Keep a Changelog format
      - Add LICENSE: GPLv3 license with copyright attribution to Stefy Lanza
      - Add olproxy.jpg: Project logo
      - All files include proper GPLv3 licensing and attribution
      862ec611