mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
When diagram generation fails, save to conversation log
- Update tool name when choosing tools to execute
This commit is contained in:
@@ -8,7 +8,7 @@ from freezegun import freeze_time
|
||||
from khoj.database.models import Agent, Entry, KhojUser, LocalPdfConfig
|
||||
from khoj.processor.conversation import prompts
|
||||
from khoj.processor.conversation.utils import message_to_log
|
||||
from khoj.routers.helpers import aget_relevant_information_sources
|
||||
from khoj.routers.helpers import aget_relevant_tools_to_execute
|
||||
from tests.helpers import ConversationFactory
|
||||
|
||||
# Initialize variables for tests
|
||||
@@ -719,7 +719,7 @@ async def test_get_correct_tools_online(chat_client):
|
||||
user_query = "What's the weather in Patagonia this week?"
|
||||
|
||||
# Act
|
||||
tools = await aget_relevant_information_sources(user_query, {}, False, False)
|
||||
tools = await aget_relevant_tools_to_execute(user_query, {}, False, False)
|
||||
|
||||
# Assert
|
||||
tools = [tool.value for tool in tools]
|
||||
@@ -734,7 +734,7 @@ async def test_get_correct_tools_notes(chat_client):
|
||||
user_query = "Where did I go for my first battleship training?"
|
||||
|
||||
# Act
|
||||
tools = await aget_relevant_information_sources(user_query, {}, False, False)
|
||||
tools = await aget_relevant_tools_to_execute(user_query, {}, False, False)
|
||||
|
||||
# Assert
|
||||
tools = [tool.value for tool in tools]
|
||||
@@ -749,7 +749,7 @@ async def test_get_correct_tools_online_or_general_and_notes(chat_client):
|
||||
user_query = "What's the highest point in Patagonia and have I been there?"
|
||||
|
||||
# Act
|
||||
tools = await aget_relevant_information_sources(user_query, {}, False, False)
|
||||
tools = await aget_relevant_tools_to_execute(user_query, {}, False, False)
|
||||
|
||||
# Assert
|
||||
tools = [tool.value for tool in tools]
|
||||
@@ -766,7 +766,7 @@ async def test_get_correct_tools_general(chat_client):
|
||||
user_query = "How many noble gases are there?"
|
||||
|
||||
# Act
|
||||
tools = await aget_relevant_information_sources(user_query, {}, False, False)
|
||||
tools = await aget_relevant_tools_to_execute(user_query, {}, False, False)
|
||||
|
||||
# Assert
|
||||
tools = [tool.value for tool in tools]
|
||||
@@ -790,7 +790,7 @@ async def test_get_correct_tools_with_chat_history(chat_client):
|
||||
chat_history = generate_history(chat_log)
|
||||
|
||||
# Act
|
||||
tools = await aget_relevant_information_sources(user_query, chat_history, False, False)
|
||||
tools = await aget_relevant_tools_to_execute(user_query, chat_history, False, False)
|
||||
|
||||
# Assert
|
||||
tools = [tool.value for tool in tools]
|
||||
|
||||
Reference in New Issue
Block a user