tidy up tests

This commit is contained in:
Nicholas Albion
2023-09-21 00:25:25 +10:00
parent 886c00a2c6
commit 07f9842312
2 changed files with 5 additions and 4 deletions

View File

@@ -23,7 +23,8 @@ class AgentConvo:
agent: An instance of the agent participating in the conversation.
"""
def __init__(self, agent):
self.messages = []
# [{'role': 'system'|'user'|'assistant', 'content': ''}, ...]
self.messages: list[dict] = []
self.branches = {}
self.log_to_user = True
self.agent = agent

View File

@@ -49,14 +49,14 @@ class TestLlmConnection:
})
messages = convo.messages
# messages = [{"role": "user", "content": "I want to create a website"}]
# When
response = create_gpt_chat_completion(messages, '', function_calls=ARCHITECTURE)
# Then
# You are and experienced software architect...
# You are working in a software development agency...
assert len(convo.messages) == 2
assert convo.messages[0]['content'].startswith('You are an experienced software architect')
assert convo.messages[1]['content'].startswith('You are working in a software development agency')
assert response is not None
assert len(response) > 0
technologies: list[str] = response['function_calls']['arguments']['technologies']