Merge master to fixes_gpt3

This commit is contained in:
Taylor Brown
2023-04-02 18:30:28 -05:00
12 changed files with 55 additions and 32 deletions

View File

@@ -88,7 +88,7 @@ def summarize_text(text, is_website=True):
messages = [
{
"role": "user",
"content": "Please summarize the following website text, do not describe the general website, but instead concisely extract the specifc information this subpage contains.: " +
"content": "Please summarize the following website text, do not describe the general website, but instead concisely extract the specific information this subpage contains.: " +
chunk},
]
else:
@@ -116,7 +116,7 @@ def summarize_text(text, is_website=True):
messages = [
{
"role": "user",
"content": "Please summarize the following website text, do not describe the general website, but instead concisely extract the specifc information this subpage contains.: " +
"content": "Please summarize the following website text, do not describe the general website, but instead concisely extract the specific information this subpage contains.: " +
combined_summary},
]
else:

View File

@@ -1,9 +1,13 @@
import os
import time
import openai
import keys
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Initialize the OpenAI API client
openai.api_key = keys.OPENAI_API_KEY
openai.api_key = os.getenv("OPENAI_API_KEY")
def create_chat_message(role, content):

View File

@@ -1,5 +0,0 @@
# Get yours from: https://beta.openai.com/account/api-keys
OPENAI_API_KEY = "YOUR-OPENAI-KEY"
# To access your ElevenLabs API key, head to https://elevenlabs.io, you
# can view your xi-api-key using the 'Profile' tab on the website.
ELEVENLABS_API_KEY = "YOUR-ELEVENLABS-KEY"

View File

@@ -11,11 +11,17 @@ import speak
from enum import Enum, auto
import sys
from config import Config
from dotenv import load_dotenv
from json_parser import fix_and_parse_json
from ai_config import AIConfig
import traceback
import yaml
# Load environment variables from .env file
load_dotenv()
class Argument(Enum):
CONTINUOUS_MODE = "continuous-mode"
SPEAK_MODE = "speak-mode"

View File

@@ -1,17 +0,0 @@
# I wasn't having any luck installing the requirements.txt file in Mac or Linux,
# so I unpinned and installed, and got these versions:
beautifulsoup4==4.9.3
colorama==0.4.6
dirtyjson==1.0.8
# The biggest difference is docker 5 instead of 6, because of this silliness:
# The conflict is caused by:
# The user requested requests>=2.26.0
# docker 6.0.1 depends on requests>=2.26.0
# googlesearch-python 1.1.0 depends on requests==2.25.1
docker==5.0.3
googlesearch-python==1.1.0
openai==0.27.2
playsound==1.3.0
pyyaml==6.0
readability-lxml==0.8.1
requests==2.25.1

View File

@@ -1,10 +0,0 @@
beautifulsoup4==4.9.3
colorama==0.4.6
dirtyjson==1.0.8
docker==6.0.1
googlesearch_python==1.1.0
openai==0.27.0
playsound==1.2.2
pyyaml==6.0
readability_lxml==0.8.1
requests==2.25.1

View File

@@ -1,13 +1,17 @@
import os
from playsound import playsound
import requests
import keys
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
voices = ["ErXwobaYiN019PkySvjV", "EXAVITQu4vr4xnSDxMaL"]
tts_headers = {
"Content-Type": "application/json",
"xi-api-key": keys.ELEVENLABS_API_KEY
"xi-api-key": os.getenv("ELEVENLABS_API_KEY")
}