Skip to content

Commit

Permalink
[REDBOX-359] | AS | Added basic test for REST rag_chat stuff_summaris…
Browse files Browse the repository at this point in the history
…ation functionality
  • Loading branch information
andy-symonds committed Jun 14, 2024
1 parent 8438a97 commit 5ec0206
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion core_api/tests/routes/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def mock_get_chain():
# assert response.status_code == status_code


def test_rag_chat(app_client, headers):
def test_rag_chat_rest_gratitude(app_client, headers):
response = app_client.post(
"/chat/rag",
json={"message_history": [{"role": "user", "text": "Thank you"}]},
Expand All @@ -65,6 +65,23 @@ def test_rag_chat(app_client, headers):
assert response_dict["output_text"] == "You're welcome!"


def test_rag_chat_rest_stuff_summarise(app_client, headers):
response = app_client.post(
"/chat/rag",
json={
"message_history": [
{
"role": "user",
"text": "Please summarise the contents of the uploaded files.",
}
]
},
headers=headers,
)
response_dict = response.json()
assert isinstance(response_dict["output_text"], str)


def test_rag_chat_streamed(app_client, headers):
# Given
message_history = [
Expand Down

0 comments on commit 5ec0206

Please sign in to comment.