Skip to content

Commit bbe1c18

Browse files
feat: enabling workflows without rewriting step (#3549)
# Description Enabling workflows without a rewriting step ## Screenshots (if appropriate):
1 parent 9681a9e commit bbe1c18

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/quivr_core/rag/quivr_rag_langgraph.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,11 @@ async def retrieve(self, state: AgentState) -> AgentState:
615615
Returns:
616616
dict: The retrieved chunks
617617
"""
618+
if "tasks" in state:
619+
tasks = state["tasks"]
620+
else:
621+
tasks = UserTasks([state["messages"][0].content])
618622

619-
tasks = state["tasks"]
620623
if not tasks.has_tasks():
621624
return {**state}
622625

@@ -670,7 +673,11 @@ async def dynamic_retrieve(self, state: AgentState) -> AgentState:
670673

671674
MAX_ITERATIONS = 3
672675

673-
tasks = state["tasks"]
676+
if "tasks" in state:
677+
tasks = state["tasks"]
678+
else:
679+
tasks = UserTasks([state["messages"][0].content])
680+
674681
if not tasks or not tasks.has_tasks():
675682
return {**state}
676683

0 commit comments

Comments
 (0)