Skip to content

Commit

Permalink
feat: enabling workflows without rewriting step
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopo-chevallard committed Jan 20, 2025
1 parent 9681a9e commit 162e63c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/quivr_core/rag/quivr_rag_langgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,11 @@ async def retrieve(self, state: AgentState) -> AgentState:
Returns:
dict: The retrieved chunks
"""
if "tasks" in state:
tasks = state["tasks"]
else:
tasks = UserTasks([state["messages"][0].content])

tasks = state["tasks"]
if not tasks.has_tasks():
return {**state}

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

MAX_ITERATIONS = 3

tasks = state["tasks"]
if "tasks" in state:
tasks = state["tasks"]
else:
tasks = UserTasks([state["messages"][0].content])

if not tasks or not tasks.has_tasks():
return {**state}

Expand Down

0 comments on commit 162e63c

Please sign in to comment.