Remove output_modes function reference in chat tests

This commit is contained in:
sabaimran 2024-11-15 14:03:07 -08:00
parent e3f1ea9dee
commit c77dc84a68
2 changed files with 0 additions and 50 deletions

View file

@ -18,7 +18,6 @@ from khoj.processor.conversation.offline.chat_model import (
) )
from khoj.processor.conversation.offline.utils import download_model from khoj.processor.conversation.offline.utils import download_model
from khoj.processor.conversation.utils import message_to_log from khoj.processor.conversation.utils import message_to_log
from khoj.routers.helpers import aget_relevant_output_modes
from khoj.utils.constants import default_offline_chat_models from khoj.utils.constants import default_offline_chat_models
@ -549,34 +548,6 @@ def test_filter_questions():
assert filtered_questions[0] == "Who is on the basketball team?" assert filtered_questions[0] == "Who is on the basketball team?"
# ----------------------------------------------------------------------------------------------------
@pytest.mark.anyio
@pytest.mark.django_db(transaction=True)
async def test_use_text_response_mode(client_offline_chat):
# Arrange
user_query = "What's the latest in the Israel/Palestine conflict?"
# Act
mode = await aget_relevant_output_modes(user_query, {})
# Assert
assert mode.value == "text"
# ----------------------------------------------------------------------------------------------------
@pytest.mark.anyio
@pytest.mark.django_db(transaction=True)
async def test_use_image_response_mode(client_offline_chat):
# Arrange
user_query = "Paint a picture of the scenery in Timbuktu in the winter"
# Act
mode = await aget_relevant_output_modes(user_query, {})
# Assert
assert mode.value == "image"
# Helpers # Helpers
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
def populate_chat_history(message_list): def populate_chat_history(message_list):

View file

@ -9,7 +9,6 @@ from khoj.processor.conversation.openai.gpt import converse, extract_questions
from khoj.processor.conversation.utils import message_to_log from khoj.processor.conversation.utils import message_to_log
from khoj.routers.helpers import ( from khoj.routers.helpers import (
aget_relevant_information_sources, aget_relevant_information_sources,
aget_relevant_output_modes,
generate_online_subqueries, generate_online_subqueries,
infer_webpage_urls, infer_webpage_urls,
schedule_query, schedule_query,
@ -524,26 +523,6 @@ async def test_websearch_khoj_website_for_info_about_khoj(chat_client, default_u
), "Expected search query to include site:khoj.dev but got: " + str(responses) ), "Expected search query to include site:khoj.dev but got: " + str(responses)
# ----------------------------------------------------------------------------------------------------
@pytest.mark.anyio
@pytest.mark.django_db(transaction=True)
@pytest.mark.parametrize(
"user_query, expected_mode",
[
("What's the latest in the Israel/Palestine conflict?", "text"),
("Summarize the latest tech news every Monday evening", "automation"),
("Paint a scenery in Timbuktu in the winter", "image"),
("Remind me, when did I last visit the Serengeti?", "text"),
],
)
async def test_use_default_response_mode(chat_client, user_query, expected_mode):
# Act
mode = await aget_relevant_output_modes(user_query, {})
# Assert
assert mode.value == expected_mode
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
@pytest.mark.anyio @pytest.mark.anyio
@pytest.mark.django_db(transaction=True) @pytest.mark.django_db(transaction=True)