Update utils/helper.py
Browse files- utils/helper.py +2 -4
utils/helper.py
CHANGED
|
@@ -3,11 +3,9 @@ from openai import OpenAI
|
|
| 3 |
|
| 4 |
|
| 5 |
class ChatBot:
|
| 6 |
-
def __init__(self
|
| 7 |
self.client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
|
| 8 |
-
self.
|
| 9 |
-
self.conversation = conversation
|
| 10 |
-
self.history = [{"role": "system", "content": self.protocol}] + self.conversation
|
| 11 |
|
| 12 |
def generate_response(self, prompt: str) -> str:
|
| 13 |
self.history.append({"role": "user", "content": prompt})
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
class ChatBot:
|
| 6 |
+
def __init__(self):
|
| 7 |
self.client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
|
| 8 |
+
self.history = [{"role": "system", "content": "You are a helpful assistant."}]
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def generate_response(self, prompt: str) -> str:
|
| 11 |
self.history.append({"role": "user", "content": prompt})
|