mirror of
https://github.com/Ladebeze66/llm_ticket3.git
synced 2025-12-15 20:06:51 +01:00
15 lines
665 B
Python
15 lines
665 B
Python
from .base_agent import BaseAgent
|
|
from typing import Any
|
|
|
|
class AgentImageAnalyser(BaseAgent):
|
|
"""
|
|
Agent pour analyser les images et extraire les informations pertinentes.
|
|
"""
|
|
def __init__(self, llm):
|
|
super().__init__("AgentImageAnalyser", llm)
|
|
|
|
def executer(self, image_description: str, contexte: str) -> str:
|
|
prompt = f"Analyse cette image en tenant compte du contexte suivant : {contexte}. Description de l'image : {image_description}"
|
|
response = self.llm.interroger(prompt)
|
|
self.ajouter_historique("analyse_image", {"image": image_description, "contexte": contexte}, response)
|
|
return response |