feat: search fix web search

This commit is contained in:
Florian Hönicke
2023-05-20 01:05:09 +02:00
parent b2f1ce4489
commit 16f1f7b6af
4 changed files with 34 additions and 25 deletions

View File

@@ -6,10 +6,10 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
class GPT_3_5_Turbo:
def __init__(self, system: str = ''):
self.system = system
def __init__(self, system_string: str = ''):
self.system = system_string
def __call__(self, prompt: str) -> str:
def __call__(self, prompt_string: str) -> str:
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{
@@ -17,7 +17,7 @@ class GPT_3_5_Turbo:
"content": self.system
}, {
"role": 'user',
"content": prompt
"content": prompt_string
}]
)
return response.choices[0]['message']['content']