Minimal Viable Product

C'est moche, bancal, et mal foutu, mais ça compile et ça crache un rapport de stage dans un fichier
This commit is contained in:
2026-02-06 17:46:00 +01:00
parent 1c2f0728ea
commit 633726b2a0
6 changed files with 18 additions and 14 deletions

View File

@@ -53,6 +53,8 @@ def task_ended(state: MessagesState):
return END
return "continue"
tool_node = ToolNode(tools=getTools())
class BasicToolNode: # De mon ancien projet, https://github.com/LJ5O/Assistant/blob/main/modules/Brain/src/LLM/graph/nodes/BasicToolNode.py
"""A node that runs the tools requested in the last AIMessage."""

View File

@@ -48,13 +48,13 @@ def write_file(file_path:str, content: str, append:bool=True) -> str:
return f"Erreur lors de l'écriture: {str(e)}"
@tool
def editTodo(index:int, state:int, state: Annotated[dict, InjectedState])->bool: # https://stackoverflow.com/a/79525434
def editTodo(index:int, todoState:int, state: Annotated[dict, InjectedState])->bool: # https://stackoverflow.com/a/79525434
"""
Modifier l'état d'une tâche (TODO)
Args:
index (int): Index de la tâche à modifier, en commançant à 0 pour la première tâche.
state (int): Nouvel état. 0 pour "non commencé, 1 pour "en cours", 2 pour "complété"
todoState (int): Nouvel état. 0 pour "non commencé, 1 pour "en cours", 2 pour "complété"
Returns:
bool: Réussite de l'opération, ou non.
@@ -63,7 +63,7 @@ def editTodo(index:int, state:int, state: Annotated[dict, InjectedState])->bool:
# Erreur, l'index est trop grand
return False
state["todo"][index].state = state # Modification de l'état de cette tâche
state["todo"][index].state = todoState # Modification de l'état de cette tâche
# Toutes les tâches complétées ?
found = False
@@ -168,9 +168,9 @@ def search_in_files(query:str, state: Annotated[dict, InjectedState])->str:
Returns:
str: Échantillons de documents correspondants, concaténés en une seule chaîne de caractères.
"""
bdd = VectorDatabase() # Récupère l'unique instance de cette BDD, c'est un SIngleton
bdd = VectorDatabase.getChroma() # Récupère l'unique instance de cette BDD, c'est un SIngleton
retrieved_docs = bdd.getChroma().similarity_search(query, k=5) # 5 documents
retrieved_docs = bdd.similarity_search(query, k=5) # 5 documents
# Conversion des documents en texte
docs_content = "\n".join(