mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-17 20:55:09 +01:00
Merge pull request #40 from jnichols0/main
Revert model to gpt-3.5-turbo when gpt-4 is not available.
This commit is contained in:
8
ai.py
8
ai.py
@@ -5,6 +5,14 @@ class AI:
|
||||
def __init__(self, **kwargs):
|
||||
self.kwargs = kwargs
|
||||
|
||||
try:
|
||||
openai.Model.retrieve("gpt-4")
|
||||
except openai.error.InvalidRequestError:
|
||||
print("Model gpt-4 not available for provided api key reverting "
|
||||
"to gpt-3.5.turbo. Sign up for the gpt-4 wait list here: "
|
||||
"https://openai.com/waitlist/gpt-4-api")
|
||||
self.kwargs['model'] = "gpt-3.5-turbo"
|
||||
|
||||
def start(self, system, user):
|
||||
messages = [
|
||||
{"role": "system", "content": system},
|
||||
|
||||
Reference in New Issue
Block a user