diff --git a/dev_gpt/options/generate/generator.py b/dev_gpt/options/generate/generator.py index f856579..fd0ab99 100644 --- a/dev_gpt/options/generate/generator.py +++ b/dev_gpt/options/generate/generator.py @@ -198,8 +198,8 @@ metas: with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'apis.py'), 'r', encoding='utf-8') as f: persist_file(f.read(), os.path.join(self.cur_microservice_path, 'apis.py')) - is_using_gpt_3_5_turbo = 'gpt_3_5_turbo' in packages - is_using_google_custom_search = 'google-custom-search' in packages + is_using_gpt_3_5_turbo = 'gpt_3_5_turbo' in packages or 'gpt-3-5-turbo' in packages + is_using_google_custom_search = 'google_custom_search' in packages or 'google-custom-search' in packages microservice_content = self.generate_and_persist_file( section_title='Microservice', template=template_generate_function_constructor(is_using_gpt_3_5_turbo, is_using_google_custom_search), @@ -335,7 +335,8 @@ pytest error = process_error_message(log_hubble) if error: if not self_healing: - raise Exception('Self-healing is disabled. Please fix the error manually.', error) + print(error) + raise Exception('Self-healing is disabled. Please fix the error manually.') print('An error occurred during the build process. Feeding the error back to the assistant...') self.previous_microservice_path = self.cur_microservice_path self.cur_microservice_path = get_microservice_path( diff --git a/dev_gpt/options/generate/templates_user.py b/dev_gpt/options/generate/templates_user.py index f207bd8..ae31daf 100644 --- a/dev_gpt/options/generate/templates_user.py +++ b/dev_gpt/options/generate/templates_user.py @@ -140,7 +140,7 @@ It will be tested with the following scenario: '{{test_description}}'. For the implementation use the following package(s): '{{packages}}'. The code must start with the following imports: -```{linebreak +'from .apis import GPT_3_5_Turbo' if is_using_gpt_3_5_turbo else ""}{linebreak +'from .apis import search_web, search_images' if is_using_google_custom_search else ""}{linebreak} +```{linebreak +'from .apis import GPT_3_5_Turbo' if is_using_gpt_3_5_turbo else ""}{linebreak + 'from .apis import search_web, search_images' if is_using_google_custom_search else ""}{linebreak} import json import requests