mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-17 20:55:09 +01:00
Simplify and clarify
This commit is contained in:
3
ai.py
3
ai.py
@@ -20,12 +20,13 @@ class AI:
|
||||
def fuser(self, msg):
|
||||
return {"role": "user", "content": msg}
|
||||
|
||||
def next(self, messages, prompt=None):
|
||||
def next(self, messages: list[dict[str, str]], prompt=None):
|
||||
if prompt:
|
||||
messages = messages + [{"role": "user", "content": prompt}]
|
||||
|
||||
response = openai.ChatCompletion.create(
|
||||
messages=messages,
|
||||
stream=True,
|
||||
**self.kwargs
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user