Files
Projet-Agent-IA/AgentReact/utils/state.py
LJ5O 2da71f8c51 Continuer la conversation
Permet de maintenir la conversation au lieu de la stopper après un message sans outils
2026-02-12 09:57:06 +01:00

25 lines
779 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from langgraph.graph import StateGraph, MessagesState
from typing import List
class CustomState(MessagesState):
todo: List[str] # Les tâches en cours, au format JSON
ragQuery: str # Requête envoyée au RAG, pour le cross-encodeur
ragDocuments: List[str] # Documents retrouvés par le RAG, pour le cross-encodeur
lastSummarizedMessage: int # Index du message où l'on s'était arrêté de résumer
stop: bool # Permet d'indiquer la fin de l'exécution de l'agent
# TODO: Ajouter la source des documents sélectionnés pour la fin du rapport ?
def getState()->StateGraph:
"""
Retourne un StateGraph prêt à utiliser pour préparer un workflow
Returns:
StateGraph: prêt à utiliser
"""
return StateGraph(CustomState)