mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Remove hardcoding of gpt-3.5-turbo in favor of config
This commit is contained in:
@@ -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,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user