This commit is contained in:
Nicholas Albion
2023-09-09 11:54:16 +10:00
parent 4b64631bec
commit a38c7c4f6d
3 changed files with 5 additions and 7 deletions

View File

@@ -2,18 +2,16 @@
from __future__ import print_function, unicode_literals
import sys
from dotenv import load_dotenv
from termcolor import colored
load_dotenv()
from helpers.Project import Project
from utils.arguments import get_arguments
from utils.exit import exit_gpt_pilot
from logger.logger import logger
from database.database import database_exists, create_database, tables_exist, create_tables
load_dotenv()
def init():
# Check if the "euclid" database exists, if not, create it

View File

@@ -53,7 +53,7 @@ def get_arguments():
else:
arguments['app_id'] = str(uuid.uuid4())
print(colored('\n------------------ STARTING NEW PROJECT ----------------------', 'green', attrs=['bold']))
print(f"If you wish to continue with this project in future run:")
print("If you wish to continue with this project in future run:")
print(colored(f'python {sys.argv[0]} app_id={arguments["app_id"]}', 'green', attrs=['bold']))
print(colored('--------------------------------------------------------------\n', 'green', attrs=['bold']))

View File

@@ -118,7 +118,7 @@ def create_gpt_chat_completion(messages: List[dict], req_type, min_tokens=MIN_TO
# Check if the error message is related to token limit
if "context_length_exceeded" in error_message.lower():
raise Exception(f'Too many tokens in the request. Please try to continue the project with some previous development step.')
raise Exception('Too many tokens in the request. Please try to continue the project with some previous development step.')
else:
print('The request to OpenAI API failed. Here is the error message:')
print(e)
@@ -157,7 +157,7 @@ def retry_on_exception(func):
time.sleep(wait_duration)
continue
print(colored(f'There was a problem with request to openai API:', 'red'))
print(colored('There was a problem with request to openai API:', 'red'))
print(err_str)
user_message = questionary.text(