StreamerAI is a Python-based application that allows users to engage with an AI-powered streaming assistant. The application can fetch product scripts, answer comments, and handle text-to-speech (TTS) functionalities. It utilizes SQLite for database management, GPT-based models for answering questions, and TTS services for speech synthesis.
The main components of the StreamerAI application include:
StreamerAIclass: Represents the main functionality of the streamer AI, handling script fetching, comment answering, and TTS management.StreamCommentsDBclass: A database utility class for managing stream comments using SQLite.TextToSpeechclass: A TTS service wrapper that handles speech synthesis for the AI-generated responses.Chainsclass: A GPT-based question-answering module that creates context-aware AI responses.Retrievalclass: A GPT-based question-answering module that retrieves relevant information based on user queries.
- Set OpenAI API Key environment variable via
export OPENAI_API_KEY=<key here> - Set Pinecone API Key environment variable via
export PINECONE_API_KEY=<key here> - Set TTS API Key environment variable via
export TTS_ACCESS_TOKEN=<key here> - Install poetry if you have not yet via
pip install poetry poetry env use python3.10poetry shellto activate virtual environmentpoetry installto install dependencies
poetry shellif you haven't yetsource .envif you haven't yet- Bootstrap database with some product data
poetry run bootstrap --resetpoetry run bootstrap --productspoetry run bootstrap --personas
- Start main script
poetry run start --room_id ROOM_ID [--voice_type VOICE_TYPE] [--voice_style VOICE_STYLE] --platform {douyin,bili,fake} [--disable_script] [--persona PERSONA]
- Start main script `poetry run start --room_id 'room id here'
poetry run fake --room_id 'room_id_here'- Type in some comments and see the AI respond
