llm_ticket3/agents/base_agent.py
2025-04-06 15:02:20 +02:00

23 lines
605 B
Python

from abc import ABC, abstractmethod
from typing import List, Dict, Any
class BaseAgent(ABC):
"""
Classe de base pour les agents.
"""
def __init__(self, nom: str, llm: Any):
self.nom = nom
self.llm = llm
self.historique: List[Dict[str, Any]] = []
def ajouter_historique(self, action: str, input_data: Any, output_data: Any):
self.historique.append({
"action": action,
"input": input_data,
"output": output_data
})
@abstractmethod
def executer(self, *args, **kwargs) -> Any:
pass