Continuer la conversation

Permet de maintenir la conversation au lieu de la stopper après un message sans outils
This commit is contained in:
2026-02-12 09:57:06 +01:00
parent dbd2eb38da
commit 2da71f8c51
5 changed files with 13 additions and 4 deletions

View File

@@ -36,7 +36,10 @@ def getGraph()->CompiledStateGraph:
"no_tools":"context_shortener" # FIN de la préparation, on réduit le contexte avant de passer à la suite
})
workflow.add_edge("context_shortener", "user_prompt") # Et ici, je rejoins la partie principale qui rédigera le rapport
workflow.add_edge("user_prompt", "LLM_central")
workflow.add_conditional_edges("user_prompt", lambda state: END if state['stop'] else "continue", {
END: END,
"continue": "LLM_central"
})
workflow.add_edge("weekly_report_tools", "preparation_docs")
workflow.add_conditional_edges("tool_node", should_shorten, {
@@ -46,7 +49,7 @@ def getGraph()->CompiledStateGraph:
workflow.add_edge("context_shortener_2", "LLM_central")
workflow.add_conditional_edges("LLM_central", should_continue, {
"tools":"tool_node",
"no_tools":END
"no_tools":"user_prompt"
})
return workflow.compile(checkpointer=InMemorySaver()) # TODO: Rempalcer par une vrai BDD de prod