mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 21:05:17 +02:00
fix rebase issue
This commit is contained in:
@@ -26,7 +26,6 @@ from onyx.chat.models import StreamStopInfo
|
|||||||
from onyx.chat.models import SubQueryPiece
|
from onyx.chat.models import SubQueryPiece
|
||||||
from onyx.chat.models import SubQuestionPiece
|
from onyx.chat.models import SubQuestionPiece
|
||||||
from onyx.chat.models import ToolResponse
|
from onyx.chat.models import ToolResponse
|
||||||
from onyx.configs.agent_configs import GRAPH_VERSION_NAME
|
|
||||||
from onyx.context.search.models import SearchRequest
|
from onyx.context.search.models import SearchRequest
|
||||||
from onyx.db.engine import get_session_context_manager
|
from onyx.db.engine import get_session_context_manager
|
||||||
from onyx.tools.tool_runner import ToolCallKickoff
|
from onyx.tools.tool_runner import ToolCallKickoff
|
||||||
@@ -194,37 +193,8 @@ if __name__ == "__main__":
|
|||||||
for _ in range(1):
|
for _ in range(1):
|
||||||
now_start = datetime.now()
|
now_start = datetime.now()
|
||||||
logger.debug(f"Start at {now_start}")
|
logger.debug(f"Start at {now_start}")
|
||||||
|
graph = main_graph_builder_a()
|
||||||
graph = main_graph_builder_a()
|
compiled_graph = graph.compile()
|
||||||
now_start = datetime.now()
|
|
||||||
compiled_graph = graph.compile()
|
|
||||||
now_end = datetime.now()
|
|
||||||
logger.debug(f"Graph compiled in {now_end - now_start} seconds")
|
|
||||||
primary_llm, fast_llm = get_default_llms()
|
|
||||||
search_request = SearchRequest(
|
|
||||||
# query="what can you do with gitlab?",
|
|
||||||
# query="What are the guiding principles behind the development of cockroachDB",
|
|
||||||
# query="What are the temperatures in Munich, Hawaii, and New York?",
|
|
||||||
# query="When was Washington born?",
|
|
||||||
# query="What is Onyx?",
|
|
||||||
# query="What is the difference between astronomy and astrology?",
|
|
||||||
query="Do a search to tell me what is the difference between astronomy and astrology?",
|
|
||||||
)
|
|
||||||
# Joachim custom persona
|
|
||||||
|
|
||||||
with get_session_context_manager() as db_session:
|
|
||||||
config, search_tool = get_test_config(
|
|
||||||
db_session, primary_llm, fast_llm, search_request
|
|
||||||
)
|
|
||||||
# search_request.persona = get_persona_by_id(1, None, db_session)
|
|
||||||
config.use_agentic_persistence = True
|
|
||||||
# config.perform_initial_search_path_decision = False
|
|
||||||
config.perform_initial_search_decomposition = True
|
|
||||||
|
|
||||||
input = MainInput_a(
|
|
||||||
base_question=config.search_request.query, log_messages=[]
|
|
||||||
)
|
|
||||||
|
|
||||||
now_end = datetime.now()
|
now_end = datetime.now()
|
||||||
logger.debug(f"Graph compiled in {now_end - now_start} seconds")
|
logger.debug(f"Graph compiled in {now_end - now_start} seconds")
|
||||||
primary_llm, fast_llm = get_default_llms()
|
primary_llm, fast_llm = get_default_llms()
|
||||||
@@ -235,7 +205,7 @@ if __name__ == "__main__":
|
|||||||
# query="When was Washington born?",
|
# query="When was Washington born?",
|
||||||
# query="What is Onyx?",
|
# query="What is Onyx?",
|
||||||
# query="What is the difference between astronomy and astrology?",
|
# query="What is the difference between astronomy and astrology?",
|
||||||
query="Do a search to tell me hat is the difference between astronomy and astrology?",
|
query="Do a search to tell me what is the difference between astronomy and astrology?",
|
||||||
)
|
)
|
||||||
# Joachim custom persona
|
# Joachim custom persona
|
||||||
|
|
||||||
@@ -247,14 +217,10 @@ if __name__ == "__main__":
|
|||||||
config.use_agentic_persistence = True
|
config.use_agentic_persistence = True
|
||||||
# config.perform_initial_search_path_decision = False
|
# config.perform_initial_search_path_decision = False
|
||||||
config.perform_initial_search_decomposition = True
|
config.perform_initial_search_decomposition = True
|
||||||
if GRAPH_VERSION_NAME == "a":
|
input = MainInput_a(
|
||||||
input = MainInput_a(
|
base_question=config.search_request.query, log_messages=[]
|
||||||
base_question=config.search_request.query, log_messages=[]
|
)
|
||||||
)
|
|
||||||
else:
|
|
||||||
input = MainInput_a(
|
|
||||||
base_question=config.search_request.query, log_messages=[]
|
|
||||||
)
|
|
||||||
# with open("output.txt", "w") as f:
|
# with open("output.txt", "w") as f:
|
||||||
tool_responses: list = []
|
tool_responses: list = []
|
||||||
for output in run_graph(compiled_graph, config, input):
|
for output in run_graph(compiled_graph, config, input):
|
||||||
@@ -293,6 +259,3 @@ if __name__ == "__main__":
|
|||||||
logger.info(
|
logger.info(
|
||||||
f" ---------- RE {output.refined_answer_improvement} | "
|
f" ---------- RE {output.refined_answer_improvement} | "
|
||||||
)
|
)
|
||||||
|
|
||||||
# for tool_response in tool_responses:
|
|
||||||
# logger.debug(tool_response)
|
|
||||||
|
Reference in New Issue
Block a user