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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user