mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-11 00:20:55 +02:00
fixed rebase issue and some cleanup
This commit is contained in:
parent
b500c914b0
commit
b928201397
@ -1,7 +1,7 @@
|
|||||||
"""agent_tracking
|
"""agent_tracking
|
||||||
|
|
||||||
Revision ID: 98a5008d8711
|
Revision ID: 98a5008d8711
|
||||||
Revises: 33ea50e88f24
|
Revises: 2f80c6a2550f
|
||||||
Create Date: 2025-01-29 17:00:00.000001
|
Create Date: 2025-01-29 17:00:00.000001
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -12,7 +12,7 @@ from sqlalchemy.dialects.postgresql import UUID
|
|||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = "98a5008d8711"
|
revision = "98a5008d8711"
|
||||||
down_revision = "33ea50e88f24"
|
down_revision = "2f80c6a2550f"
|
||||||
branch_labels = None
|
branch_labels = None
|
||||||
depends_on = None
|
depends_on = None
|
||||||
|
|
||||||
|
@ -133,7 +133,5 @@ if __name__ == "__main__":
|
|||||||
for thing in compiled_graph.stream(
|
for thing in compiled_graph.stream(
|
||||||
input=inputs,
|
input=inputs,
|
||||||
config={"configurable": {"config": graph_config}},
|
config={"configurable": {"config": graph_config}},
|
||||||
# debug=True,
|
|
||||||
# subgraphs=True,
|
|
||||||
):
|
):
|
||||||
logger.debug(thing)
|
logger.debug(thing)
|
||||||
|
@ -204,12 +204,12 @@ def main_graph_builder(test_mode: bool = False) -> StateGraph:
|
|||||||
)
|
)
|
||||||
|
|
||||||
graph.add_conditional_edges(
|
graph.add_conditional_edges(
|
||||||
source="create_refined_sub_questions", # DONE
|
source="create_refined_sub_questions",
|
||||||
path=parallelize_refined_sub_question_answering,
|
path=parallelize_refined_sub_question_answering,
|
||||||
path_map=["answer_refined_question_subgraphs"],
|
path_map=["answer_refined_question_subgraphs"],
|
||||||
)
|
)
|
||||||
graph.add_edge(
|
graph.add_edge(
|
||||||
start_key="answer_refined_question_subgraphs", # HERE
|
start_key="answer_refined_question_subgraphs",
|
||||||
end_key="ingest_refined_sub_answers",
|
end_key="ingest_refined_sub_answers",
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -259,8 +259,7 @@ if __name__ == "__main__":
|
|||||||
for thing in compiled_graph.stream(
|
for thing in compiled_graph.stream(
|
||||||
input=inputs,
|
input=inputs,
|
||||||
config={"configurable": {"config": graph_config}},
|
config={"configurable": {"config": graph_config}},
|
||||||
# stream_mode="debug",
|
stream_mode="custom",
|
||||||
# debug=True,
|
|
||||||
subgraphs=True,
|
subgraphs=True,
|
||||||
):
|
):
|
||||||
logger.debug(thing)
|
logger.debug(thing)
|
||||||
|
@ -261,10 +261,6 @@ def generate_refined_answer(
|
|||||||
response = merge_content(*streamed_tokens)
|
response = merge_content(*streamed_tokens)
|
||||||
answer = cast(str, response)
|
answer = cast(str, response)
|
||||||
|
|
||||||
# refined_agent_stats = _calculate_refined_agent_stats(
|
|
||||||
# state.decomp_answer_results, state.original_question_retrieval_stats
|
|
||||||
# )
|
|
||||||
|
|
||||||
refined_agent_stats = RefinedAgentStats(
|
refined_agent_stats = RefinedAgentStats(
|
||||||
revision_doc_efficiency=refined_doc_effectiveness,
|
revision_doc_efficiency=refined_doc_effectiveness,
|
||||||
revision_question_efficiency=revision_question_efficiency,
|
revision_question_efficiency=revision_question_efficiency,
|
||||||
|
@ -70,11 +70,6 @@ class InitialRefinedAnswerComparisonUpdate(LoggerUpdate):
|
|||||||
refined_answer_improvement_eval: bool = False
|
refined_answer_improvement_eval: bool = False
|
||||||
|
|
||||||
|
|
||||||
# Not used in current graph
|
|
||||||
class InitialAnswerBASEUpdate(BaseModel):
|
|
||||||
initial_base_answer: str | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class InitialAnswerUpdate(LoggerUpdate):
|
class InitialAnswerUpdate(LoggerUpdate):
|
||||||
"""
|
"""
|
||||||
Initial answer information
|
Initial answer information
|
||||||
@ -157,7 +152,6 @@ class MainState(
|
|||||||
ToolChoiceUpdate,
|
ToolChoiceUpdate,
|
||||||
InitialQuestionDecompositionUpdate,
|
InitialQuestionDecompositionUpdate,
|
||||||
InitialAnswerUpdate,
|
InitialAnswerUpdate,
|
||||||
InitialAnswerBASEUpdate,
|
|
||||||
SubQuestionResultsUpdate,
|
SubQuestionResultsUpdate,
|
||||||
OrigQuestionRetrievalUpdate,
|
OrigQuestionRetrievalUpdate,
|
||||||
EntityTermExtractionUpdate,
|
EntityTermExtractionUpdate,
|
||||||
|
@ -127,9 +127,6 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
for thing in compiled_graph.stream(
|
for thing in compiled_graph.stream(
|
||||||
input=inputs,
|
input=inputs,
|
||||||
# debug=True,
|
stream_mode="custom",
|
||||||
# subgraphs=True,
|
|
||||||
):
|
):
|
||||||
logger.debug(thing)
|
logger.debug(thing)
|
||||||
# output = compiled_graph.invoke(inputs)
|
|
||||||
# logger.debug(output)
|
|
||||||
|
@ -155,7 +155,7 @@ if __name__ == "__main__":
|
|||||||
for thing in compiled_graph.stream(
|
for thing in compiled_graph.stream(
|
||||||
input=inputs,
|
input=inputs,
|
||||||
config={"configurable": {"config": graph_config}},
|
config={"configurable": {"config": graph_config}},
|
||||||
# debug=True,
|
stream_mode="custom",
|
||||||
subgraphs=True,
|
subgraphs=True,
|
||||||
):
|
):
|
||||||
logger.debug(thing)
|
logger.debug(thing)
|
||||||
|
@ -162,7 +162,6 @@ if __name__ == "__main__":
|
|||||||
# 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 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:
|
with get_session_context_manager() as db_session:
|
||||||
config = get_test_config(db_session, primary_llm, fast_llm, search_request)
|
config = get_test_config(db_session, primary_llm, fast_llm, search_request)
|
||||||
@ -177,11 +176,8 @@ if __name__ == "__main__":
|
|||||||
base_question=config.inputs.search_request.query, log_messages=[]
|
base_question=config.inputs.search_request.query, log_messages=[]
|
||||||
)
|
)
|
||||||
|
|
||||||
# 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):
|
||||||
# pass
|
|
||||||
|
|
||||||
if isinstance(output, ToolCallKickoff):
|
if isinstance(output, ToolCallKickoff):
|
||||||
pass
|
pass
|
||||||
elif isinstance(output, ExtendedToolResponse):
|
elif isinstance(output, ExtendedToolResponse):
|
||||||
|
@ -129,6 +129,7 @@ const SortableAssistant: React.FC<SortableAssistantProps> = ({
|
|||||||
className="w-3 ml-[2px] mr-[2px] group-hover:visible invisible flex-none cursor-grab"
|
className="w-3 ml-[2px] mr-[2px] group-hover:visible invisible flex-none cursor-grab"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
|
data-testid={`assistant-[${assistant.id}]`}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!isDragging) {
|
if (!isDragging) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user