mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-27 20:38:32 +02:00
more renaming
This commit is contained in:
committed by
Evan Lohn
parent
4b82440915
commit
8af4f1da8e
@@ -2,9 +2,6 @@ from langgraph.graph import END
|
||||
from langgraph.graph import START
|
||||
from langgraph.graph import StateGraph
|
||||
|
||||
from onyx.agents.agent_search.deep_search_a.initial.consolidate_sub_answers.graph_builder import (
|
||||
consolidate_sub_answers_graph_builder,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_initial_answer.nodes.generate_initial_answer import (
|
||||
generate_initial_answer,
|
||||
)
|
||||
@@ -17,6 +14,9 @@ from onyx.agents.agent_search.deep_search_a.initial.generate_initial_answer.stat
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_initial_answer.states import (
|
||||
SearchSQState,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_sub_answers.graph_builder import (
|
||||
generate_sub_answers_graph_builder,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.retrieve_orig_question_docs.graph_builder import (
|
||||
retrieve_orig_question_docs_graph_builder,
|
||||
)
|
||||
@@ -31,15 +31,15 @@ def generate_initial_answer_graph_builder(test_mode: bool = False) -> StateGraph
|
||||
input=SearchSQInput,
|
||||
)
|
||||
|
||||
consolidate_sub_answers = consolidate_sub_answers_graph_builder().compile()
|
||||
generate_sub_answers = generate_sub_answers_graph_builder().compile()
|
||||
graph.add_node(
|
||||
node="consolidate_sub_answers_subgraph",
|
||||
action=consolidate_sub_answers,
|
||||
node="generate_sub_answers_subgraph",
|
||||
action=generate_sub_answers,
|
||||
)
|
||||
|
||||
retrieve_orig_question_docs = retrieve_orig_question_docs_graph_builder().compile()
|
||||
graph.add_node(
|
||||
node="retrieve_orig_question_docs_subgraph",
|
||||
node="retrieve_orig_question_docs_subgraph_wrapper",
|
||||
action=retrieve_orig_question_docs,
|
||||
)
|
||||
|
||||
@@ -62,18 +62,18 @@ def generate_initial_answer_graph_builder(test_mode: bool = False) -> StateGraph
|
||||
|
||||
graph.add_edge(
|
||||
start_key=START,
|
||||
end_key="retrieve_orig_question_docs_subgraph",
|
||||
end_key="retrieve_orig_question_docs_subgraph_wrapper",
|
||||
)
|
||||
|
||||
graph.add_edge(
|
||||
start_key=START,
|
||||
end_key="consolidate_sub_answers_subgraph",
|
||||
end_key="generate_sub_answers_subgraph",
|
||||
)
|
||||
|
||||
graph.add_edge(
|
||||
start_key=[
|
||||
"retrieve_orig_question_docs_subgraph",
|
||||
"consolidate_sub_answers_subgraph",
|
||||
"retrieve_orig_question_docs_subgraph_wrapper",
|
||||
"generate_sub_answers_subgraph",
|
||||
],
|
||||
end_key="generate_initial_answer",
|
||||
)
|
||||
|
@@ -32,7 +32,7 @@ def parallelize_initial_sub_question_answering(
|
||||
|
||||
return [
|
||||
Send(
|
||||
"answer_sub_question_subgraph",
|
||||
"answer_sub_question_subgraphs",
|
||||
AnswerQuestionInput(
|
||||
question=question,
|
||||
question_id=make_question_id(0, question_nr + 1),
|
@@ -2,24 +2,24 @@ from langgraph.graph import END
|
||||
from langgraph.graph import START
|
||||
from langgraph.graph import StateGraph
|
||||
|
||||
from onyx.agents.agent_search.deep_search_a.initial.consolidate_sub_answers.edges import (
|
||||
parallelize_initial_sub_question_answering,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.consolidate_sub_answers.nodes.decompose_orig_question import (
|
||||
decompose_orig_question,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.consolidate_sub_answers.nodes.format_initial_sub_answers import (
|
||||
format_initial_sub_answers,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.consolidate_sub_answers.states import (
|
||||
SQInput,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.consolidate_sub_answers.states import (
|
||||
SQState,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_individual_sub_answer.graph_builder import (
|
||||
answer_query_graph_builder,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_sub_answers.edges import (
|
||||
parallelize_initial_sub_question_answering,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_sub_answers.nodes.decompose_orig_question import (
|
||||
decompose_orig_question,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_sub_answers.nodes.format_initial_sub_answers import (
|
||||
format_initial_sub_answers,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_sub_answers.states import (
|
||||
SQInput,
|
||||
)
|
||||
from onyx.agents.agent_search.deep_search_a.initial.generate_sub_answers.states import (
|
||||
SQState,
|
||||
)
|
||||
from onyx.utils.logger import setup_logger
|
||||
|
||||
logger = setup_logger()
|
||||
@@ -27,7 +27,7 @@ logger = setup_logger()
|
||||
test_mode = False
|
||||
|
||||
|
||||
def consolidate_sub_answers_graph_builder() -> StateGraph:
|
||||
def generate_sub_answers_graph_builder() -> StateGraph:
|
||||
graph = StateGraph(
|
||||
state_schema=SQState,
|
||||
input=SQInput,
|
||||
@@ -37,10 +37,10 @@ def consolidate_sub_answers_graph_builder() -> StateGraph:
|
||||
node="decompose_orig_question",
|
||||
action=decompose_orig_question,
|
||||
)
|
||||
answer_sub_question_subgraph = answer_query_graph_builder().compile()
|
||||
answer_sub_question_subgraphs = answer_query_graph_builder().compile()
|
||||
graph.add_node(
|
||||
node="answer_sub_question_subgraph",
|
||||
action=answer_sub_question_subgraph,
|
||||
node="answer_sub_question_subgraphs",
|
||||
action=answer_sub_question_subgraphs,
|
||||
)
|
||||
|
||||
graph.add_node(
|
||||
@@ -75,10 +75,10 @@ def consolidate_sub_answers_graph_builder() -> StateGraph:
|
||||
graph.add_conditional_edges(
|
||||
source="decompose_orig_question",
|
||||
path=parallelize_initial_sub_question_answering,
|
||||
path_map=["answer_sub_question_subgraph"],
|
||||
path_map=["answer_sub_question_subgraphs"],
|
||||
)
|
||||
graph.add_edge(
|
||||
start_key="answer_sub_question_subgraph",
|
||||
start_key=["answer_sub_question_subgraphs"],
|
||||
end_key="format_initial_sub_question_answers",
|
||||
)
|
||||
|
@@ -38,7 +38,7 @@ def retrieve_orig_question_docs_graph_builder() -> StateGraph:
|
||||
|
||||
expanded_retrieval = expanded_retrieval_graph_builder().compile()
|
||||
graph.add_node(
|
||||
node="expanded_retrieval_base_search",
|
||||
node="retrieve_orig_question_docs_subgraph",
|
||||
action=expanded_retrieval,
|
||||
)
|
||||
graph.add_node(
|
||||
@@ -52,10 +52,10 @@ def retrieve_orig_question_docs_graph_builder() -> StateGraph:
|
||||
|
||||
graph.add_edge(
|
||||
start_key="format_orig_question_search_input",
|
||||
end_key="expanded_retrieval_base_search",
|
||||
end_key="retrieve_orig_question_docs_subgraph",
|
||||
)
|
||||
graph.add_edge(
|
||||
start_key="expanded_retrieval_base_search",
|
||||
start_key="retrieve_orig_question_docs_subgraph",
|
||||
end_key="format_orig_question_search_output",
|
||||
)
|
||||
|
||||
|
@@ -204,7 +204,7 @@ def run_basic_graph(
|
||||
if __name__ == "__main__":
|
||||
from onyx.llm.factory import get_default_llms
|
||||
|
||||
for _ in range(1):
|
||||
for _ in range(2):
|
||||
now_start = datetime.now()
|
||||
logger.debug(f"Start at {now_start}")
|
||||
graph = main_graph_builder_a()
|
||||
|
Reference in New Issue
Block a user