Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisenman23 committed Dec 20, 2024
1 parent 4018c59 commit 4ca2970
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion elm/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def engineer_query(self, query,
returned here
vector_query_time : float
measures vector database query time
used_index : list
Shows the indices of the documents used in making a query to the
vector database
"""

self.messages.append({"role": "user", "content": query})
Expand Down Expand Up @@ -228,7 +231,7 @@ def chat(self, query,
else:
response_message = response.choices[0].message.content
finish_completion_time = perf_counter()
chat_completion_time = start_completion_time - finish_completion_time
chat_completion_time = finish_completion_time - start_completion_time

self.messages.append({'role': 'assistant',
'content': response_message})
Expand Down
2 changes: 1 addition & 1 deletion tests/test_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_chunk_and_embed(mocker):
assert query.endswith(question)
assert 'source0' in references
assert isinstance(performance, dict)

assert performance["chat_completion_time"] > 0

def test_convo_query(mocker):
"""Query with multiple messages
Expand Down

0 comments on commit 4ca2970

Please sign in to comment.