mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-25 01:14:24 +01:00
🧪 test: level 2
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user