Use gpt-4 by default for the main thought process

Allow specifying the llm through dotenv
Move more things into config
This commit is contained in:
Taylor Brown
2023-04-02 21:35:28 -05:00
parent 3e587bc7fb
commit 80ccd10d0b
7 changed files with 56 additions and 28 deletions

View File

@@ -1,20 +1,17 @@
import os
from playsound import playsound
import requests
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
from config import Config
cfg = Config()
# TODO: Nicer names for these ids
voices = ["ErXwobaYiN019PkySvjV", "EXAVITQu4vr4xnSDxMaL"]
tts_headers = {
"Content-Type": "application/json",
"xi-api-key": os.getenv("ELEVENLABS_API_KEY")
"xi-api-key": cfg.elevenlabs_api_key
}
def say_text(text, voice_index=0):
tts_url = "https://api.elevenlabs.io/v1/text-to-speech/{voice_id}".format(
voice_id=voices[voice_index])