Skip to content

EchoCog/echosurface

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Interface Automation

This project implements a flexible chat interface automation system that combines both browser automation and API interactions for maximum reliability and efficiency.

Features

  • Hybrid approach combining Selenium-based browser automation and direct API calls
  • Automatic fallback from API to browser automation if API calls fail
  • Secure credential management using environment variables
  • Headless browser support for background operation

Setup

  1. Install the required dependencies:
pip install -r requirements.txt
  1. Copy .env.template to .env and fill in your credentials:
cp .env.template .env
  1. Update the chat interface URL and selectors in chat_interface.py to match your target chat interface.

Usage

from chat_interface import ChatInterface

# Initialize the chat interface
chat = ChatInterface(chat_url="https://your-chat-interface.com")

# Authenticate
chat.get_auth_cookies(username="your_username", password="your_password")

# Send a query and get response
response = chat.send_query("hi", use_api=True)  # Will fall back to browser automation if API fails
print(response)

Configuration

  • Update the CSS selectors in _send_browser_query() to match your chat interface
  • Modify the API endpoint and payload structure in _send_api_query() as needed
  • Adjust timeouts and wait conditions based on your needs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.3%
  • JavaScript 5.1%
  • Shell 2.4%
  • Rust 1.4%
  • Other 0.8%