feat: search fix web search

This commit is contained in:
Florian Hönicke
2023-05-19 22:56:36 +02:00
parent 077f03b049
commit 8746749f0f
2 changed files with 5 additions and 4 deletions

View File

@@ -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: 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')) 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_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 is_using_google_custom_search = 'google_custom_search' in packages or 'google-custom-search' in packages
microservice_content = self.generate_and_persist_file( microservice_content = self.generate_and_persist_file(
section_title='Microservice', section_title='Microservice',
template=template_generate_function_constructor(is_using_gpt_3_5_turbo, is_using_google_custom_search), 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) error = process_error_message(log_hubble)
if error: if error:
if not self_healing: 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...') print('An error occurred during the build process. Feeding the error back to the assistant...')
self.previous_microservice_path = self.cur_microservice_path self.previous_microservice_path = self.cur_microservice_path
self.cur_microservice_path = get_microservice_path( self.cur_microservice_path = get_microservice_path(

View File

@@ -140,7 +140,7 @@ It will be tested with the following scenario: '{{test_description}}'.
For the implementation use the following package(s): '{{packages}}'. For the implementation use the following package(s): '{{packages}}'.
The code must start with the following imports: 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 json
import requests import requests