2026-06-12 18:16:58 +02:00
|
|
|
from app.graph.workflow import compiled_graph
|
2026-06-22 15:55:59 +02:00
|
|
|
from app.repositories.qdrant_repository import QdrantRepository
|
2026-06-12 18:16:58 +02:00
|
|
|
|
2026-06-22 15:55:59 +02:00
|
|
|
async def run_arc_workflow(state_data: dict, qdrant_repo: QdrantRepository) -> dict:
|
2026-06-16 11:27:41 +02:00
|
|
|
"""
|
|
|
|
|
Prend le state actuel (provenant de l'API/Chainlit),
|
|
|
|
|
exécute le graphe jusqu'au prochain point d'arrêt (END),
|
|
|
|
|
et retourne le state mis à jour.
|
|
|
|
|
"""
|
2026-06-22 15:55:59 +02:00
|
|
|
final_state = await compiled_graph.ainvoke(state_data, config={"configurable": {"qdrant_repo": qdrant_repo}})
|
2026-06-16 11:27:41 +02:00
|
|
|
|
|
|
|
|
return dict(final_state)
|