Remove hardcoding of gpt-3.5-turbo in favor of config

This commit is contained in:
Taylor Brown
2023-04-02 21:38:21 -05:00
parent 80ccd10d0b
commit 744c5fa25b
2 changed files with 5 additions and 3 deletions

View File

@@ -3,7 +3,9 @@ import requests
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from readability import Document from readability import Document
import openai import openai
from config import Config
cfg = Config()
def scrape_text(url): def scrape_text(url):
response = requests.get(url) response = requests.get(url)
@@ -100,7 +102,7 @@ def summarize_text(text, is_website=True):
] ]
response = openai.ChatCompletion.create( response = openai.ChatCompletion.create(
model="gpt-3.5-turbo", model=cfg.fast_llm_model,
messages=messages, messages=messages,
max_tokens=300, max_tokens=300,
) )
@@ -128,7 +130,7 @@ def summarize_text(text, is_website=True):
] ]
response = openai.ChatCompletion.create( response = openai.ChatCompletion.create(
model="gpt-3.5-turbo", model=cfg.fast_llm_model,
messages=messages, messages=messages,
max_tokens=300, max_tokens=300,
) )

View File

@@ -164,7 +164,7 @@ def shutdown():
quit() quit()
def start_agent(name, task, prompt, model="gpt-3.5-turbo"): def start_agent(name, task, prompt, model=cfg.fast_llm_model):
global cfg global cfg
# Remove underscores from name # Remove underscores from name