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:
StreamerAI
class: Represents the main functionality of the streamer AI, handling script fetching, comment answering, and TTS management.StreamCommentsDB
class: A database utility class for managing stream comments using SQLite.TextToSpeech
class: A TTS service wrapper that handles speech synthesis for the AI-generated responses.Chains
class: A GPT-based question-answering module that creates context-aware AI responses.Retrieval
class: 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.10
poetry shell
to activate virtual environmentpoetry install
to install dependencies
poetry shell
if you haven't yetsource .env
if you haven't yet- Bootstrap database with some product data
poetry run bootstrap --reset
poetry run bootstrap --products
poetry 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