Merge branch 'main' of github.com:jina-ai/microchain into feat_going_meta

This commit is contained in:
Florian Hönicke
2023-04-20 01:59:05 +02:00
9 changed files with 50 additions and 14 deletions

View File

@@ -54,7 +54,7 @@ metas:
def generate_and_persist_file(self, section_title, template, destination_folder, file_name, **template_kwargs):
print_colored('', f'\n############# {section_title} #############', 'blue')
print_colored('', f'\n\n############# {section_title} #############', 'blue')
conversation = self.gpt_session.get_conversation()
template_kwargs = {k: v for k, v in template_kwargs.items() if k in template.input_variables}
content_raw = conversation.chat(
@@ -140,7 +140,7 @@ metas:
print('\nFirst version of the microservice generated. Start iterating on it to make the tests pass...')
def generate_playground(self, microservice_name, microservice_path):
print_colored('', '\n############# Playground #############', 'blue')
print_colored('', '\n\n############# Playground #############', 'blue')
file_name_to_content = get_all_microservice_files_with_content(microservice_path)
conversation = self.gpt_session.get_conversation([])
@@ -223,13 +223,14 @@ metas:
return 'yes' in answer.lower()
def generate_microservice_name(self, description):
print_colored('', '\n\n############# What should be the name of the Microservice? #############', 'blue')
conversation = self.gpt_session.get_conversation()
name_raw = conversation.chat(template_generate_microservice_name.format(description=description))
name = self.extract_content_from_result(name_raw, 'name.txt')
return name
def get_possible_packages(self):
print_colored('', '############# What packages to use? #############', 'blue')
print_colored('', '\n\n############# What packages to use? #############', 'blue')
conversation = self.gpt_session.get_conversation()
packages_raw = conversation.chat(
template_generate_possible_packages.format(description=self.task_description)