mirror of
https://github.com/Ladebeze66/llm_ticket3.git
synced 2025-12-13 12:36:50 +01:00
2504-16:02
This commit is contained in:
parent
235e87018c
commit
794dec63e9
@ -295,9 +295,14 @@ Structure your analysis clearly with headers and bullet points.
|
|||||||
# Analyser l'image avec le LLM
|
# Analyser l'image avec le LLM
|
||||||
if not hasattr(self.llm, "interroger_avec_image"):
|
if not hasattr(self.llm, "interroger_avec_image"):
|
||||||
return self._erreur("Le modèle ne supporte pas l'analyse d'images", image_path)
|
return self._erreur("Le modèle ne supporte pas l'analyse d'images", image_path)
|
||||||
|
|
||||||
|
logger.info(f"[LANGUE] Envoi d'une requête en anglais au modèle avec une image: {os.path.basename(image_path)}")
|
||||||
|
logger.info(f"[LANGUE] Taille du prompt en anglais: {len(prompt)} caractères")
|
||||||
|
|
||||||
response = self.llm.interroger_avec_image(image_path, prompt)
|
response = self.llm.interroger_avec_image(image_path, prompt)
|
||||||
|
|
||||||
|
logger.info(f"[LANGUE] Réponse reçue du modèle en anglais: {len(response)} caractères")
|
||||||
|
|
||||||
if self._verifier_reponse_invalide(response):
|
if self._verifier_reponse_invalide(response):
|
||||||
return self._erreur("Réponse du modèle invalide", image_path, response)
|
return self._erreur("Réponse du modèle invalide", image_path, response)
|
||||||
|
|
||||||
@ -318,7 +323,10 @@ Structure your analysis clearly with headers and bullet points.
|
|||||||
|
|
||||||
|
|
||||||
# Traduire la réponse en français
|
# Traduire la réponse en français
|
||||||
|
logger.info(f"[TRADUCTION] Traduction de la réponse d'analyse d'image de EN vers FR")
|
||||||
|
logger.info(f"[TRADUCTION] Taille de la réponse en anglais: {len(response)} caractères")
|
||||||
response_fr = en_to_fr(response)
|
response_fr = en_to_fr(response)
|
||||||
|
logger.info(f"[TRADUCTION] Taille de la réponse traduite en français: {len(response_fr)} caractères")
|
||||||
|
|
||||||
# Construire le résultat
|
# Construire le résultat
|
||||||
result = {
|
result = {
|
||||||
@ -338,12 +346,14 @@ Structure your analysis clearly with headers and bullet points.
|
|||||||
# Extraire les URLs trouvées dans la réponse
|
# Extraire les URLs trouvées dans la réponse
|
||||||
urls = self._extraire_urls(response)
|
urls = self._extraire_urls(response)
|
||||||
if urls:
|
if urls:
|
||||||
|
logger.info(f"[ANALYSE] {len(urls)} URLs extraites de l'analyse: {urls}")
|
||||||
result["urls"] = urls
|
result["urls"] = urls
|
||||||
|
|
||||||
# Ajouter au collecteur de résultats
|
# Ajouter au collecteur de résultats
|
||||||
self.resultats.append(result)
|
self.resultats.append(result)
|
||||||
|
|
||||||
logger.debug(f"Résultat de l'analyse pour l'image {image_path}: {result}")
|
logger.debug(f"Résultat de l'analyse pour l'image {image_path}: {result}")
|
||||||
|
logger.info(f"[LANGUES] Résultat d'analyse disponible en deux langues: EN et FR")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@ -171,20 +171,30 @@ Stay strictly factual. Make no assumptions. Do not suggest steps or interpretati
|
|||||||
|
|
||||||
if need_translation:
|
if need_translation:
|
||||||
# Add explicit marker and translate prompt
|
# Add explicit marker and translate prompt
|
||||||
prompt_en = f"[ENGLISH RESPONSE REQUESTED]\n\n{fr_to_en(prompt)}"
|
logger.info(f"[LANGUE] Le modèle '{model_name}' nécessite une entrée en anglais")
|
||||||
logger.info(f"Translating prompt to English for LlamaVision ({len(prompt_en)} characters)")
|
logger.info(f"[TRADUCTION] Traduction du prompt FR → EN pour {ticket_id}")
|
||||||
|
logger.info(f"[TRADUCTION] Taille du prompt original en français: {len(prompt)} caractères")
|
||||||
|
translated_prompt = fr_to_en(prompt)
|
||||||
|
prompt_en = f"[ENGLISH RESPONSE REQUESTED]\n\n{translated_prompt}"
|
||||||
|
logger.info(f"[TRADUCTION] Taille du prompt traduit en anglais: {len(prompt_en)} caractères")
|
||||||
else:
|
else:
|
||||||
|
logger.info(f"[LANGUE] Le modèle '{model_name}' accepte une entrée en français, aucune traduction nécessaire")
|
||||||
prompt_en = prompt
|
prompt_en = prompt
|
||||||
|
|
||||||
print(f"Analysis in progress for ticket {ticket_id}...")
|
print(f"Analysis in progress for ticket {ticket_id}...")
|
||||||
|
logger.info(f"[LANGUE] Envoi du prompt {'en anglais' if need_translation else 'en français'} au modèle")
|
||||||
response = self.llm.interroger(prompt_en)
|
response = self.llm.interroger(prompt_en)
|
||||||
|
logger.info(f"[LANGUE] Réponse reçue du modèle {'en anglais' if need_translation else 'en français'}: {len(response)} caractères")
|
||||||
|
|
||||||
# Translate response to French if necessary
|
# Translate response to French if necessary
|
||||||
if need_translation:
|
if need_translation:
|
||||||
|
logger.info(f"[TRADUCTION] Traduction de la réponse EN → FR pour compatibilité")
|
||||||
|
logger.info(f"[TRADUCTION] Taille de la réponse originale en anglais: {len(response)} caractères")
|
||||||
response_fr = en_to_fr(response)
|
response_fr = en_to_fr(response)
|
||||||
logger.info(f"Translating response to French ({len(response_fr)} characters)")
|
logger.info(f"[TRADUCTION] Taille de la réponse traduite en français: {len(response_fr)} caractères")
|
||||||
else:
|
else:
|
||||||
response_fr = response
|
response_fr = response
|
||||||
|
logger.info(f"[LANGUE] La réponse est déjà en français, aucune traduction nécessaire")
|
||||||
|
|
||||||
print(f"Analysis completed: {len(response_fr)} characters")
|
print(f"Analysis completed: {len(response_fr)} characters")
|
||||||
logger.debug(f"Response received ({len(response_fr)} characters): {response_fr[:500]}...")
|
logger.debug(f"Response received ({len(response_fr)} characters): {response_fr[:500]}...")
|
||||||
@ -203,7 +213,8 @@ Stay strictly factual. Make no assumptions. Do not suggest steps or interpretati
|
|||||||
"model": getattr(self.llm, "modele", str(type(self.llm))),
|
"model": getattr(self.llm, "modele", str(type(self.llm))),
|
||||||
**getattr(self.llm, "params", {})
|
**getattr(self.llm, "params", {})
|
||||||
},
|
},
|
||||||
"language": "en-fr" if need_translation else "fr" # Indicates the language used
|
"language": "en-fr" if need_translation else "fr", # Indicates the language used
|
||||||
|
"is_translated": need_translation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -193,34 +193,44 @@ IMPORTANT: All responses should be in English. Translation to French will be han
|
|||||||
|
|
||||||
# Vérifier d'abord si content_en existe dans les données du ticket
|
# Vérifier d'abord si content_en existe dans les données du ticket
|
||||||
if "content_en" in ticket_data:
|
if "content_en" in ticket_data:
|
||||||
logger.info(f"Utilisation du contenu déjà traduit pour le ticket {ticket_id}")
|
logger.info(f"[LANGUE] Utilisation du contenu déjà traduit en anglais pour le ticket {ticket_id}")
|
||||||
ticket_content_en = ticket_data["content_en"]
|
ticket_content_en = ticket_data["content_en"]
|
||||||
is_translated = True
|
is_translated = True
|
||||||
# Si le contenu est déjà marqué comme étant en anglais
|
# Si le contenu est déjà marqué comme étant en anglais
|
||||||
elif ticket_data.get("is_english", False):
|
elif ticket_data.get("is_english", False):
|
||||||
logger.info(f"Le contenu est déjà en anglais pour le ticket {ticket_id}")
|
logger.info(f"[LANGUE] Le contenu du ticket {ticket_id} est déjà en anglais")
|
||||||
ticket_content_en = ticket_content
|
ticket_content_en = ticket_content
|
||||||
else:
|
else:
|
||||||
# Traduire le contenu en anglais pour l'analyse
|
# Traduire le contenu en anglais pour l'analyse
|
||||||
logger.info(f"Traduction du contenu du ticket {ticket_id} en anglais")
|
logger.info(f"[TRADUCTION] Nécessité de traduire le contenu du ticket {ticket_id} en anglais")
|
||||||
|
logger.info(f"[TRADUCTION] Taille du contenu original à traduire: {len(ticket_content)} caractères")
|
||||||
ticket_content_en = fr_to_en(ticket_content)
|
ticket_content_en = fr_to_en(ticket_content)
|
||||||
is_translated = True
|
is_translated = True
|
||||||
logger.info(f"Traduction terminée, {len(ticket_content_en)} caractères")
|
logger.info(f"[TRADUCTION] Traduction terminée, résultat: {len(ticket_content_en)} caractères")
|
||||||
|
|
||||||
# Générer le prompt d'analyse avec le contenu en anglais
|
# Générer le prompt d'analyse avec le contenu en anglais
|
||||||
|
logger.info(f"[LANGUE] Génération du prompt d'analyse en anglais")
|
||||||
prompt = self._generer_prompt({"ticket_id": ticket_id, "content": ticket_content_en})
|
prompt = self._generer_prompt({"ticket_id": ticket_id, "content": ticket_content_en})
|
||||||
|
logger.info(f"[LANGUE] Taille du prompt en anglais: {len(prompt)} caractères")
|
||||||
|
|
||||||
# Analyser avec le LLM
|
# Analyser avec le LLM
|
||||||
|
logger.info(f"[LANGUE] Envoi du prompt en anglais au modèle pour analyse du ticket {ticket_id}")
|
||||||
response_en = self.llm.interroger(prompt)
|
response_en = self.llm.interroger(prompt)
|
||||||
|
logger.info(f"[LANGUE] Réponse reçue du modèle en anglais: {len(response_en)} caractères")
|
||||||
|
|
||||||
# Extraire les URLs de la réponse
|
# Extraire les URLs de la réponse
|
||||||
urls = self._extraire_urls(response_en)
|
urls = self._extraire_urls(response_en)
|
||||||
|
if urls:
|
||||||
|
logger.info(f"[ANALYSE] {len(urls)} URLs extraites de l'analyse: {urls}")
|
||||||
|
|
||||||
# Ajouter un marqueur pour indiquer le début et la fin de l'analyse en anglais
|
# Ajouter un marqueur pour indiquer le début et la fin de l'analyse en anglais
|
||||||
response_en_marked = "<!-- ENGLISH ANALYSIS START -->\n\n" + response_en + "\n\n<!-- ENGLISH ANALYSIS END -->"
|
response_en_marked = "<!-- ENGLISH ANALYSIS START -->\n\n" + response_en + "\n\n<!-- ENGLISH ANALYSIS END -->"
|
||||||
|
|
||||||
# Traduire la réponse en français pour la cohérence du pipeline
|
# Traduire la réponse en français pour la cohérence du pipeline
|
||||||
|
logger.info(f"[TRADUCTION] Traduction de la réponse d'analyse du ticket de EN vers FR")
|
||||||
|
logger.info(f"[TRADUCTION] Taille de la réponse en anglais: {len(response_en)} caractères")
|
||||||
response_fr = en_to_fr(response_en)
|
response_fr = en_to_fr(response_en)
|
||||||
|
logger.info(f"[TRADUCTION] Taille de la réponse traduite en français: {len(response_fr)} caractères")
|
||||||
|
|
||||||
# Ajouter un marqueur pour indiquer le début et la fin de la traduction
|
# Ajouter un marqueur pour indiquer le début et la fin de la traduction
|
||||||
response_fr_marked = "<!-- FRENCH TRANSLATION START -->\n\n" + response_fr + "\n\n<!-- FRENCH TRANSLATION END -->"
|
response_fr_marked = "<!-- FRENCH TRANSLATION START -->\n\n" + response_fr + "\n\n<!-- FRENCH TRANSLATION END -->"
|
||||||
@ -246,6 +256,9 @@ IMPORTANT: All responses should be in English. Translation to French will be han
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info(f"[LANGUES] Résultat d'analyse disponible en deux langues: EN et FR")
|
||||||
|
logger.info(f"[LANGUES] Traduction du contenu original: {is_translated}")
|
||||||
|
|
||||||
# Sauvegarder les données avec un chemin explicite
|
# Sauvegarder les données avec un chemin explicite
|
||||||
try:
|
try:
|
||||||
# Déterminer le répertoire ticket
|
# Déterminer le répertoire ticket
|
||||||
|
|||||||
@ -1,22 +1,22 @@
|
|||||||
2025-04-25 15:37:04,816 - MainLlamaVision - INFO - Initialisation du modèle LlamaVision: llama3.2-vision:90b-instruct-q8_0
|
2025-04-25 15:52:49,079 - MainLlamaVision - INFO - Initialisation du modèle LlamaVision: llama3.2-vision:90b-instruct-q8_0
|
||||||
2025-04-25 15:37:04,816 - LlamaVision - INFO - Initializing LlamaVision with model llama3.2-vision:90b-instruct-q8_0 (English-only mode)
|
2025-04-25 15:52:49,079 - LlamaVision - INFO - Initializing LlamaVision with model llama3.2-vision:90b-instruct-q8_0 (English-only mode)
|
||||||
2025-04-25 15:37:04,816 - MainLlamaVision - INFO - Nom normalisé du modèle: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 15:52:49,079 - MainLlamaVision - INFO - Nom normalisé du modèle: llama3-2-vision-90b-instruct-q8-0
|
||||||
2025-04-25 15:37:04,816 - MainLlamaVision - INFO - Création des agents avec LlamaVision
|
2025-04-25 15:52:49,079 - MainLlamaVision - INFO - Création des agents avec LlamaVision
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Création de tous les agents avec instances LLM indépendantes (modèle: llama3.2-vision:90b-instruct-q8_0)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Création de tous les agents avec instances LLM indépendantes (modèle: llama3.2-vision:90b-instruct-q8_0)
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Initialisation du modèle llama_vision (modèle: llama3.2-vision:90b-instruct-q8_0)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Initialisation du modèle llama_vision (modèle: llama3.2-vision:90b-instruct-q8_0)
|
||||||
2025-04-25 15:37:04,816 - LlamaVision - INFO - Initializing LlamaVision with model llama3.2-vision:90b-instruct-q8_0 (English-only mode)
|
2025-04-25 15:52:49,079 - LlamaVision - INFO - Initializing LlamaVision with model llama3.2-vision:90b-instruct-q8_0 (English-only mode)
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Création de l'agent de tickets (llama_vision)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Création de l'agent de tickets (llama_vision)
|
||||||
2025-04-25 15:37:04,816 - AgentTicketAnalyser - INFO - AgentTicketAnalyser initialisé
|
2025-04-25 15:52:49,079 - AgentTicketAnalyser - INFO - AgentTicketAnalyser initialisé
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Création de l'agent de tri des images (llama_vision)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Création de l'agent de tri des images (llama_vision)
|
||||||
2025-04-25 15:37:04,816 - AgentImageSorter - INFO - AgentImageSorter (llama_vision) initialisé
|
2025-04-25 15:52:49,079 - AgentImageSorter - INFO - AgentImageSorter (llama_vision) initialisé
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Création de l'agent d'analyse des images (llama_vision)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Création de l'agent d'analyse des images (llama_vision)
|
||||||
2025-04-25 15:37:04,816 - AgentImageAnalyser - INFO - AgentImageAnalyser initialized
|
2025-04-25 15:52:49,079 - AgentImageAnalyser - INFO - AgentImageAnalyser initialized
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Création de l'agent de génération de rapports (llama_vision)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Création de l'agent de génération de rapports (llama_vision)
|
||||||
2025-04-25 15:37:04,816 - AgentReportGenerator - INFO - LlamaVision mode detected: using English system prompt
|
2025-04-25 15:52:49,079 - AgentReportGenerator - INFO - LlamaVision mode detected: using English system prompt
|
||||||
2025-04-25 15:37:04,816 - AgentReportGenerator - INFO - AgentReportGenerator initialized
|
2025-04-25 15:52:49,079 - AgentReportGenerator - INFO - AgentReportGenerator initialized
|
||||||
2025-04-25 15:37:04,816 - AgentFactoryLlamaVision - INFO - Création de l'agent d'OCR visuel (llama_vision)
|
2025-04-25 15:52:49,079 - AgentFactoryLlamaVision - INFO - Création de l'agent d'OCR visuel (llama_vision)
|
||||||
2025-04-25 15:37:04,816 - AgentVisionOCR - INFO - AgentVisionOCR initialisé
|
2025-04-25 15:52:49,079 - AgentVisionOCR - INFO - AgentVisionOCR initialisé
|
||||||
2025-04-25 15:37:04,816 - MainLlamaVision - INFO - Configuration: {
|
2025-04-25 15:52:49,079 - MainLlamaVision - INFO - Configuration: {
|
||||||
"dedup_enabled": true,
|
"dedup_enabled": true,
|
||||||
"dedup_threshold": 5,
|
"dedup_threshold": 5,
|
||||||
"save_results": false,
|
"save_results": false,
|
||||||
@ -26,23 +26,40 @@
|
|||||||
"english_only": true,
|
"english_only": true,
|
||||||
"model_name": "llama3-2-vision-90b-instruct-q8-0"
|
"model_name": "llama3-2-vision-90b-instruct-q8-0"
|
||||||
}
|
}
|
||||||
2025-04-25 15:37:04,816 - MainLlamaVision - INFO - Création de l'orchestrateur pour le ticket T11143
|
2025-04-25 15:52:49,080 - MainLlamaVision - INFO - Création de l'orchestrateur pour le ticket T11143
|
||||||
2025-04-25 15:37:04,816 - OrchestratorLlamaVision - INFO - OrchestratorLlamaVision initialisé avec les paramètres: {'dedup_enabled': True, 'dedup_threshold': 5, 'save_results': False, 'debug_mode': False, 'reports_dir': 'reports', 'ocr_enabled': True, 'english_only': True, 'model_name': 'llama3-2-vision-90b-instruct-q8-0'}
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - OrchestratorLlamaVision initialisé avec les paramètres: {'dedup_enabled': True, 'dedup_threshold': 5, 'save_results': False, 'debug_mode': False, 'reports_dir': 'reports', 'ocr_enabled': True, 'english_only': True, 'model_name': 'llama3-2-vision-90b-instruct-q8-0'}
|
||||||
2025-04-25 15:37:04,816 - MainLlamaVision - INFO - Démarrage de l'analyse du ticket T11143
|
2025-04-25 15:52:49,080 - MainLlamaVision - INFO - Démarrage de l'analyse du ticket T11143
|
||||||
2025-04-25 15:37:04,816 - OrchestratorLlamaVision - INFO - Traitement du ticket T11143
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - Traitement du ticket T11143
|
||||||
2025-04-25 15:37:04,817 - OrchestratorLlamaVision - INFO - Utilisation du modèle: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - Utilisation du modèle: llama3-2-vision-90b-instruct-q8-0
|
||||||
2025-04-25 15:37:04,817 - OrchestratorLlamaVision - INFO - Données du ticket chargées depuis output/ticket_T11143/T11143_20250422_084617/T11143_rapports/T11143_rapport.json avec 3 messages
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - Données du ticket chargées depuis output/ticket_T11143/T11143_20250422_084617/T11143_rapports/T11143_rapport.json avec 3 messages
|
||||||
2025-04-25 15:37:04,817 - OrchestratorLlamaVision - INFO - Traduction du contenu du ticket T11143 en anglais
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - [TRADUCTION] Début de traduction du contenu du ticket T11143 (FR → EN)
|
||||||
2025-04-25 15:37:05,067 - OrchestratorLlamaVision - INFO - Traduction terminée: 984 caractères
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - [TRADUCTION] Taille du contenu original: 1088 caractères
|
||||||
2025-04-25 15:37:05,068 - OrchestratorLlamaVision - INFO - Exécution de l'agent d'analyse de ticket pour T11143
|
2025-04-25 15:52:49,080 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction du contenu original en anglais via fr_to_en
|
||||||
2025-04-25 15:37:05,068 - AgentTicketAnalyser - INFO - Utilisation du contenu déjà traduit pour le ticket T11143
|
2025-04-25 15:52:49,080 - Translate - INFO - [TRADUCTION] FR → EN: Traduction de 1088 caractères
|
||||||
2025-04-25 15:38:26,980 - OrchestratorLlamaVision - INFO - Analyse du ticket terminée: 1293 caractères
|
2025-04-25 15:52:49,367 - Translate - INFO - [TRADUCTION] FR → EN: Résultat obtenu de 984 caractères
|
||||||
2025-04-25 15:38:26,993 - OrchestratorLlamaVision - INFO - 6 images trouvées dans output/ticket_T11143/T11143_20250422_084617/attachments
|
2025-04-25 15:52:49,367 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction terminée: 984 caractères
|
||||||
2025-04-25 15:38:27,201 - OrchestratorLlamaVision - INFO - Traitement OCR de 4 images
|
2025-04-25 15:52:49,367 - OrchestratorLlamaVision - INFO - [TRADUCTION] La clé 'content_en' sera utilisée par les agents pour l'analyse en anglais
|
||||||
2025-04-25 15:38:27,201 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/image.png (langue: auto)
|
2025-04-25 15:52:49,367 - OrchestratorLlamaVision - INFO - Exécution de l'agent d'analyse de ticket pour T11143
|
||||||
2025-04-25 15:38:29,950 - OCR - INFO - Langue détectée: eng
|
2025-04-25 15:52:49,367 - AgentTicketAnalyser - INFO - [LANGUE] Utilisation du contenu déjà traduit en anglais pour le ticket T11143
|
||||||
2025-04-25 15:38:30,601 - OCR - WARNING - Impossible de sauvegarder les fichiers de débogage: cannot write mode RGBA as JPEG
|
2025-04-25 15:52:49,367 - AgentTicketAnalyser - INFO - [LANGUE] Génération du prompt d'analyse en anglais
|
||||||
2025-04-25 15:38:30,601 - OCR - INFO - OCR réussi [output/ticket_T11143/T11143_20250422_084617/attachments/image.png] — 1347 caractères: Apache Tomcat x +
|
2025-04-25 15:52:49,367 - AgentTicketAnalyser - INFO - [LANGUE] Taille du prompt en anglais: 1446 caractères
|
||||||
|
2025-04-25 15:52:49,367 - AgentTicketAnalyser - INFO - [LANGUE] Envoi du prompt en anglais au modèle pour analyse du ticket T11143
|
||||||
|
2025-04-25 15:54:16,704 - AgentTicketAnalyser - INFO - [LANGUE] Réponse reçue du modèle en anglais: 1194 caractères
|
||||||
|
2025-04-25 15:54:16,706 - AgentTicketAnalyser - INFO - [ANALYSE] 4 URLs extraites de l'analyse: ['https://zk1.brg-lab.com', 'https://odoo.cbao.fr', 'https://zk1.brg-lab.com/', 'https://odoo.cbao.fr/web/image/145435?access_token=608ac9e7-3627-4a13-8ec-06ff5046ebf3']
|
||||||
|
2025-04-25 15:54:16,707 - AgentTicketAnalyser - INFO - [TRADUCTION] Traduction de la réponse d'analyse du ticket de EN vers FR
|
||||||
|
2025-04-25 15:54:16,707 - AgentTicketAnalyser - INFO - [TRADUCTION] Taille de la réponse en anglais: 1194 caractères
|
||||||
|
2025-04-25 15:54:16,707 - Translate - INFO - [TRADUCTION] EN → FR: Traduction de 1194 caractères
|
||||||
|
2025-04-25 15:54:16,976 - Translate - INFO - [TRADUCTION] EN → FR: Résultat obtenu de 1293 caractères
|
||||||
|
2025-04-25 15:54:16,976 - AgentTicketAnalyser - INFO - [TRADUCTION] Taille de la réponse traduite en français: 1293 caractères
|
||||||
|
2025-04-25 15:54:16,976 - AgentTicketAnalyser - INFO - [LANGUES] Résultat d'analyse disponible en deux langues: EN et FR
|
||||||
|
2025-04-25 15:54:16,976 - AgentTicketAnalyser - INFO - [LANGUES] Traduction du contenu original: True
|
||||||
|
2025-04-25 15:54:16,979 - OrchestratorLlamaVision - INFO - Analyse du ticket terminée: 1293 caractères
|
||||||
|
2025-04-25 15:54:16,992 - OrchestratorLlamaVision - INFO - 6 images trouvées dans output/ticket_T11143/T11143_20250422_084617/attachments
|
||||||
|
2025-04-25 15:54:17,207 - OrchestratorLlamaVision - INFO - Traitement OCR de 4 images
|
||||||
|
2025-04-25 15:54:17,207 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/image.png (langue: auto)
|
||||||
|
2025-04-25 15:54:19,926 - OCR - INFO - Langue détectée: eng
|
||||||
|
2025-04-25 15:54:20,580 - OCR - WARNING - Impossible de sauvegarder les fichiers de débogage: cannot write mode RGBA as JPEG
|
||||||
|
2025-04-25 15:54:20,580 - OCR - INFO - OCR réussi [output/ticket_T11143/T11143_20250422_084617/attachments/image.png] — 1347 caractères: Apache Tomcat x +
|
||||||
|
|
||||||
GC @ 2 zk1.brg-lab.com
|
GC @ 2 zk1.brg-lab.com
|
||||||
|
|
||||||
@ -51,65 +68,145 @@ GC @ 2 zk1.brg-lab.com
|
|||||||
It works !
|
It works !
|
||||||
|
|
||||||
If you're ...
|
If you're ...
|
||||||
2025-04-25 15:38:31,141 - Translate - INFO - Sauvegarde JSON OCR/TRAD réussie pour image.png
|
2025-04-25 15:54:20,581 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR pour image.png (FR → EN)
|
||||||
2025-04-25 15:38:31,141 - Translate - INFO - Ligne ajoutée dans ocr_traduction.txt pour image.png
|
2025-04-25 15:54:20,581 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR original (FR): 1347 caractères
|
||||||
2025-04-25 15:38:31,141 - OrchestratorLlamaVision - INFO - OCR terminé pour image.png: 1347 caractères (en)
|
2025-04-25 15:54:20,581 - Translate - INFO - [TRADUCTION] FR → EN: Traduction de 1347 caractères
|
||||||
2025-04-25 15:38:31,141 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/image_145435.png (langue: auto)
|
2025-04-25 15:54:20,752 - Translate - INFO - [TRADUCTION] FR → EN: Résultat obtenu de 1328 caractères
|
||||||
2025-04-25 15:38:32,223 - OCR - INFO - Langue détectée: fra
|
2025-04-25 15:54:20,752 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR traduit (EN): 1328 caractères
|
||||||
2025-04-25 15:38:32,502 - OCR - INFO - Images prétraitées et résultat OCR sauvegardés dans debug_ocr
|
2025-04-25 15:54:20,752 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR inverse pour validation (EN → FR)
|
||||||
2025-04-25 15:38:32,502 - OCR - INFO - OCR réussi [output/ticket_T11143/T11143_20250422_084617/attachments/image_145435.png] — 373 caractères: C3 giraudbrg-lobicom/BRG-LAB/PAGE programmetssai/zEAAAHEVNGOAA
|
2025-04-25 15:54:20,752 - Translate - INFO - [TRADUCTION] EN → FR: Traduction de 1328 caractères
|
||||||
|
2025-04-25 15:54:20,933 - Translate - INFO - [TRADUCTION] EN → FR: Résultat obtenu de 1499 caractères
|
||||||
|
2025-04-25 15:54:20,933 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR retraduit (FR): 1499 caractères
|
||||||
|
2025-04-25 15:54:20,933 - Translate - INFO - [SAUVEGARDE] Sauvegarde des résultats OCR et traduction pour image.png
|
||||||
|
2025-04-25 15:54:20,933 - Translate - INFO - [SAUVEGARDE] Contenus: OCR FR=1347 caractères, OCR EN=1328 caractères, OCR EN→FR=1499 caractères
|
||||||
|
2025-04-25 15:54:20,933 - Translate - INFO - [SAUVEGARDE] Utilisation du répertoire fourni: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction
|
||||||
|
2025-04-25 15:54:20,934 - Translate - INFO - [SAUVEGARDE] Fichier JSON enregistré: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image.png.json
|
||||||
|
2025-04-25 15:54:20,934 - Translate - INFO - [SAUVEGARDE] Ligne ajoutée dans le fichier global: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/ocr_traduction.txt
|
||||||
|
2025-04-25 15:54:20,934 - OrchestratorLlamaVision - INFO - OCR terminé pour image.png: 1347 caractères (en)
|
||||||
|
2025-04-25 15:54:20,934 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/image_145435.png (langue: auto)
|
||||||
|
2025-04-25 15:54:22,038 - OCR - INFO - Langue détectée: fra
|
||||||
|
2025-04-25 15:54:22,330 - OCR - INFO - Images prétraitées et résultat OCR sauvegardés dans debug_ocr
|
||||||
|
2025-04-25 15:54:22,330 - OCR - INFO - OCR réussi [output/ticket_T11143/T11143_20250422_084617/attachments/image_145435.png] — 373 caractères: C3 giraudbrg-lobicom/BRG-LAB/PAGE programmetssai/zEAAAHEVNGOAA
|
||||||
|
|
||||||
BRGLAS CD Béton CD Foumasew tubo © ...
|
BRGLAS CD Béton CD Foumasew tubo © ...
|
||||||
2025-04-25 15:38:32,887 - Translate - INFO - Sauvegarde JSON OCR/TRAD réussie pour image_145435.png
|
2025-04-25 15:54:22,330 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR pour image_145435.png (FR → EN)
|
||||||
2025-04-25 15:38:32,888 - Translate - INFO - Ligne ajoutée dans ocr_traduction.txt pour image_145435.png
|
2025-04-25 15:54:22,330 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR original (FR): 373 caractères
|
||||||
2025-04-25 15:38:32,888 - OrchestratorLlamaVision - INFO - OCR terminé pour image_145435.png: 373 caractères (fr)
|
2025-04-25 15:54:22,330 - Translate - INFO - [TRADUCTION] FR → EN: Traduction de 373 caractères
|
||||||
2025-04-25 15:38:32,888 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg (langue: auto)
|
2025-04-25 15:54:22,540 - Translate - INFO - [TRADUCTION] FR → EN: Résultat obtenu de 367 caractères
|
||||||
2025-04-25 15:38:34,803 - OCR - INFO - Langue détectée: fra
|
2025-04-25 15:54:22,541 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR traduit (EN): 367 caractères
|
||||||
2025-04-25 15:38:35,926 - OCR - WARNING - OCR vide (aucun texte détecté) pour output/ticket_T11143/T11143_20250422_084617/attachments/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg
|
2025-04-25 15:54:22,541 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR inverse pour validation (EN → FR)
|
||||||
2025-04-25 15:38:35,927 - Translate - INFO - Sauvegarde JSON OCR/TRAD réussie pour 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg
|
2025-04-25 15:54:22,541 - Translate - INFO - [TRADUCTION] EN → FR: Traduction de 367 caractères
|
||||||
2025-04-25 15:38:35,927 - Translate - INFO - Ligne ajoutée dans ocr_traduction.txt pour 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg
|
2025-04-25 15:54:22,751 - Translate - INFO - [TRADUCTION] EN → FR: Résultat obtenu de 378 caractères
|
||||||
2025-04-25 15:38:35,927 - OrchestratorLlamaVision - INFO - OCR terminé pour 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg: 0 caractères (unknown)
|
2025-04-25 15:54:22,751 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR retraduit (FR): 378 caractères
|
||||||
2025-04-25 15:38:35,927 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif (langue: auto)
|
2025-04-25 15:54:22,751 - Translate - INFO - [SAUVEGARDE] Sauvegarde des résultats OCR et traduction pour image_145435.png
|
||||||
2025-04-25 15:38:35,927 - OCR - ERROR - Erreur lors du prétraitement de l'image output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif: image has wrong mode
|
2025-04-25 15:54:22,751 - Translate - INFO - [SAUVEGARDE] Contenus: OCR FR=373 caractères, OCR EN=367 caractères, OCR EN→FR=378 caractères
|
||||||
2025-04-25 15:38:36,164 - OCR - INFO - Langue détectée: fra
|
2025-04-25 15:54:22,751 - Translate - INFO - [SAUVEGARDE] Utilisation du répertoire fourni: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction
|
||||||
2025-04-25 15:38:36,269 - OCR - WARNING - OCR vide (aucun texte détecté) pour output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif
|
2025-04-25 15:54:22,752 - Translate - INFO - [SAUVEGARDE] Fichier JSON enregistré: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image_145435.png.json
|
||||||
2025-04-25 15:38:36,269 - Translate - INFO - Sauvegarde JSON OCR/TRAD réussie pour a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif
|
2025-04-25 15:54:22,752 - Translate - INFO - [SAUVEGARDE] Ligne ajoutée dans le fichier global: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/ocr_traduction.txt
|
||||||
2025-04-25 15:38:36,269 - Translate - INFO - Ligne ajoutée dans ocr_traduction.txt pour a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif
|
2025-04-25 15:54:22,752 - OrchestratorLlamaVision - INFO - OCR terminé pour image_145435.png: 373 caractères (fr)
|
||||||
2025-04-25 15:38:36,269 - OrchestratorLlamaVision - INFO - OCR terminé pour a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif: 0 caractères (unknown)
|
2025-04-25 15:54:22,752 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg (langue: auto)
|
||||||
2025-04-25 15:38:36,269 - OrchestratorLlamaVision - INFO - Traitement de 4 images uniques avec l'agent de tri
|
2025-04-25 15:54:24,659 - OCR - INFO - Langue détectée: fra
|
||||||
2025-04-25 15:39:23,834 - AgentImageSorter - WARNING - Image trop petite: output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif (1x1)
|
2025-04-25 15:54:25,849 - OCR - WARNING - OCR vide (aucun texte détecté) pour output/ticket_T11143/T11143_20250422_084617/attachments/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg
|
||||||
2025-04-25 15:39:23,835 - AgentImageSorter - INFO - Sauvegarde de 4 résultats de tri d'images
|
2025-04-25 15:54:25,850 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR pour 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg (FR → EN)
|
||||||
2025-04-25 15:39:23,836 - OrchestratorLlamaVision - INFO - Sauvegarde groupée de 4 résultats de tri d'images effectuée
|
2025-04-25 15:54:25,850 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR original (FR): 0 caractères
|
||||||
2025-04-25 15:39:23,836 - OrchestratorLlamaVision - INFO - Début de l'analyse des images avec 2 images pertinentes
|
2025-04-25 15:54:25,850 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR traduit (EN): 0 caractères
|
||||||
2025-04-25 15:39:23,836 - OrchestratorLlamaVision - INFO - Analyse de l'image: image.png
|
2025-04-25 15:54:25,850 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR inverse pour validation (EN → FR)
|
||||||
2025-04-25 15:39:23,836 - AgentImageAnalyser - INFO - Analyzing image: output/ticket_T11143/T11143_20250422_084617/attachments/image.png
|
2025-04-25 15:54:25,850 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR retraduit (FR): 0 caractères
|
||||||
2025-04-25 15:41:09,003 - AgentImageAnalyser - INFO - Model name used for logging: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 15:54:25,850 - Translate - INFO - [SAUVEGARDE] Sauvegarde des résultats OCR et traduction pour 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg
|
||||||
2025-04-25 15:41:09,473 - OrchestratorLlamaVision - INFO - Analyse terminée pour image.png
|
2025-04-25 15:54:25,850 - Translate - INFO - [SAUVEGARDE] Contenus: OCR FR=0 caractères, OCR EN=0 caractères, OCR EN→FR=0 caractères
|
||||||
2025-04-25 15:41:09,473 - OrchestratorLlamaVision - INFO - Analyse de l'image: image_145435.png
|
2025-04-25 15:54:25,850 - Translate - INFO - [SAUVEGARDE] Utilisation du répertoire fourni: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction
|
||||||
2025-04-25 15:41:09,473 - AgentImageAnalyser - INFO - Analyzing image: output/ticket_T11143/T11143_20250422_084617/attachments/image_145435.png
|
2025-04-25 15:54:25,850 - Translate - INFO - [SAUVEGARDE] Fichier JSON enregistré: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg.json
|
||||||
2025-04-25 15:43:20,337 - AgentImageAnalyser - INFO - Model name used for logging: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 15:54:25,850 - Translate - INFO - [SAUVEGARDE] Ligne ajoutée dans le fichier global: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/ocr_traduction.txt
|
||||||
2025-04-25 15:43:20,564 - OrchestratorLlamaVision - INFO - Analyse terminée pour image_145435.png
|
2025-04-25 15:54:25,850 - OrchestratorLlamaVision - INFO - OCR terminé pour 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg: 0 caractères (unknown)
|
||||||
2025-04-25 15:43:20,564 - AgentImageAnalyser - INFO - Sauvegarde de 2 résultats d'analyse d'images
|
2025-04-25 15:54:25,850 - OCR - INFO - Traitement OCR pour output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif (langue: auto)
|
||||||
2025-04-25 15:43:20,564 - AgentImageAnalyser - INFO - Utilisation du nom de modèle normalisé depuis LLM: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 15:54:25,850 - OCR - ERROR - Erreur lors du prétraitement de l'image output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif: image has wrong mode
|
||||||
2025-04-25 15:43:20,564 - AgentImageAnalyser - INFO - Modèle utilisé pour sauvegarder les résultats: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 15:54:26,096 - OCR - INFO - Langue détectée: fra
|
||||||
2025-04-25 15:43:20,566 - AgentImageAnalyser - INFO - Fichiers d'analyse d'images trouvés après sauvegarde: ['analyse_image_llama3-vision-90b-instruct_results.json']
|
2025-04-25 15:54:26,209 - OCR - WARNING - OCR vide (aucun texte détecté) pour output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif
|
||||||
2025-04-25 15:43:20,566 - OrchestratorLlamaVision - INFO - Sauvegarde des résultats d'analyse d'images via sauvegarder_resultats
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR pour a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif (FR → EN)
|
||||||
2025-04-25 15:43:20,567 - AgentReportGenerator - DEBUG - Data received for T11143: {"ticket_id": "T11143", "ticket_data": {"id": "11122", "code": "T11143", "name": "BRGLAB - Essai inaccessible", "description": "*Contenu non extractible*", "project_name": "Demandes", "stage_name": "Cl\u00f4tur\u00e9", "user_id": "", "partner_id_email_from": "GIRAUD TP (JCG), Victor BOLL\u00c9E, v.bollee@labojcg.fr", "create_date": "03/04/2025 08:34:43", "write_date_last_modification": "03/04/2025 12:23:31", "date_deadline": "18/04/2025 00:00:00", "messages": [{"author_id": "Fabien LAFAY", "date...
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR original (FR): 0 caractères
|
||||||
2025-04-25 15:43:20,567 - AgentReportGenerator - INFO - Validation for T11143: OK, 2 images analyzed out of 4 images
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR traduit (EN): 0 caractères
|
||||||
2025-04-25 15:43:20,567 - AgentReportGenerator - INFO - Number of images to analyze: 4
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - [TRADUCTION] Traduction OCR inverse pour validation (EN → FR)
|
||||||
2025-04-25 15:43:20,567 - AgentReportGenerator - INFO - Adding analysis of image image.png (2 characters)
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - [TRADUCTION] Texte OCR retraduit (FR): 0 caractères
|
||||||
2025-04-25 15:43:20,567 - AgentReportGenerator - INFO - Adding analysis of image image_145435.png (2 characters)
|
2025-04-25 15:54:26,209 - Translate - INFO - [SAUVEGARDE] Sauvegarde des résultats OCR et traduction pour a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif
|
||||||
2025-04-25 15:43:20,567 - AgentReportGenerator - WARNING - Image 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg without analysis
|
2025-04-25 15:54:26,209 - Translate - INFO - [SAUVEGARDE] Contenus: OCR FR=0 caractères, OCR EN=0 caractères, OCR EN→FR=0 caractères
|
||||||
2025-04-25 15:43:20,568 - AgentReportGenerator - WARNING - Image a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif without analysis
|
2025-04-25 15:54:26,209 - Translate - INFO - [SAUVEGARDE] Utilisation du répertoire fourni: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction
|
||||||
2025-04-25 15:43:20,568 - AgentReportGenerator - INFO - Size of ticket analysis: 6 characters
|
2025-04-25 15:54:26,209 - Translate - INFO - [SAUVEGARDE] Fichier JSON enregistré: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif.json
|
||||||
2025-04-25 15:43:20,568 - AgentReportGenerator - INFO - Size of image block: 11239 characters
|
2025-04-25 15:54:26,209 - Translate - INFO - [SAUVEGARDE] Ligne ajoutée dans le fichier global: output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/ocr_traduction.txt
|
||||||
2025-04-25 15:43:20,568 - AgentReportGenerator - DEBUG - Generated prompt (17201 characters): Voici les données d'analyse pour un ticket de support :
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - OCR terminé pour a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif: 0 caractères (unknown)
|
||||||
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - Traitement de 4 images uniques avec l'agent de tri
|
||||||
|
2025-04-25 15:54:26,209 - OrchestratorLlamaVision - INFO - [AGENT] Transmission à l'agent de tri: image=image.png, OCR EN=1328 caractères
|
||||||
|
2025-04-25 15:54:45,174 - OrchestratorLlamaVision - INFO - [AGENT] Transmission à l'agent de tri: image=image_145435.png, OCR EN=367 caractères
|
||||||
|
2025-04-25 15:55:01,616 - OrchestratorLlamaVision - INFO - [AGENT] Transmission à l'agent de tri: image=543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg, OCR EN=0 caractères
|
||||||
|
2025-04-25 15:55:13,485 - OrchestratorLlamaVision - INFO - [AGENT] Transmission à l'agent de tri: image=a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif, OCR EN=0 caractères
|
||||||
|
2025-04-25 15:55:13,487 - AgentImageSorter - WARNING - Image trop petite: output/ticket_T11143/T11143_20250422_084617/attachments/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif (1x1)
|
||||||
|
2025-04-25 15:55:13,487 - AgentImageSorter - INFO - Sauvegarde de 4 résultats de tri d'images
|
||||||
|
2025-04-25 15:55:13,489 - OrchestratorLlamaVision - INFO - Sauvegarde groupée de 4 résultats de tri d'images effectuée
|
||||||
|
2025-04-25 15:55:13,489 - OrchestratorLlamaVision - INFO - Début de l'analyse des images avec 2 images pertinentes
|
||||||
|
2025-04-25 15:55:13,489 - OrchestratorLlamaVision - INFO - [AGENT] Analyse de l'image: image.png
|
||||||
|
2025-04-25 15:55:13,489 - OrchestratorLlamaVision - INFO - [AGENT] Contexte transmis: ticket_analysis=True, OCR_FR=1347, OCR_EN=1328
|
||||||
|
2025-04-25 15:55:13,489 - AgentImageAnalyser - INFO - Analyzing image: output/ticket_T11143/T11143_20250422_084617/attachments/image.png
|
||||||
|
2025-04-25 15:55:13,489 - AgentImageAnalyser - INFO - [LANGUE] Envoi d'une requête en anglais au modèle avec une image: image.png
|
||||||
|
2025-04-25 15:55:13,489 - AgentImageAnalyser - INFO - [LANGUE] Taille du prompt en anglais: 3195 caractères
|
||||||
|
2025-04-25 15:56:58,579 - AgentImageAnalyser - INFO - [LANGUE] Réponse reçue du modèle en anglais: 2361 caractères
|
||||||
|
2025-04-25 15:56:58,579 - AgentImageAnalyser - INFO - Model name used for logging: llama3-2-vision-90b-instruct-q8-0
|
||||||
|
2025-04-25 15:56:58,579 - AgentImageAnalyser - INFO - [TRADUCTION] Traduction de la réponse d'analyse d'image de EN vers FR
|
||||||
|
2025-04-25 15:56:58,579 - AgentImageAnalyser - INFO - [TRADUCTION] Taille de la réponse en anglais: 2361 caractères
|
||||||
|
2025-04-25 15:56:58,579 - Translate - INFO - [TRADUCTION] EN → FR: Traduction de 2361 caractères
|
||||||
|
2025-04-25 15:56:58,959 - Translate - INFO - [TRADUCTION] EN → FR: Résultat obtenu de 2752 caractères
|
||||||
|
2025-04-25 15:56:58,959 - AgentImageAnalyser - INFO - [TRADUCTION] Taille de la réponse traduite en français: 2752 caractères
|
||||||
|
2025-04-25 15:56:58,959 - AgentImageAnalyser - INFO - [ANALYSE] 2 URLs extraites de l'analyse: ['https://zk1.brg-lab.com', 'https://zk1.brg-lab.com/']
|
||||||
|
2025-04-25 15:56:58,959 - AgentImageAnalyser - INFO - [LANGUES] Résultat d'analyse disponible en deux langues: EN et FR
|
||||||
|
2025-04-25 15:56:58,959 - OrchestratorLlamaVision - INFO - Analyse terminée pour image.png
|
||||||
|
2025-04-25 15:56:58,959 - OrchestratorLlamaVision - INFO - [AGENT] Analyse de l'image: image_145435.png
|
||||||
|
2025-04-25 15:56:58,959 - OrchestratorLlamaVision - INFO - [AGENT] Contexte transmis: ticket_analysis=True, OCR_FR=373, OCR_EN=367
|
||||||
|
2025-04-25 15:56:58,959 - AgentImageAnalyser - INFO - Analyzing image: output/ticket_T11143/T11143_20250422_084617/attachments/image_145435.png
|
||||||
|
2025-04-25 15:56:58,960 - AgentImageAnalyser - INFO - [LANGUE] Envoi d'une requête en anglais au modèle avec une image: image_145435.png
|
||||||
|
2025-04-25 15:56:58,960 - AgentImageAnalyser - INFO - [LANGUE] Taille du prompt en anglais: 2241 caractères
|
||||||
|
2025-04-25 15:59:09,101 - AgentImageAnalyser - INFO - [LANGUE] Réponse reçue du modèle en anglais: 2724 caractères
|
||||||
|
2025-04-25 15:59:09,102 - AgentImageAnalyser - INFO - Model name used for logging: llama3-2-vision-90b-instruct-q8-0
|
||||||
|
2025-04-25 15:59:09,102 - AgentImageAnalyser - INFO - [TRADUCTION] Traduction de la réponse d'analyse d'image de EN vers FR
|
||||||
|
2025-04-25 15:59:09,102 - AgentImageAnalyser - INFO - [TRADUCTION] Taille de la réponse en anglais: 2724 caractères
|
||||||
|
2025-04-25 15:59:09,102 - Translate - INFO - [TRADUCTION] EN → FR: Traduction de 2724 caractères
|
||||||
|
2025-04-25 15:59:09,312 - Translate - INFO - [TRADUCTION] EN → FR: Résultat obtenu de 3060 caractères
|
||||||
|
2025-04-25 15:59:09,312 - AgentImageAnalyser - INFO - [TRADUCTION] Taille de la réponse traduite en français: 3060 caractères
|
||||||
|
2025-04-25 15:59:09,312 - AgentImageAnalyser - INFO - [ANALYSE] 2 URLs extraites de l'analyse: ['https://zk1.brg-lab.com', 'https://zk1.brg-lab.com/']
|
||||||
|
2025-04-25 15:59:09,312 - AgentImageAnalyser - INFO - [LANGUES] Résultat d'analyse disponible en deux langues: EN et FR
|
||||||
|
2025-04-25 15:59:09,312 - OrchestratorLlamaVision - INFO - Analyse terminée pour image_145435.png
|
||||||
|
2025-04-25 15:59:09,313 - AgentImageAnalyser - INFO - Sauvegarde de 2 résultats d'analyse d'images
|
||||||
|
2025-04-25 15:59:09,313 - AgentImageAnalyser - INFO - Utilisation du nom de modèle normalisé depuis LLM: llama3-2-vision-90b-instruct-q8-0
|
||||||
|
2025-04-25 15:59:09,313 - AgentImageAnalyser - INFO - Modèle utilisé pour sauvegarder les résultats: llama3-2-vision-90b-instruct-q8-0
|
||||||
|
2025-04-25 15:59:09,313 - AgentImageAnalyser - INFO - Fichiers d'analyse d'images trouvés après sauvegarde: ['analyse_image_llama3-vision-90b-instruct_results.json']
|
||||||
|
2025-04-25 15:59:09,314 - OrchestratorLlamaVision - INFO - Sauvegarde des résultats d'analyse d'images via sauvegarder_resultats
|
||||||
|
2025-04-25 15:59:09,314 - OrchestratorLlamaVision - INFO - [AGENT] Transmission au générateur de rapport: ticket_id=T11143, ticket_analyse=True, images_analysées=4
|
||||||
|
2025-04-25 15:59:09,314 - OrchestratorLlamaVision - INFO - [AGENT] Données du ticket transmises: originales (FR) et traduites (EN)
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - DEBUG - Data received for T11143: {"ticket_id": "T11143", "ticket_data": {"id": "11122", "code": "T11143", "name": "BRGLAB - Essai inaccessible", "description": "*Contenu non extractible*", "project_name": "Demandes", "stage_name": "Cl\u00f4tur\u00e9", "user_id": "", "partner_id_email_from": "GIRAUD TP (JCG), Victor BOLL\u00c9E, v.bollee@labojcg.fr", "create_date": "03/04/2025 08:34:43", "write_date_last_modification": "03/04/2025 12:23:31", "date_deadline": "18/04/2025 00:00:00", "messages": [{"author_id": "Fabien LAFAY", "date...
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - Validation for T11143: OK, 2 images analyzed out of 4 images
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - Number of images to analyze: 4
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - Adding analysis of image image.png (2 characters)
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - Adding analysis of image image_145435.png (2 characters)
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - WARNING - Image 543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg without analysis
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - WARNING - Image a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif without analysis
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - Size of ticket analysis: 6 characters
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - Size of image block: 11239 characters
|
||||||
|
2025-04-25 15:59:09,314 - AgentReportGenerator - DEBUG - Generated prompt (17201 characters): Voici les données d'analyse pour un ticket de support :
|
||||||
|
|
||||||
=== ANALYSE DU TICKET ===
|
=== ANALYSE DU TICKET ===
|
||||||
{'prompt': "TITRE: BRGLAB - Essai inaccessible\n\n[03/04/2025 08:35:20] Fabien LAFAY (Système):\nGIRAUD TP (JCG), Victor BOLLÉE\n-\nil y a 9 minutes\n;\nFabien LAFAY\n;\nRomuald GRUSON\n;\nsupport\n;\nsupport\n-\nQuentin FAIVRE\n-\nFabien LAFAY\n-\nRomuald GRUSON\nBonjour,\nJe ne parviens pas à accéder au l’essai au bleu\xa0:\nMerci par avance pour votre.\nCordialement\n:\nGIRAUD TP (JCG), Victor BOLLÉE\n-\nil y a 9 minutes\n;\nFabien LAFAY\n;\nRomuald GRUSON\n;\nsupport\n;\nsupport\n-\nQuentin FAIVRE\n-\nFabien LAFAY\n-\nRomuald GRUSON\nBonjour,\nJe ne parviens pas à accéder au l’essai au bleu\xa0:\nMerci par avance pour votre.\nCordialement\n
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - [LANGUE] Le modèle 'llama3.2-vision:90b-instruct-q8_0' nécessite une entrée en anglais
|
||||||
2025-04-25 15:45:19,823 - AgentReportGenerator - INFO - Translating response to French (2753 characters)
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - [TRADUCTION] Traduction du prompt FR → EN pour T11143
|
||||||
2025-04-25 15:45:19,824 - AgentReportGenerator - DEBUG - Response received (2753 characters): ** Rapport croisé **
|
2025-04-25 15:59:09,314 - AgentReportGenerator - INFO - [TRADUCTION] Taille du prompt original en français: 17201 caractères
|
||||||
|
2025-04-25 15:59:09,314 - Translate - INFO - [TRADUCTION] FR → EN: Traduction de 17201 caractères
|
||||||
|
2025-04-25 15:59:09,314 - Translate - INFO - [TRADUCTION] Texte trop long (17201 caractères), découpage en 4 morceaux
|
||||||
|
2025-04-25 15:59:10,707 - Translate - INFO - [TRADUCTION] FR → EN: Résultat obtenu de 16501 caractères
|
||||||
|
2025-04-25 15:59:10,707 - AgentReportGenerator - INFO - [TRADUCTION] Taille du prompt traduit en anglais: 16531 caractères
|
||||||
|
2025-04-25 15:59:10,707 - AgentReportGenerator - INFO - [LANGUE] Envoi du prompt en anglais au modèle
|
||||||
|
2025-04-25 16:01:08,066 - AgentReportGenerator - INFO - [LANGUE] Réponse reçue du modèle en anglais: 2514 caractères
|
||||||
|
2025-04-25 16:01:08,066 - AgentReportGenerator - INFO - [TRADUCTION] Traduction de la réponse EN → FR pour compatibilité
|
||||||
|
2025-04-25 16:01:08,066 - AgentReportGenerator - INFO - [TRADUCTION] Taille de la réponse originale en anglais: 2514 caractères
|
||||||
|
2025-04-25 16:01:08,066 - Translate - INFO - [TRADUCTION] EN → FR: Traduction de 2514 caractères
|
||||||
|
2025-04-25 16:01:08,498 - Translate - INFO - [TRADUCTION] EN → FR: Résultat obtenu de 2753 caractères
|
||||||
|
2025-04-25 16:01:08,498 - AgentReportGenerator - INFO - [TRADUCTION] Taille de la réponse traduite en français: 2753 caractères
|
||||||
|
2025-04-25 16:01:08,498 - AgentReportGenerator - DEBUG - Response received (2753 characters): ** Rapport croisé **
|
||||||
|
|
||||||
**Résumé:**
|
**Résumé:**
|
||||||
Le client, Fabien Lafay, a signalé un problème avec l'accès au "test bleu" et a fourni un contexte supplémentaire via une image. L'équipe de soutien a répondu et Victor Bollée a mentionné que le problème avait été résolu seul.
|
Le client, Fabien Lafay, a signalé un problème avec l'accès au "test bleu" et a fourni un contexte supplémentaire via une image. L'équipe de soutien a répondu et Victor Bollée a mentionné que le problème avait été résolu seul.
|
||||||
@ -119,10 +216,10 @@ Le client, Fabien Lafay, a signalé un problème avec l'accès au "test bleu" et
|
|||||||
| Émetteur | Type | Date | Contenu | Éléments visuels |
|
| Émetteur | Type | Date | Contenu | Éléments visuels |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| Fabien Lafay (client) | Question | [Date non spécifiée] | Problème signalé avec l'accès au «test bleu» | ...
|
| Fabien Lafay (client) | Question | [Date non spécifiée] | Problème signalé avec l'accès au «test bleu» | ...
|
||||||
2025-04-25 15:45:19,824 - OrchestratorLlamaVision - INFO - Traitement terminé pour le ticket T11143
|
2025-04-25 16:01:08,500 - OrchestratorLlamaVision - INFO - Traitement terminé pour le ticket T11143
|
||||||
2025-04-25 15:45:19,824 - MainLlamaVision - INFO - Analyse du ticket T11143 terminée
|
2025-04-25 16:01:08,500 - MainLlamaVision - INFO - Analyse du ticket T11143 terminée
|
||||||
2025-04-25 15:45:19,824 - MainLlamaVision - INFO - Génération des fichiers CSV pour le ticket T11143
|
2025-04-25 16:01:08,500 - MainLlamaVision - INFO - Génération des fichiers CSV pour le ticket T11143
|
||||||
2025-04-25 15:45:19,825 - ReportCSVExporter - INFO - Traitement du rapport: rapport_final_llama3-vision-90b-instruct_results.json
|
2025-04-25 16:01:08,500 - ReportCSVExporter - INFO - Traitement du rapport: rapport_final_llama3-vision-90b-instruct_results.json
|
||||||
2025-04-25 15:45:19,825 - ReportCSVExporter - INFO - CSV échanges généré: /home/fgras-ca/llm-ticket3/CSV/T11143/T11143_llama3-2-vision-90b-instruct-q8-0_exchanges.csv
|
2025-04-25 16:01:08,501 - ReportCSVExporter - INFO - CSV échanges généré: /home/fgras-ca/llm-ticket3/CSV/T11143/T11143_llama3-2-vision-90b-instruct-q8-0_exchanges.csv
|
||||||
2025-04-25 15:45:19,825 - ReportCSVExporter - INFO - Traitement terminé. 1 modèles traités: llama3-2-vision-90b-instruct-q8-0
|
2025-04-25 16:01:08,501 - ReportCSVExporter - INFO - Traitement terminé. 1 modèles traités: llama3-2-vision-90b-instruct-q8-0
|
||||||
2025-04-25 15:45:19,825 - MainLlamaVision - INFO - Fichiers CSV générés avec succès
|
2025-04-25 16:01:08,501 - MainLlamaVision - INFO - Fichiers CSV générés avec succès
|
||||||
|
|||||||
@ -106,21 +106,24 @@ class OrchestratorLlamaVision:
|
|||||||
# Traduire le contenu du ticket en anglais avant l'analyse
|
# Traduire le contenu du ticket en anglais avant l'analyse
|
||||||
# et stocker la version originale
|
# et stocker la version originale
|
||||||
if self.config.get("english_only", True) and ticket_data.get("content"):
|
if self.config.get("english_only", True) and ticket_data.get("content"):
|
||||||
logger.info(f"Traduction du contenu du ticket {ticket_id} en anglais")
|
logger.info(f"[TRADUCTION] Début de traduction du contenu du ticket {ticket_id} (FR → EN)")
|
||||||
|
logger.info(f"[TRADUCTION] Taille du contenu original: {len(ticket_data['content'])} caractères")
|
||||||
ticket_data["content_original"] = ticket_data["content"]
|
ticket_data["content_original"] = ticket_data["content"]
|
||||||
|
|
||||||
# Vérifier si le contenu est déjà en anglais (détection simple)
|
# Vérifier si le contenu est déjà en anglais (détection simple)
|
||||||
english_indicators = ["the ", "is ", "are ", "what ", "when ", "how ", "why "]
|
english_indicators = ["the ", "is ", "are ", "what ", "when ", "how ", "why "]
|
||||||
if any(indicator in ticket_data["content"].lower() for indicator in english_indicators):
|
if any(indicator in ticket_data["content"].lower() for indicator in english_indicators):
|
||||||
logger.info("Le contenu semble déjà être en anglais, pas de traduction nécessaire")
|
logger.info("[TRADUCTION] Le contenu semble déjà être en anglais, pas de traduction nécessaire")
|
||||||
ticket_data["is_english"] = True
|
ticket_data["is_english"] = True
|
||||||
ticket_data["content_en"] = ticket_data["content"]
|
ticket_data["content_en"] = ticket_data["content"]
|
||||||
else:
|
else:
|
||||||
# Traduire en anglais
|
# Traduire en anglais
|
||||||
|
logger.info("[TRADUCTION] Traduction du contenu original en anglais via fr_to_en")
|
||||||
ticket_data["content_en"] = fr_to_en(ticket_data["content"])
|
ticket_data["content_en"] = fr_to_en(ticket_data["content"])
|
||||||
ticket_data["is_english"] = False
|
ticket_data["is_english"] = False
|
||||||
|
|
||||||
logger.info(f"Traduction terminée: {len(ticket_data['content_en'])} caractères")
|
logger.info(f"[TRADUCTION] Traduction terminée: {len(ticket_data['content_en'])} caractères")
|
||||||
|
logger.info(f"[TRADUCTION] La clé 'content_en' sera utilisée par les agents pour l'analyse en anglais")
|
||||||
|
|
||||||
# Étape 1: Analyser le ticket (si l'agent est disponible)
|
# Étape 1: Analyser le ticket (si l'agent est disponible)
|
||||||
ticket_analysis = None
|
ticket_analysis = None
|
||||||
@ -172,10 +175,15 @@ class OrchestratorLlamaVision:
|
|||||||
ocr_fr, langue = extraire_texte(img, lang="auto")
|
ocr_fr, langue = extraire_texte(img, lang="auto")
|
||||||
|
|
||||||
# Traduire le texte extrait en anglais pour une meilleure analyse
|
# Traduire le texte extrait en anglais pour une meilleure analyse
|
||||||
|
logger.info(f"[TRADUCTION] Traduction OCR pour {os.path.basename(img)} (FR → EN)")
|
||||||
|
logger.info(f"[TRADUCTION] Texte OCR original (FR): {len(ocr_fr)} caractères")
|
||||||
ocr_en = fr_to_en(ocr_fr) if ocr_fr else ""
|
ocr_en = fr_to_en(ocr_fr) if ocr_fr else ""
|
||||||
|
logger.info(f"[TRADUCTION] Texte OCR traduit (EN): {len(ocr_en)} caractères")
|
||||||
|
|
||||||
# Traduire à nouveau en français pour vérification (optionnel)
|
# Traduire à nouveau en français pour vérification (optionnel)
|
||||||
|
logger.info(f"[TRADUCTION] Traduction OCR inverse pour validation (EN → FR)")
|
||||||
ocr_en_back_fr = en_to_fr(ocr_en) if ocr_en else ""
|
ocr_en_back_fr = en_to_fr(ocr_en) if ocr_en else ""
|
||||||
|
logger.info(f"[TRADUCTION] Texte OCR retraduit (FR): {len(ocr_en_back_fr)} caractères")
|
||||||
|
|
||||||
# Sauvegarder les résultats OCR directement dans le répertoire pipeline
|
# Sauvegarder les résultats OCR directement dans le répertoire pipeline
|
||||||
# au lieu de créer un sous-répertoire T11143
|
# au lieu de créer un sous-répertoire T11143
|
||||||
@ -202,6 +210,7 @@ class OrchestratorLlamaVision:
|
|||||||
try:
|
try:
|
||||||
# Inclure l'OCR avec le chemin de l'image pour aider au tri
|
# Inclure l'OCR avec le chemin de l'image pour aider au tri
|
||||||
ocr_context = ocr_results.get(img, {"texte_en": ""}).get("texte_en", "")
|
ocr_context = ocr_results.get(img, {"texte_en": ""}).get("texte_en", "")
|
||||||
|
logger.info(f"[AGENT] Transmission à l'agent de tri: image={os.path.basename(img)}, OCR EN={len(ocr_context)} caractères")
|
||||||
result_sort = self.image_sorter.executer(img, ocr_context=ocr_context)
|
result_sort = self.image_sorter.executer(img, ocr_context=ocr_context)
|
||||||
|
|
||||||
# Déterminer si l'image est pertinente
|
# Déterminer si l'image est pertinente
|
||||||
@ -258,7 +267,8 @@ class OrchestratorLlamaVision:
|
|||||||
ocr_info
|
ocr_info
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f"Analyse de l'image: {os.path.basename(img)}")
|
logger.info(f"[AGENT] Analyse de l'image: {os.path.basename(img)}")
|
||||||
|
logger.info(f"[AGENT] Contexte transmis: ticket_analysis={bool(ticket_analysis)}, OCR_FR={len(ocr_info.get('texte_fr', ''))}, OCR_EN={len(ocr_info.get('texte_en', ''))}")
|
||||||
result = self.image_analyser.executer(img, contexte=contexte_enrichi)
|
result = self.image_analyser.executer(img, contexte=contexte_enrichi)
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
@ -316,6 +326,9 @@ class OrchestratorLlamaVision:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info(f"[AGENT] Transmission au générateur de rapport: ticket_id={ticket_id}, ticket_analyse={bool(ticket_analysis)}, images_analysées={len(images_analyses)}")
|
||||||
|
logger.info(f"[AGENT] Données du ticket transmises: originales (FR) et traduites (EN)")
|
||||||
|
|
||||||
# Utiliser directement le répertoire rapports_dir au lieu de recréer un chemin
|
# Utiliser directement le répertoire rapports_dir au lieu de recréer un chemin
|
||||||
rapport_final = self.report_generator.executer(rapport_data)
|
rapport_final = self.report_generator.executer(rapport_data)
|
||||||
|
|
||||||
@ -354,8 +367,10 @@ class OrchestratorLlamaVision:
|
|||||||
# Utiliser la version anglaise du texte OCR pour l'analyse
|
# Utiliser la version anglaise du texte OCR pour l'analyse
|
||||||
if self.config.get("english_only") and ocr_info.get("texte_en"):
|
if self.config.get("english_only") and ocr_info.get("texte_en"):
|
||||||
contexte_enrichi["ocr_text"] = ocr_info["texte_en"]
|
contexte_enrichi["ocr_text"] = ocr_info["texte_en"]
|
||||||
|
logger.debug(f"[CONTEXTE] Utilisation du texte OCR en anglais ({len(ocr_info['texte_en'])} caractères) pour enrichir le contexte")
|
||||||
else:
|
else:
|
||||||
contexte_enrichi["ocr_text"] = ocr_info.get("texte_fr", "")
|
contexte_enrichi["ocr_text"] = ocr_info.get("texte_fr", "")
|
||||||
|
logger.debug(f"[CONTEXTE] Utilisation du texte OCR en français ({len(ocr_info.get('texte_fr', ''))}) caractères pour enrichir le contexte")
|
||||||
|
|
||||||
return contexte_enrichi
|
return contexte_enrichi
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"translation_en_back_fr": "",
|
"translation_en_back_fr": "",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ticket_id": "T11143",
|
"ticket_id": "T11143",
|
||||||
"timestamp": "20250425_153835",
|
"timestamp": "20250425_155425",
|
||||||
"source_module": "ocr_utils + translate_utils",
|
"source_module": "ocr_utils + translate_utils",
|
||||||
"lang_detected": "fr"
|
"lang_detected": "fr"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"translation_en_back_fr": "",
|
"translation_en_back_fr": "",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ticket_id": "T11143",
|
"ticket_id": "T11143",
|
||||||
"timestamp": "20250425_153836",
|
"timestamp": "20250425_155426",
|
||||||
"source_module": "ocr_utils + translate_utils",
|
"source_module": "ocr_utils + translate_utils",
|
||||||
"lang_detected": "fr"
|
"lang_detected": "fr"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"translation_en_back_fr": "Apache Tomcat x +\n\nGc @ 2 zk1.brg-b.com\n\n@ Andre Demo Devmat @ Modèle de base\n\nÇa marche!\n\nSi vous voyez cette page via un navigateur Web, cela signifie que vous avez configuré Tomcat avec succès. Félicitations!\n\nIl s'agit de la page d'accueil par défaut de Tomcat. Il peut être trouvé sur le système de fichiers local à: /var/lib/tomcat7/webapps/root/index.html\n\nMatou? Les vétérans pourraient être ravis de lire cette instance système de Tomcat est installé avec cataina_home dans / usr / tomcat7 et cataina_base dans / var / 1ib / tomcat7, en suivant les règles de / usr / share / doc / tomcat7-commun / running. SMS. GZ.\nVous pourriez envisager d'installer les packages suivants, si vous avez fait Alreni:\n\nTomcat7-Docs: Ce package installe une application Web qui permet de parcourir la documentation Tomcat 7 localement. Une fois installé, vous pouvez y accéder en cliquant\n\nTomcat7-Exemple: Ce package installe une application Web qui permet d'accéder aux exemples de servlet Tomcat 7 et JSP. Une fois installé, vous pouvez y accéder en cliquant\n\nTomcat7-admin: Ce package installe deux applications Web qui peuvent aider à gérer cette instance Tomcat. Une fois installé, vous pouvez accéder au et le et le et\n\nRemarque: Pour des raisons de sécurité, l'utilisation du gestionnaire WebApp est limitée aux utilisateurs avec le rôle \"Manager-Gui\". Le manager host-manager est limité aux utilisateurs avec un rôle \"Admin-Gui\". Les utilisateurs sont définis dans / et / tomcat7 / tomcta-users.xml.",
|
"translation_en_back_fr": "Apache Tomcat x +\n\nGc @ 2 zk1.brg-b.com\n\n@ Andre Demo Devmat @ Modèle de base\n\nÇa marche!\n\nSi vous voyez cette page via un navigateur Web, cela signifie que vous avez configuré Tomcat avec succès. Félicitations!\n\nIl s'agit de la page d'accueil par défaut de Tomcat. Il peut être trouvé sur le système de fichiers local à: /var/lib/tomcat7/webapps/root/index.html\n\nMatou? Les vétérans pourraient être ravis de lire cette instance système de Tomcat est installé avec cataina_home dans / usr / tomcat7 et cataina_base dans / var / 1ib / tomcat7, en suivant les règles de / usr / share / doc / tomcat7-commun / running. SMS. GZ.\nVous pourriez envisager d'installer les packages suivants, si vous avez fait Alreni:\n\nTomcat7-Docs: Ce package installe une application Web qui permet de parcourir la documentation Tomcat 7 localement. Une fois installé, vous pouvez y accéder en cliquant\n\nTomcat7-Exemple: Ce package installe une application Web qui permet d'accéder aux exemples de servlet Tomcat 7 et JSP. Une fois installé, vous pouvez y accéder en cliquant\n\nTomcat7-admin: Ce package installe deux applications Web qui peuvent aider à gérer cette instance Tomcat. Une fois installé, vous pouvez accéder au et le et le et\n\nRemarque: Pour des raisons de sécurité, l'utilisation du gestionnaire WebApp est limitée aux utilisateurs avec le rôle \"Manager-Gui\". Le manager host-manager est limité aux utilisateurs avec un rôle \"Admin-Gui\". Les utilisateurs sont définis dans / et / tomcat7 / tomcta-users.xml.",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ticket_id": "T11143",
|
"ticket_id": "T11143",
|
||||||
"timestamp": "20250425_153831",
|
"timestamp": "20250425_155420",
|
||||||
"source_module": "ocr_utils + translate_utils",
|
"source_module": "ocr_utils + translate_utils",
|
||||||
"lang_detected": "fr"
|
"lang_detected": "fr"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"translation_en_back_fr": "C3 Giraudbrg-Lobicom / Brg-Lab / Page Progratsai / Zeaaahevngoaaaa\n\n Brglas cd béton cd foumasew tubo © masse\n\nECHANTILLION N ° 25-0007 ECEPTIAN le 02/04/2025 PR Bollé Victor prévu le 04/04/2025 Por Bollee Victor N ° Pédéwment 25-00078\nMatériau de sable 0/20 Carriere adceg\n\n[Fai Jemmarme | [M Porrouo || onservanons] [<suo] [v hisromou\n\nposé. à partir de 11 e ‘z2k1.brg-lab.com",
|
"translation_en_back_fr": "C3 Giraudbrg-Lobicom / Brg-Lab / Page Progratsai / Zeaaahevngoaaaa\n\n Brglas cd béton cd foumasew tubo © masse\n\nECHANTILLION N ° 25-0007 ECEPTIAN le 02/04/2025 PR Bollé Victor prévu le 04/04/2025 Por Bollee Victor N ° Pédéwment 25-00078\nMatériau de sable 0/20 Carriere adceg\n\n[Fai Jemmarme | [M Porrouo || onservanons] [<suo] [v hisromou\n\nposé. à partir de 11 e ‘z2k1.brg-lab.com",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ticket_id": "T11143",
|
"ticket_id": "T11143",
|
||||||
"timestamp": "20250425_153832",
|
"timestamp": "20250425_155422",
|
||||||
"source_module": "ocr_utils + translate_utils",
|
"source_module": "ocr_utils + translate_utils",
|
||||||
"lang_detected": "fr"
|
"lang_detected": "fr"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,37 +58,48 @@ def translate_text(text: str, source: str, target: str, use_cache: bool = True)
|
|||||||
Texte traduit
|
Texte traduit
|
||||||
"""
|
"""
|
||||||
if not text or not text.strip():
|
if not text or not text.strip():
|
||||||
|
logger.debug(f"[TRADUCTION] Texte vide, aucune traduction nécessaire {source}->{target}")
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
# Log de début de traduction
|
||||||
|
text_preview = text[:50] + "..." if len(text) > 50 else text
|
||||||
|
logger.debug(f"[TRADUCTION] Demande de traduction {source}->{target}: '{text_preview}'")
|
||||||
|
|
||||||
# Vérifier le cache
|
# Vérifier le cache
|
||||||
if use_cache:
|
if use_cache:
|
||||||
cache_key = _get_cache_key(text, source, target)
|
cache_key = _get_cache_key(text, source, target)
|
||||||
if cache_key in TRANSLATION_CACHE:
|
if cache_key in TRANSLATION_CACHE:
|
||||||
logger.debug(f"Traduction récupérée du cache pour {source}->{target}")
|
logger.debug(f"[TRADUCTION] Récupération depuis le cache pour {source}->{target}")
|
||||||
return TRANSLATION_CACHE[cache_key]
|
return TRANSLATION_CACHE[cache_key]
|
||||||
|
|
||||||
# Limiter la taille du texte pour éviter les problèmes avec l'API
|
# Limiter la taille du texte pour éviter les problèmes avec l'API
|
||||||
# Les longs textes sont découpés et traduits par morceaux
|
# Les longs textes sont découpés et traduits par morceaux
|
||||||
MAX_TEXT_LENGTH = 5000
|
MAX_TEXT_LENGTH = 5000
|
||||||
if len(text) > MAX_TEXT_LENGTH:
|
if len(text) > MAX_TEXT_LENGTH:
|
||||||
|
logger.info(f"[TRADUCTION] Texte trop long ({len(text)} caractères), découpage en {len(text) // MAX_TEXT_LENGTH + 1} morceaux")
|
||||||
chunks = _split_text_into_chunks(text, MAX_TEXT_LENGTH)
|
chunks = _split_text_into_chunks(text, MAX_TEXT_LENGTH)
|
||||||
translated_chunks = []
|
translated_chunks = []
|
||||||
for chunk in chunks:
|
for i, chunk in enumerate(chunks):
|
||||||
|
logger.debug(f"[TRADUCTION] Traduction du morceau {i+1}/{len(chunks)}")
|
||||||
translated_chunk = translate_text(chunk, source, target, use_cache)
|
translated_chunk = translate_text(chunk, source, target, use_cache)
|
||||||
translated_chunks.append(translated_chunk)
|
translated_chunks.append(translated_chunk)
|
||||||
result = ' '.join(translated_chunks)
|
result = ' '.join(translated_chunks)
|
||||||
|
logger.debug(f"[TRADUCTION] Tous les morceaux traduits et réassemblés : {len(result)} caractères")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
logger.debug(f"[TRADUCTION] Appel de l'API de traduction {source}->{target} pour {len(text)} caractères")
|
||||||
translator = GoogleTranslator(source=source, target=target)
|
translator = GoogleTranslator(source=source, target=target)
|
||||||
result = translator.translate(text)
|
result = translator.translate(text)
|
||||||
|
logger.debug(f"[TRADUCTION] Traduction terminée {source}->{target}, résultat: {len(result)} caractères")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Traduction {source}->{target} échouée: {e}")
|
logger.error(f"[TRADUCTION] Échec de la traduction {source}->{target}: {e}")
|
||||||
return text # Retourner le texte original en cas d'erreur
|
return text # Retourner le texte original en cas d'erreur
|
||||||
|
|
||||||
# Mettre en cache
|
# Mettre en cache
|
||||||
if use_cache:
|
if use_cache:
|
||||||
cache_key = _get_cache_key(text, source, target)
|
cache_key = _get_cache_key(text, source, target)
|
||||||
TRANSLATION_CACHE[cache_key] = result
|
TRANSLATION_CACHE[cache_key] = result
|
||||||
|
logger.debug(f"[TRADUCTION] Résultat mis en cache pour {source}->{target}")
|
||||||
_clean_cache_if_needed()
|
_clean_cache_if_needed()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@ -148,7 +159,13 @@ def fr_to_en(text: str) -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
Texte traduit en anglais
|
Texte traduit en anglais
|
||||||
"""
|
"""
|
||||||
return translate_text(text, "fr", "en")
|
if not text:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
logger.info(f"[TRADUCTION] FR → EN: Traduction de {len(text)} caractères")
|
||||||
|
result = translate_text(text, "fr", "en")
|
||||||
|
logger.info(f"[TRADUCTION] FR → EN: Résultat obtenu de {len(result)} caractères")
|
||||||
|
return result
|
||||||
|
|
||||||
def en_to_fr(text: str) -> str:
|
def en_to_fr(text: str) -> str:
|
||||||
"""
|
"""
|
||||||
@ -160,7 +177,13 @@ def en_to_fr(text: str) -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
Texte traduit en français
|
Texte traduit en français
|
||||||
"""
|
"""
|
||||||
return translate_text(text, "en", "fr")
|
if not text:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
logger.info(f"[TRADUCTION] EN → FR: Traduction de {len(text)} caractères")
|
||||||
|
result = translate_text(text, "en", "fr")
|
||||||
|
logger.info(f"[TRADUCTION] EN → FR: Résultat obtenu de {len(result)} caractères")
|
||||||
|
return result
|
||||||
|
|
||||||
def determiner_repertoire_ticket(ticket_id: str):
|
def determiner_repertoire_ticket(ticket_id: str):
|
||||||
"""
|
"""
|
||||||
@ -218,6 +241,9 @@ def sauvegarder_ocr_traduction(
|
|||||||
image_name = os.path.basename(image_path)
|
image_name = os.path.basename(image_path)
|
||||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
|
|
||||||
|
logger.info(f"[SAUVEGARDE] Sauvegarde des résultats OCR et traduction pour {image_name}")
|
||||||
|
logger.info(f"[SAUVEGARDE] Contenus: OCR FR={len(ocr_fr)} caractères, OCR EN={len(ocr_en)} caractères, OCR EN→FR={len(ocr_en_back_fr)} caractères")
|
||||||
|
|
||||||
# Déterminer le répertoire de sortie basé sur le ticket_id
|
# Déterminer le répertoire de sortie basé sur le ticket_id
|
||||||
if not base_dir:
|
if not base_dir:
|
||||||
# Utiliser le répertoire de sortie approprié dans output
|
# Utiliser le répertoire de sortie approprié dans output
|
||||||
@ -226,10 +252,12 @@ def sauvegarder_ocr_traduction(
|
|||||||
# Fallback vers reports si impossible de trouver le répertoire
|
# Fallback vers reports si impossible de trouver le répertoire
|
||||||
base_dir = "reports"
|
base_dir = "reports"
|
||||||
rapport_dir = os.path.join(base_dir, ticket_id, "pipeline", "ocr_traduction")
|
rapport_dir = os.path.join(base_dir, ticket_id, "pipeline", "ocr_traduction")
|
||||||
|
logger.info(f"[SAUVEGARDE] Répertoire de ticket non trouvé, utilisation de {rapport_dir}")
|
||||||
else:
|
else:
|
||||||
# Utiliser le répertoire rapports du ticket
|
# Utiliser le répertoire rapports du ticket
|
||||||
rapports_dir = os.path.join(extraction_dir, f"{ticket_id}_rapports")
|
rapports_dir = os.path.join(extraction_dir, f"{ticket_id}_rapports")
|
||||||
rapport_dir = os.path.join(rapports_dir, "pipeline", "ocr_traduction")
|
rapport_dir = os.path.join(rapports_dir, "pipeline", "ocr_traduction")
|
||||||
|
logger.info(f"[SAUVEGARDE] Utilisation du répertoire de rapports: {rapport_dir}")
|
||||||
else:
|
else:
|
||||||
# Utiliser directement le répertoire pipeline existant et y ajouter ocr_traduction
|
# Utiliser directement le répertoire pipeline existant et y ajouter ocr_traduction
|
||||||
if os.path.basename(base_dir) == f"{ticket_id}_rapports":
|
if os.path.basename(base_dir) == f"{ticket_id}_rapports":
|
||||||
@ -238,6 +266,7 @@ def sauvegarder_ocr_traduction(
|
|||||||
else:
|
else:
|
||||||
# Sinon, utiliser tel quel et ajouter ocr_traduction
|
# Sinon, utiliser tel quel et ajouter ocr_traduction
|
||||||
rapport_dir = os.path.join(base_dir, "pipeline", "ocr_traduction")
|
rapport_dir = os.path.join(base_dir, "pipeline", "ocr_traduction")
|
||||||
|
logger.info(f"[SAUVEGARDE] Utilisation du répertoire fourni: {rapport_dir}")
|
||||||
|
|
||||||
os.makedirs(rapport_dir, exist_ok=True)
|
os.makedirs(rapport_dir, exist_ok=True)
|
||||||
|
|
||||||
@ -258,7 +287,7 @@ def sauvegarder_ocr_traduction(
|
|||||||
|
|
||||||
with open(json_path, "w", encoding="utf-8") as f:
|
with open(json_path, "w", encoding="utf-8") as f:
|
||||||
json.dump(result, f, ensure_ascii=False, indent=2)
|
json.dump(result, f, ensure_ascii=False, indent=2)
|
||||||
logger.info(f"Sauvegarde JSON OCR/TRAD réussie pour {image_name}")
|
logger.info(f"[SAUVEGARDE] Fichier JSON enregistré: {json_path}")
|
||||||
|
|
||||||
# Append TXT global sécurisé (évite l'écrasement)
|
# Append TXT global sécurisé (évite l'écrasement)
|
||||||
txt_path = os.path.join(rapport_dir, "ocr_traduction.txt")
|
txt_path = os.path.join(rapport_dir, "ocr_traduction.txt")
|
||||||
@ -271,10 +300,10 @@ def sauvegarder_ocr_traduction(
|
|||||||
with open(txt_path, "a", encoding="utf-8") as f:
|
with open(txt_path, "a", encoding="utf-8") as f:
|
||||||
f.write(ligne)
|
f.write(ligne)
|
||||||
|
|
||||||
logger.info(f"Ligne ajoutée dans ocr_traduction.txt pour {image_name}")
|
logger.info(f"[SAUVEGARDE] Ligne ajoutée dans le fichier global: {txt_path}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Erreur lors de la sauvegarde OCR+TRAD pour {image_path}: {e}")
|
logger.error(f"[SAUVEGARDE] Erreur lors de la sauvegarde OCR+TRAD pour {image_path}: {e}")
|
||||||
|
|
||||||
# Fonction pour effacer le cache de traduction (utile pour les tests)
|
# Fonction pour effacer le cache de traduction (utile pour les tests)
|
||||||
def clear_translation_cache():
|
def clear_translation_cache():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user