From e4fc2e67850ef1487951974924a23eb0a8a1b248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Sun, 30 Apr 2023 17:52:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20level=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/gpt.py | 9 +++++---- src/options/generate/generator.py | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apis/gpt.py b/src/apis/gpt.py index c386f6a..4111386 100644 --- a/src/apis/gpt.py +++ b/src/apis/gpt.py @@ -108,14 +108,14 @@ class _GPTConversation: self.messages = messages self.print_stream = print_stream self.print_costs = print_costs - for message in messages: + for i, message in enumerate(messages): if os.environ['VERBOSE'].lower() == 'true': if isinstance(message, SystemMessage): - print_colored('system - prompt', message.content, 'magenta') + print_colored(f'({i}) system - prompt', message.content, 'magenta') elif isinstance(message, HumanMessage): - print_colored('user - prompt', message.content, 'blue') + print_colored(f'({i}) user - prompt', message.content, 'blue') elif isinstance(message, AIMessage): - print_colored('assistant - prompt', message.content, 'green') + print_colored(f'({i}) assistant - prompt', message.content, 'green') def chat(self, prompt: str, role: str = 'user'): MassageClass = HumanMessage if role == 'user' else SystemMessage @@ -126,6 +126,7 @@ class _GPTConversation: print_colored(role, prompt, color) if self.print_stream: print_colored('assistant', '', 'green', end='') + print('thinking...') for i in range(10): try: response = self._chat(self.messages) diff --git a/src/options/generate/generator.py b/src/options/generate/generator.py index a153c9d..d7577e7 100644 --- a/src/options/generate/generator.py +++ b/src/options/generate/generator.py @@ -430,7 +430,7 @@ gptdeploy deploy --path {self.microservice_root_path} messages, 'test', '''Note that the test scenario must not contain information that was already mentioned in the microservice description. -Note that if the test scenario must contain the full description of the concrete example in case it was mentioned in the microservice description.''' +Note that the test scenario must contain the full description of the concrete example in case it was mentioned in the microservice description.''' ) break except self.TaskRefinementException as e: @@ -450,7 +450,6 @@ Test scenario: num_parsing_tries = 0 while True: conversation = self.gpt_session.get_conversation(messages, print_stream=os.environ['VERBOSE'].lower() == 'true', print_costs=False) - print('thinking...') agent_response_raw = conversation.chat( template_refinement.format( user_input=user_input,