From 62abac05199a871321bb56c153eb501c97551a12 Mon Sep 17 00:00:00 2001 From: Ladebeze66 Date: Thu, 24 Apr 2025 12:00:20 +0200 Subject: [PATCH] 2404-1200-llaup1.3 --- ...3.2-vision_90b-instruct-q8_0_exchanges.csv | 5 ++ agents/llama_vision/agent_image_analyser.py | 24 ++++++-- agents/llama_vision/agent_ticket_analyser.py | 2 +- orchestrator_llama.py | 45 ++++++++++++-- ...a3-2-vision-90b-instruct-q8-0_results.json | 20 +++++-- ...ma3-2-vision-90b-instruct-q8-0_results.txt | 23 +++++++- ...962ed21795c4e943fcb8cb84fd4d7465a.jpg.json | 2 +- ...20e0e112c46b4440cc938f74d10934e98.gif.json | 2 +- .../pipeline/ocr_traduction/image.png.json | 2 +- .../ocr_traduction/image_145435.png.json | 2 +- ...inal_llama3-2-vision-90b-instruct-q8-0.txt | 58 +++++++------------ ...al_llama3-vision-90b-instruct_results.json | 10 ++-- ...nal_llama3-vision-90b-instruct_results.txt | 58 +++++++------------ ...ge_llama3-vision-90b-instruct_results.json | 8 +-- reports/T11143/rapport_final_T11143.txt | 58 +++++++------------ 15 files changed, 177 insertions(+), 142 deletions(-) create mode 100644 CSV/T11143/T11143_llama3.2-vision_90b-instruct-q8_0_exchanges.csv diff --git a/CSV/T11143/T11143_llama3.2-vision_90b-instruct-q8_0_exchanges.csv b/CSV/T11143/T11143_llama3.2-vision_90b-instruct-q8_0_exchanges.csv new file mode 100644 index 0000000..b160e7f --- /dev/null +++ b/CSV/T11143/T11143_llama3.2-vision_90b-instruct-q8_0_exchanges.csv @@ -0,0 +1,5 @@ +Émetteur,Type,Date,Contenu,Éléments visuels +Victor Bollée,Question,2025-04-24 11:50:40,"Le test ""bleu"" ne fonctionne pas comme prévu. J'ai joint une capture d'écran (image_145435.png) pour référence.",Image_145435.png (capture d'écran du problème) +Équipe de soutien,Réponse,2025-04-24 12:00:00,Pouvez-vous fournir plus d'informations sur le message d'erreur que vous recevez? Pouvez-vous également joindre une autre capture d'écran avec les détails d'erreur?,- +Victor Bollée,Réponse,2025-04-24 12:10:00,"J'ai joint une autre capture d'écran (image.png) avec les détails d'erreur. Le message d'erreur est ""Erreur pendant l'analyse:"" Llamavision ""L'objet n'a pas d'attribut 'can_analyse_images'""",image.png (capture d'écran du message d'erreur) +Équipe de soutien,Réponse,2025-04-24 12:20:00,Merci d'avoir fourni les informations nécessaires. Nous avons identifié le problème et fourni une solution. Le problème a été résolu en mettant à jour la bibliothèque Llamavision vers la dernière version.,- diff --git a/agents/llama_vision/agent_image_analyser.py b/agents/llama_vision/agent_image_analyser.py index 30a4cf8..3197a5c 100644 --- a/agents/llama_vision/agent_image_analyser.py +++ b/agents/llama_vision/agent_image_analyser.py @@ -270,10 +270,21 @@ Structure your analysis clearly with headers and bullet points. reponse_en = reponse reponse_fr = None - # Utiliser le nom normalisé du modèle s'il existe - model_name = getattr(self.llm, "pipeline_normalized_name", None) - if model_name is None: - model_name = getattr(self.llm, "modele", "llama3-vision-90b-instruct") + # Obtenir le nom du modèle de manière plus robuste + model_name = None + if hasattr(self.llm, "pipeline_normalized_name") and self.llm.pipeline_normalized_name: + model_name = self.llm.pipeline_normalized_name + elif hasattr(self.llm, "modele") and self.llm.modele: + model_name = self.llm.modele + else: + model_name = "llama3-vision-90b-instruct" + + # Obtenir les paramètres du modèle de manière sécurisée + model_params = {} + if hasattr(self.llm, "params"): + model_params = self.llm.params + elif hasattr(self, "params"): + model_params = self.params resultat = { "timestamp": self._get_timestamp(), @@ -287,10 +298,11 @@ Structure your analysis clearly with headers and bullet points. "model_info": { "name": model_name, "type": "vision", - "parameters": self.llm.params + "parameters": model_params }, "image_path": image_path, - "success": True + "success": True, + "source_agent": self.nom } } diff --git a/agents/llama_vision/agent_ticket_analyser.py b/agents/llama_vision/agent_ticket_analyser.py index 8c76cc5..06ab154 100644 --- a/agents/llama_vision/agent_ticket_analyser.py +++ b/agents/llama_vision/agent_ticket_analyser.py @@ -207,7 +207,7 @@ IMPORTANT: All responses should be in English. Translation to French will be han is_translated = True logger.info(f"Traduction terminée, {len(ticket_content_en)} caractères") - # Générer le prompt d'analyse + # Générer le prompt d'analyse avec le contenu en anglais prompt = self._generer_prompt({"ticket_id": ticket_id, "content": ticket_content_en}) # Analyser avec le LLM diff --git a/orchestrator_llama.py b/orchestrator_llama.py index b124bac..87faeb9 100644 --- a/orchestrator_llama.py +++ b/orchestrator_llama.py @@ -119,10 +119,8 @@ class OrchestratorLlamaVision: # Traduire en anglais ticket_data["content_en"] = fr_to_en(ticket_data["content"]) ticket_data["is_english"] = False - # Pour LlamaVision, nous utilisons la version anglaise comme contenu principal - ticket_data["content"] = ticket_data["content_en"] - logger.info(f"Traduction terminée: {len(ticket_data['content'])} caractères") + logger.info(f"Traduction terminée: {len(ticket_data['content_en'])} caractères") # Étape 1: Analyser le ticket (si l'agent est disponible) ticket_analysis = None @@ -312,13 +310,50 @@ class OrchestratorLlamaVision: return contexte_enrichi def _charger_ticket(self, json_path: Optional[str]) -> Optional[Dict[str, Any]]: + """ + Charge et prépare les données du ticket à partir d'un fichier JSON. + + Args: + json_path: Chemin du fichier JSON + + Returns: + Données du ticket chargées ou None en cas d'erreur + """ if not json_path: logger.warning("Aucun chemin JSON fourni") return None try: - return self.ticket_loader.charger(json_path) + ticket_data = self.ticket_loader.charger(json_path) + + # Préparer le contenu du ticket à partir des messages + messages = ticket_data.get("messages", []) + contenu = [] + + # Ajouter le titre/description + if "name" in ticket_data: + contenu.append(f"TITRE: {ticket_data['name']}") + if "description" in ticket_data and ticket_data["description"] != "*Contenu non extractible*": + contenu.append(f"DESCRIPTION: {ticket_data['description']}") + + # Ajouter chaque message + for msg in messages: + auteur = msg.get("author_id", "Inconnu") + date = msg.get("date", "") + msg_type = msg.get("message_type", "") + content = msg.get("content", "").strip() + + if content: + contenu.append(f"\n[{date}] {auteur} ({msg_type}):") + contenu.append(content) + + # Ajouter le contenu formaté au ticket_data + ticket_data["content"] = "\n".join(contenu) + + logger.info(f"Données du ticket chargées depuis {json_path} avec {len(messages)} messages") + return ticket_data + except Exception as e: - logger.error(f"Erreur chargemnt ticket JSON : {e}") + logger.error(f"Erreur chargement JSON : {e}") return None def _trouver_extractions(self, ticket_path: str, ticket_id: str) -> List[str]: diff --git a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.json b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.json index 99839b7..fe24c06 100644 --- a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.json +++ b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.json @@ -1,9 +1,16 @@ { - "response": "Contenu du ticket insuffisant pour analyse", - "response_en": "Ticket content insufficient for analysis", - "error": true, + "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 :\nMerci par avance pour votre.\nCordialement\n![Image](https://odoo.cbao.fr/web/image/145435?access_token=608ac9e7-3627-4a13-a8ec-06ff5046ebf3)\n\n---\n\n[03/04/2025 12:17:41] Fabien LAFAY (E-mail):\nBonjour\n,\nPouvez-vous vérifier si vous avez bien accès à la page suivante en l'ouvrant dans votre navigateur :\nhttps://zk1.brg-lab.com/\nVoici ce que vous devriez voir affiché :\nSi ce n'est pas le cas, pouvez-vous me faire une capture d'écran de ce qui est affiché?\nJe reste à votre entière disposition pour toute information complémentaire.\nCordialement,\n---\nSupport technique\n\n- image.png (image/png) [ID: 145453]\n\n---\n\n[03/04/2025 12:21:13] Victor BOLLÉE (E-mail):\nBonjour,\nLe problème s’est résolu seul par la suite.\nJe vous remercie pour votre retour.\nBonne journée\nPS : l’adresse fonctionne\nDe :\n\n---", + "prompt_en": "Title: BRGLAB - Inaccessible test\n\n[03/04/2025 08:35:20] Fabien Lafay (System):\nGiraud TP (JCG), Victor Bollée\n-\n9 minutes ago\n;\nFabien Lafay\n;\nROMUALD GRUSON\n;\nsupport\n;\nsupport\n-\nQuentin Faivre\n-\nFabien Lafay\n-\nROMUALD GRUSON\nGood morning,\nI cannot access the blue test:\nThank you in advance for your.\nSincerely\n! [Image] (https://odoo.cbao.fr/web/image/145435?access_token=608ac9e7-3627-4a13-8ec-06ff5046ebf3)\n\n---\n\n[03/04/2025 12:17:41] Fabien Lafay (E-mail):\nGood morning\n,,\nCan you check if you have access to the next page by opening it in your browser:\nhttps://zk1.brg-lab.com/\nHere is what you should see displayed:\nIf not, can you give me a screenshot of what is displayed?\nI remain at your entire disposal for any further information.\nSincerely,\n---\nTechnical support\n\n- Image.png (Image/PNG) [ID: 145453]\n\n---\n\n[03/04/2025 12:21:13] Victor Bollée (E-mail):\nGood morning,\nThe problem resolved alone later.\nThank you for your return.\nGood day\nPS: the address works\nOf :\n\n---", + "response": "** Résumé chronologique des échanges **\n\n1. [03/04/2025 08:35:20] Fabien Lafay (système) rapporte un problème avec l'accès au test bleu et envoie une image.\n2. [03/04/2025 12:17:41] Fabien Lafay répond au rapport initial, demandant à l'utilisateur de vérifier l'accès à une URL spécifique et de fournir un résultat attendu.\n3. [03/04/2025 12:21:13] Victor Bollée répond, déclarant que le problème s'est résolu et remerciant la réponse.\n\n** Extraction des détails techniques importants **\n\n* Le test bleu est inaccessible (rapport initial)\n* Une capture d'écran a été envoyée avec le rapport initial (ID d'image: 145435)\n* URL fourni par Fabien Lafay pour le dépannage: [url] https://zk1.brg-lab.com/\n* Résultat attendu lors de l'accès à l'URL ci-dessus: non spécifié dans le texte, mais une image (image.png, id: 145453) a été envoyée\n* Le problème s'est résolu sans intervention externe\n\n** Identification des URL **\n\n* [Url] https://odoo.cbao.fr/web/image/145435?access_token=608ac9e7-3627-4a13-8ec-06ff5046ebf3 (lien image)\n* [URL] https://zk1.brg-lab.com/ (URL de dépannage)\n\n** Analyse de la résolution des problèmes **\n\nLe problème a été signalé comme résolu par l'utilisateur (Victor Bollée) sans aucune intervention externe, déclarant que \"le problème a résolu seul plus tard\". Par conséquent, on peut conclure que le problème a été résolu, mais la cause et la résolution sont inconnues.", + "response_en": "**Chronological Summary of Exchanges**\n\n1. [03/04/2025 08:35:20] Fabien Lafay (System) reports an issue with accessing the blue test and sends an image.\n2. [03/04/2025 12:17:41] Fabien Lafay responds to the initial report, asking the user to check access to a specific URL and providing an expected outcome.\n3. [03/04/2025 12:21:13] Victor Bollée responds, stating that the issue resolved itself and thanking for the response.\n\n**Extraction of Important Technical Details**\n\n* The blue test is inaccessible (initial report)\n* A screenshot was sent with the initial report (image ID: 145435)\n* URL provided by Fabien Lafay for troubleshooting: [URL]https://zk1.brg-lab.com/\n* Expected outcome when accessing the above URL: not specified in text, but an image (Image.png, ID: 145453) was sent\n* The issue resolved itself without external intervention\n\n**Identification of URLs**\n\n* [URL]https://odoo.cbao.fr/web/image/145435?access_token=608ac9e7-3627-4a13-8ec-06ff5046ebf3 (image link)\n* [URL]https://zk1.brg-lab.com/ (troubleshooting URL)\n\n**Analysis of Issue Resolution**\n\nThe issue was reported as resolved by the user (Victor Bollée) without any external intervention, stating that \"the problem resolved alone later\". Therefore, it can be concluded that the issue was resolved, but the cause and resolution are unknown.", + "urls_extracted": [ + "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" + ], "metadata": { - "timestamp": "20250424_104158", + "timestamp": "20250424_115040", "source_agent": "AgentTicketAnalyser", "ticket_id": "T11143", "model_info": { @@ -11,6 +18,9 @@ "temperature": 0.1, "top_p": 0.5, "max_tokens": 4000 - } + }, + "language": "en-fr", + "translation_markers": true, + "is_translated": true } } \ No newline at end of file diff --git a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.txt b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.txt index b754323..d5e0f08 100644 --- a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.txt +++ b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/analyse_ticket_llama3-2-vision-90b-instruct-q8-0_results.txt @@ -1,7 +1,28 @@ RÉSULTATS DE L'ANALYSE ANALYSE_TICKET - TICKET T11143 ================================================================================ -Contenu du ticket insuffisant pour analyse +** Résumé chronologique des échanges ** + +1. [03/04/2025 08:35:20] Fabien Lafay (système) rapporte un problème avec l'accès au test bleu et envoie une image. +2. [03/04/2025 12:17:41] Fabien Lafay répond au rapport initial, demandant à l'utilisateur de vérifier l'accès à une URL spécifique et de fournir un résultat attendu. +3. [03/04/2025 12:21:13] Victor Bollée répond, déclarant que le problème s'est résolu et remerciant la réponse. + +** Extraction des détails techniques importants ** + +* Le test bleu est inaccessible (rapport initial) +* Une capture d'écran a été envoyée avec le rapport initial (ID d'image: 145435) +* URL fourni par Fabien Lafay pour le dépannage: [url] https://zk1.brg-lab.com/ +* Résultat attendu lors de l'accès à l'URL ci-dessus: non spécifié dans le texte, mais une image (image.png, id: 145453) a été envoyée +* Le problème s'est résolu sans intervention externe + +** Identification des URL ** + +* [Url] https://odoo.cbao.fr/web/image/145435?access_token=608ac9e7-3627-4a13-8ec-06ff5046ebf3 (lien image) +* [URL] https://zk1.brg-lab.com/ (URL de dépannage) + +** Analyse de la résolution des problèmes ** + +Le problème a été signalé comme résolu par l'utilisateur (Victor Bollée) sans aucune intervention externe, déclarant que "le problème a résolu seul plus tard". Par conséquent, on peut conclure que le problème a été résolu, mais la cause et la résolution sont inconnues. ================================================================================ diff --git a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg.json b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg.json index 42531cf..e635305 100644 --- a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg.json +++ b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/543d7da1b54c29ff43ce5712d1a9aa4962ed21795c4e943fcb8cb84fd4d7465a.jpg.json @@ -5,7 +5,7 @@ "translation_en_back_fr": "", "metadata": { "ticket_id": "T11143", - "timestamp": "20250424_104207", + "timestamp": "20250424_115049", "source_module": "ocr_utils + translate_utils", "lang_detected": "fr" } diff --git a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif.json b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif.json index 523eb28..8fbdc05 100644 --- a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif.json +++ b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/a20f7697fd5e1d1fca3296c6d01228220e0e112c46b4440cc938f74d10934e98.gif.json @@ -5,7 +5,7 @@ "translation_en_back_fr": "", "metadata": { "ticket_id": "T11143", - "timestamp": "20250424_104207", + "timestamp": "20250424_115049", "source_module": "ocr_utils + translate_utils", "lang_detected": "fr" } diff --git a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image.png.json b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image.png.json index 8a10a8e..bb20b7a 100644 --- a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image.png.json +++ b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image.png.json @@ -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.", "metadata": { "ticket_id": "T11143", - "timestamp": "20250424_104202", + "timestamp": "20250424_115044", "source_module": "ocr_utils + translate_utils", "lang_detected": "fr" } diff --git a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image_145435.png.json b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image_145435.png.json index 2bfd397..a742d25 100644 --- a/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image_145435.png.json +++ b/output/ticket_T11143/T11143_20250422_084617/T11143_rapports/pipeline/ocr_traduction/image_145435.png.json @@ -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] [