From 95c2406c3998bd01720a71fe204258a6318b8aea Mon Sep 17 00:00:00 2001 From: Ladebeze66 Date: Mon, 24 Mar 2025 17:36:01 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20rapide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .obsidian/graph.json | 11 +- .obsidian/workspace.json | 456 +---- Stage/20 mars questions Karim.md | 3 +- Stage/20 mars réponses Karim.md | 3 +- Stage/Notes webdev.md | 1 + Stage/Résumé entretien 20 mars.md | 178 ++ command_list/Git commands.md | 30 +- inbox/ROBO_MAT_Code_WLangage_Organise.json | 6 + inbox/Sans titre.md | 0 webdev/00_Template_Analyse_ROBO_MAT.md | 88 + .../01_WLangage_Récupération_Projet_WebDev.md | 115 ++ webdev/Analyse_ROBO_MAT_Complete.md | 1511 ++++++++++++++++ webdev/Application webdev (1).md | 135 ++ webdev/PJ/structure_projet_robo_mat.txt | Bin 0 -> 95544 bytes webdev/PJ/wlangage_class_code.json | 340 ++++ webdev/ROBO_MAT_Analyse_Fonctionnelle.md | 64 + webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md | 195 +++ webdev/ROBO_MAT_Code_WLangage_Organise.md | 1512 +++++++++++++++++ ...e certaines notions WLangage et Classes.md | 75 + webdev/structure_projet_robo_mat.md | 23 + 20 files changed, 4358 insertions(+), 388 deletions(-) create mode 100644 Stage/Résumé entretien 20 mars.md create mode 100644 inbox/ROBO_MAT_Code_WLangage_Organise.json create mode 100644 inbox/Sans titre.md create mode 100644 webdev/00_Template_Analyse_ROBO_MAT.md create mode 100644 webdev/01_WLangage_Récupération_Projet_WebDev.md create mode 100644 webdev/Analyse_ROBO_MAT_Complete.md create mode 100644 webdev/Application webdev (1).md create mode 100644 webdev/PJ/structure_projet_robo_mat.txt create mode 100644 webdev/PJ/wlangage_class_code.json create mode 100644 webdev/ROBO_MAT_Analyse_Fonctionnelle.md create mode 100644 webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md create mode 100644 webdev/ROBO_MAT_Code_WLangage_Organise.md create mode 100644 webdev/Rappel de certaines notions WLangage et Classes.md create mode 100644 webdev/structure_projet_robo_mat.md diff --git a/.obsidian/graph.json b/.obsidian/graph.json index 94e2be4..e5de4cd 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -5,7 +5,7 @@ "showAttachments": false, "hideUnresolved": false, "showOrphans": true, - "collapse-color-groups": true, + "collapse-color-groups": false, "colorGroups": [ { "query": "path:Obsidian ", @@ -41,6 +41,13 @@ "a": 1, "rgb": 8091799 } + }, + { + "query": "path:webdev ", + "color": { + "a": 1, + "rgb": 14937586 + } } ], "collapse-display": true, @@ -53,6 +60,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 1.0000000000000056, + "scale": 0.5087618855792638, "close": true } \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 10a818a..24a3228 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -4,325 +4,38 @@ "type": "split", "children": [ { - "id": "c2f4a1753293419f", + "id": "d991961c29ad106d", "type": "tabs", "children": [ { - "id": "68491419da144553", + "id": "8cd31f588ec21296", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "Obsidian/Ouvrir un terminal dans Obsidian.md", - "mode": "preview", - "source": false - }, - "icon": "lucide-file", - "title": "Ouvrir un terminal dans Obsidian" - } - }, - { - "id": "6190bc947aeac61d", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "ollama/guide_ollama_complet.md", + "file": "command_list/Ollama commands.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "guide_ollama_complet" + "title": "Ollama commands" } }, { - "id": "4a79ae9b5cf40685", + "id": "97ca7aff179659c4", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "Serveur perso/Infrastructure Optimisée d'IA Locale.md", - "mode": "preview", - "source": false - }, - "icon": "lucide-file", - "title": "Infrastructure Optimisée d'IA Locale" - } - }, - { - "id": "c732e844eb2b7094", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/Infrastructure Optimisée d'IA Locale (version 2).md", + "file": "webdev/ROBO_MAT_Code_WLangage_Organise.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "Infrastructure Optimisée d'IA Locale (version 2)" - } - }, - { - "id": "c425e145aee8cd6a", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/Agent LLM Classes recherches 1.md", - "mode": "preview", - "source": false - }, - "icon": "lucide-file", - "title": "Agent LLM Classes recherches 1" - } - }, - { - "id": "9f01b54131d8ad11", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/Agent LLM Classes recherches 1.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Agent LLM Classes recherches 1" - } - }, - { - "id": "b9670384c5347fe5", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/LLM Obsidian.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "LLM Obsidian" - } - }, - { - "id": "3d7bf6b1be159bbe", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/LLM Cursor.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "LLM Cursor" - } - }, - { - "id": "93feebe5d77bd0dc", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "ollama/Plan d'apprentissage détaillé sur Ollama.md", - "mode": "preview", - "source": false - }, - "icon": "lucide-file", - "title": "Plan d'apprentissage détaillé sur Ollama" - } - }, - { - "id": "aab7b92f101ead65", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "inbox/StramDeck config.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "StramDeck config" - } - }, - { - "id": "bf4f5ca51a0e0dd8", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/Optimisation bios serveur.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Optimisation bios serveur" - } - }, - { - "id": "2bc8a1b7fd6d9af5", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "inbox/wild.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "wild" - } - }, - { - "id": "15f320992faf0688", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Jour 5 notes support traitement ticket dev.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Jour 5 notes support traitement ticket dev" - } - }, - { - "id": "b3459535494873e5", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Obsidian/Obsidian CSS.md", - "mode": "preview", - "source": false - }, - "icon": "lucide-file", - "title": "Obsidian CSS" - } - }, - { - "id": "72aa54670d29b111", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "inbox/prompt.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "prompt" - } - }, - { - "id": "0e580d10b27a161e", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "inbox/prompt.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "prompt" - } - }, - { - "id": "5afdc6cb3fe20644", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/Préversion IA locales personnelle.md", - "mode": "preview", - "source": false - }, - "icon": "lucide-file", - "title": "Préversion IA locales personnelle" - } - }, - { - "id": "4e69fedfd0d21df9", - "type": "leaf", - "state": { - "type": "graph", - "state": {}, - "icon": "lucide-git-fork", - "title": "Vue graphique" - } - }, - { - "id": "48842f66b7e7e365", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Obsidian/Liens dans obsidian.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Liens dans obsidian" - } - }, - { - "id": "64922fb286281777", - "type": "leaf", - "state": { - "type": "graph", - "state": {}, - "icon": "lucide-git-fork", - "title": "Vue graphique" - } - }, - { - "id": "4102dd91ee7179ea", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "inbox/Piste d'améliorations du projet IA locale.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Piste d'améliorations du projet IA locale" - } - }, - { - "id": "ff79cd1085f74b83", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Serveur perso/Création de classes agents pour LLM locaux avec Cursor et Ollama.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Création de classes agents pour LLM locaux avec Cursor et Ollama" - } - }, - { - "id": "6d3c8a826a68010d", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Obsidian/Ouvrir un terminal dans Obsidian.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Ouvrir un terminal dans Obsidian" + "title": "ROBO_MAT_Code_WLangage_Organise" } } - ], - "currentTab": 11 + ] } ], "direction": "vertical" @@ -455,8 +168,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -465,8 +178,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -475,8 +188,8 @@ "state": { "type": "side-panel-control-view", "state": {}, - "icon": "viewIcon", - "title": "Markdown-Autocomplete" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -485,8 +198,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -495,8 +208,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -505,8 +218,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -515,8 +228,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -525,8 +238,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -535,8 +248,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -545,8 +258,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -555,8 +268,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -565,8 +278,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -575,8 +288,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -585,8 +298,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -595,8 +308,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -605,8 +318,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -615,8 +328,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -625,8 +338,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -635,8 +348,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } }, { @@ -645,8 +358,8 @@ "state": { "type": "SC-custom-variables-view", "state": {}, - "icon": "code-glyph", - "title": "Shell commands: Custom variables" + "icon": "lucide-file", + "title": "Le module complémentaire n'est plus actif." } } ], @@ -660,54 +373,56 @@ "left-ribbon": { "hiddenItems": { "workspaces:Gérer les espaces de travail": false, - "table-editor-obsidian:Advanced Tables Toolbar": false, - "obsidian-markdown-formatting-assistant-plugin:Open Markdown Formatting Assistant": false, "switcher:Ouvrir le sélecteur rapide": false, "graph:Ouvrir la vue graphique": false, "canvas:Créer une nouvelle toile": false, "daily-notes:Ouvrir la note quotidienne": false, "templates:Insérer le modèle": false, "command-palette:Ouvrir la palette de commandes": false, + "table-editor-obsidian:Advanced Tables Toolbar": false, + "obsidian-markdown-formatting-assistant-plugin:Open Markdown Formatting Assistant": false, "obsidian-shellcommands:Shell commands: Custom variables": false, "templater-obsidian:Templater": false } }, - "active": "2bc8a1b7fd6d9af5", + "active": "8cd31f588ec21296", "lastOpenFiles": [ - "Serveur perso/Optimisation bios serveur.md", - "inbox/wild.md", - "Serveur perso/Infrastructure Optimisée d'IA Locale (version 2).md", - "Serveur perso/Infrastructure Optimisée d'IA Locale.md", - "inbox/StramDeck config.md", - "ollama/Plan d'apprentissage détaillé sur Ollama.md", - "Streamdeck", - "ollama/guide_ollama_complet.md", - "Obsidian/Couleurs liens Obsidian.md", - "Stage/20 mars réponses Karim.md", - "Obsidian/Notes Obsidian.md", - "Obsidian/Guide_Organisation.md", - "Obsidian/Liens dans obsidian.md", - "Serveur perso/Agent LLM Classes recherches 1.md", - "Serveur perso/Création de classes agents pour LLM locaux avec Cursor et Ollama.md", - "command_list/Ollama commands.md", - "Serveur perso/automatiser-lancement-serveur-windows.md", - "Serveur perso/LLM Obsidian.md", - "Serveur perso/Piste d'améliorations du projet IA locale.md", - "Serveur perso/Préversion IA locales personnelle.md", + "webdev/ROBO_MAT_Analyse_clsMistral.md", + "webdev/ROBO_MAT_Analyse_clsOllama.md", + "webdev/Non confirmé 702528.crdownload", + "webdev/ROBO_MAT_Analyse_Fonctionnelle.md", + "webdev/Rappel de certaines notions WLangage et Classes.md", + "inbox/Non confirmé 367059.crdownload", + "webdev/ROBO_MAT_Code_WLangage_Organise.md", + "webdev/PJ/wlangage_class_code.json", + "webdev/Analyse_ROBO_MAT_Complete.md", + "inbox/prompt.md", "inbox/Odoo.md", "inbox/Notes RAGFLOW.md", "inbox/Notes projet LLM.md", - "Serveur perso/Agent LLM recherches 2.md", - "Obsidian/Ouvrir un terminal dans Obsidian.md", - "Obsidian/Obsidian CSS.md", - "Serveur perso/Recherche modèles.md", - "command_list", - "Stage", - "ollama", - "Obsidian", - "Serveur perso", + "inbox/Node.js.md", + "inbox/Fichier type json récupération odoo.md", + "inbox/Arborescence du programme.md", + "command_list/Git commands.md", + "inbox/StramDeck config.md", + "inbox/Scripts requêtes Odoo.md", + "inbox/ROBO_MAT_Code_WLangage_Organise.json", + "inbox/Non confirmé 873082.crdownload", + "inbox/ROBO_MAT_Analyse_clsDeepl.md", + "inbox/Non confirmé 727828.crdownload", + "inbox/version épuée.md", + "inbox/Sans titre.md", + "webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md", + "inbox/Non confirmé 465885.crdownload", + "webdev/structure_projet_robo_mat.md", + "webdev/Application webdev (1).md", + "inbox/Non confirmé 948241.crdownload", + "inbox/Non confirmé 34515.crdownload", + "inbox/Non confirmé 822614.crdownload", + "inbox/ROBO_MAT_Analyse_Adaptation.md", + "webdev/00_Template_Analyse_ROBO_MAT.md", + "webdev/01_WLangage_Récupération_Projet_WebDev.md", "captures/signature.png", - "inbox", "captures/Capture d'écran 2025-03-20 150304.png", "captures/Capture d'écran 2025-03-20 150213.png", "captures/Capture d'écran 2025-03-20 150023.png", @@ -716,9 +431,6 @@ "captures/Capture d'écran 2025-03-20 144343.png", "captures/Capture d'écran 2025-03-20 144317.png", "captures/Capture d'écran 2025-03-20 143039.png", - "captures/Capture d'écran 2025-03-20 112035.png", - "captures", - "data/ticket_10995_raw.json", - "data" + "captures/Capture d'écran 2025-03-20 112035.png" ] } \ No newline at end of file diff --git a/Stage/20 mars questions Karim.md b/Stage/20 mars questions Karim.md index 5dbf7ab..04e7475 100644 --- a/Stage/20 mars questions Karim.md +++ b/Stage/20 mars questions Karim.md @@ -15,4 +15,5 @@ - [ ] Voir efficacité de guider l'utilisateur pour récupérer les informations plus rapidement - [ ] Mise en place d'une interface locale? (Gradio ou autre) avec enregistrement des conversations pour tests et ajout des conversations au JSON pour regrouper es données concernant la demande -[[20 mars réponses Karim]] \ No newline at end of file +[[20 mars réponses Karim]] +[[Résumé entretien 20 mars]] \ No newline at end of file diff --git a/Stage/20 mars réponses Karim.md b/Stage/20 mars réponses Karim.md index fb95f50..e9f5333 100644 --- a/Stage/20 mars réponses Karim.md +++ b/Stage/20 mars réponses Karim.md @@ -49,4 +49,5 @@ documentation ollama API [Commencer \| DataCamp](https://www.datacamp.com/fr/users/sign_up?redirect=%2Ftracks%2Fai-fundamentals%2Fenroll) grascalvet.fernand@gmail.com Lestat66! [[Agent]] -[[guide_ollama_complet]] \ No newline at end of file +[[guide_ollama_complet]] +[[Résumé entretien 20 mars]] \ No newline at end of file diff --git a/Stage/Notes webdev.md b/Stage/Notes webdev.md index 82c0939..bf22ce8 100644 --- a/Stage/Notes webdev.md +++ b/Stage/Notes webdev.md @@ -76,6 +76,7 @@ Pour effectuer des calculs sur des variables, le WLangage met à disposition les D'autres opérateurs sont disponibles. Pour plus de détails sur les opérateurs, consultez [Liste des opérateurs](https://doc.pcsoft.fr/?1512010&name=liste_des_operateurs "Liste des opérateurs"). +[[01_WLangage_Récupération_Projet_WebDev]] diff --git a/Stage/Résumé entretien 20 mars.md b/Stage/Résumé entretien 20 mars.md new file mode 100644 index 0000000..d27abe4 --- /dev/null +++ b/Stage/Résumé entretien 20 mars.md @@ -0,0 +1,178 @@ +# Organisation des notes et questions + +## ✅ Partie 1 : Liens entre Questions et Réponses + +### 🔄 Correspondances identifiées + +|Question|Réponse(s) correspondante(s)| +|---|---| +|Pipeline nodes vs FastAPI|❌ Non abordé clairement dans la réunion| +|Validation format JSON|❌ Non abordé directement| +|Mise en place de scripts|✅ Création de petits scripts + plus gros pour recherche + scripts autonomes| +|Argument + script pour exécution|✅ Utilisation possible dans un cadre automatisé avec LLMs / agents| +|Bibliothèque de scripts pour données|✅ Extraction depuis tickets / traitement dans scripts structurés / stockage JSON| +|Création de base de données|✅ ElasticSearch pour structuration + consultation des tickets résolus| +|Déplacement des données résolues|✅ Données déplacées après clôture ticket, nettoyées pour intégration finale| +|Quel LLM pour scripts ?|✅ Plusieurs options : LLava, LangChain, LlamaIndex, Ollama, agents multiples| +|Fine-tuning besoin ?|✅ Oui, prévu régulièrement (mensuel) avec LoRA après nettoyage + synthèse| +|Interface locale ?|✅ Interface type Gradio, conversations sauvegardées et réinjectées dans JSON| + +--- + +## 📑 Partie 2 : Résumé structuré de la réunion + +### 📚 1. **Base de données et stockage des tickets** + +- Utilisation d'**ElasticSearch** comme base centrale. +- Contenu : fils de discussions clients/support + tickets clos. +- Extraction automatique de paires Q/R dès qu'un ticket est considéré comme résolu. +- Traitement des images : conversion en texte explicatif pour intégration dans la synthèse. + +### ⚙️ 2. **Organisation des scripts d'automatisation** + +- Mise en place d’une **bibliothèque de scripts** : + - **Scripts courts** : tâches ciblées (extraction JSON, filtre, nettoyage) + - **Scripts intermédiaires** : automatisation du tri, création des fichiers finaux + - **Scripts lourds/autonomes** : exécutions régulières, recherche sur ensemble ElasticSearch +- Une fois les tickets traités, génération d’un **JSON final** prêt à l’injection dans le LLM ou RAG. +- Suppression automatique des fichiers temporaires obsolètes. + +### 🤖 3. **Architecture LLMs et agents** + +- Utilisation de **plusieurs agents spécialisés** : + - Résumer la question + - Résumer ou formuler la réponse + - Ajouter du contexte ou détecter les problèmes récurrents + - Analyse d’image (via LLaVA ou autre LLM vision) +- Modèles suggérés : + - **LLava / LLaMA-Vision** : traitement image + texte + - **LangChain / LlamaIndex** : gestion du RAG + - **Ollama** : LLM local, agents affectés à différentes tâches +- Agents configurés dans **VSCode via API Ollama**, avec rôles assignés par prompt ou tag + +### 🧠 4. **Stratégie hybride : RAG + Fine-tuning** + +- Pipeline proposé : + - RAG pour indexation / requêtes rapides sur base ElasticSearch + - **Fine-tuning via LoRA** chaque mois pour apprentissage des nouveaux cas validés + - Nettoyage systématique du dataset avant fine-tune +- Possibilité de retraining ciblé en cas de réponse erronée ou incohérente +- Système de signalement de cas récurrents à intégrer dans le flux de traitement + +### 💬 5. **Interface utilisateur locale** + +- Création d’une interface locale (**Gradio ou équivalent**) pour dialogue avec LLM + - Conversation sauvegardée (logs) + - Intégration de ces échanges dans JSON pour enrichissement automatique + - Tests d’efficacité en comparant les réponses sur différents tickets ou variantes + +### 🧪 6. **Intégration dans VSCode avec Ollama** + +- Agents configurés directement dans **VSCode via Ollama API** +- Exemple de cas : + - Agent : “Convertis ce code WLangage en Python” + - Action : détecte les fichiers concernés, applique une conversion + - Permet de contextualiser le prompt selon la tâche +- Lié à des scripts personnalisés : enrichissement automatique, tri, filtrage, injection + +### 📊 7. **Sources de données / datasets** + +- **HuggingFace** : datasets généraux pour LLMs +- **Kaggle** : datasets spécialisés (math, domaine du béton) +- **Postgres** : possibilité de structurer localement des jeux de données internes +- Objectif : construire des datasets similaires pour entraînement/fine-tuning + +--- + +## 📌 Synthèse et prochaines étapes + +Ce résumé permet de : + +- Poser une **roadmap technique** : LLMs, scripts, interface, collecte, injection +- Créer une **structure de traitement des tickets** et extraction Q/R automatisée +- Définir des **rôles pour chaque agent** (résumeur, nettoyeur, image, contrôleur, etc.) +- Identifier les briques logicielles à mettre en place (VSCode, Ollama, RAG, Gradio) + +Voici les éléments préparés pour t’aider à structurer ton suivi de projet dans Obsidian : + +--- + +## 📄 Template de note par ticket + +```markdown +# 📝 Ticket #[ID] - [Objet de la demande] + +## 🔎 Résumé +- **Client** : +- **Date** : +- **Statut** : 🟡 En cours / ✅ Résolu / ⛔ À revoir + +## ❓ Question / Problème +- Description de la demande ou du bug : +- Captures ou données associées : + +## ✅ Réponse / Solution proposée +- Résumé de la réponse apportée : +- Étapes réalisées : + - [ ] Analyse + - [ ] Script exécuté : `[nom_script].py` + - [ ] Vérification / test + +## 📎 Fichiers liés +- Script utilisé : `[lien vers script]` +- JSON généré : `[nom_fichier].json` +- Image(s) : `[capture1.png]`, `[capture2.jpg]` + +## 🧠 À injecter dans : +- [ ] Base RAG +- [ ] Dataset fine-tuning +- [ ] Non pertinent + +--- +``` + +## 🧠 Dashboard d’actions (boutons avec Templater ou Shell Commands) + +````markdown +# 🧪 Dashboard - Automatisations Git/LLM + +```button +name Lancer traitement script +action shell-commands:Run: Script Principal +```` + +```button +name Générer JSON final +action shell-commands:Run: Générer JSON +``` + +```button +name Injecter dans LLM RAG +action shell-commands:Run: Injecter RAG +``` + +```button +name Envoyer pour fine-tune +action shell-commands:Run: Fine-Tune Export +``` + +``` + +➡️ À lier avec tes commandes Shell définies dans le plugin `Shell commands` + +--- + +## 📁 Arborescence Obsidian recommandée pour ton projet + +``` + +MonVault/ ├── tickets/ │ ├── ticket-001.md │ ├── ticket-002.md │ └── ticket-templates.md │ ├── scripts/ │ ├── script_cleaner.py │ └── extract_json.py │ ├── data/ │ ├── raw/ │ ├── processed/ │ └── outputs/ │ └── final_dataset.json │ ├── logs/ │ └── git-log.md │ ├── agents/ │ ├── résumé-agent.md │ ├── image-agent.md │ └── prompt-guides.md │ ├── dashboards/ │ └── llm-dashboard.md │ └── templates/ └── ticket-template.md + +``` + +--- +- 📄 Un **template de note de ticket** (titre, Q/R, images, statut, script lié) +- 🧠 Un **dashboard d’actions** avec boutons (lancer script, exporter JSON, injecter dans LLM) +- 📁 Un plan d’organisation de ton vault Obsidian pour ce projet ? + +``` \ No newline at end of file diff --git a/command_list/Git commands.md b/command_list/Git commands.md index f8d0284..8accc5e 100644 --- a/command_list/Git commands.md +++ b/command_list/Git commands.md @@ -4,17 +4,23 @@ --- ## 🧠 Tableau récapitulatif des commandes Git utiles -| Commande Git | Utilité | -| --------------------------- | ------------------------------------------ | -| `git status` | Affiche les fichiers modifiés | -| `git add .` | Ajoute tous les fichiers à l’index | -| `git commit -m "message"` | Enregistre les changements avec un message | -| `git push` | Envoie les changements sur GitHub | -| `git pull` | Récupère les derniers changements | -| `git branch` | Liste les branches locales | -| `git switch ` | Change de branche | -| `git checkout -b ` | Crée et bascule sur une nouvelle branche | -| `git log --oneline` | Historique rapide des commits | -| `git stash` / `pop` | Sauvegarde temporaire de changements | +| Commande Git | Utilité | +| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | +| `git status` | Affiche les fichiers modifiés | +| `git add .` | Ajoute tous les fichiers à l’index | +| `git commit -m "message"` | Enregistre les changements avec un message | +| `git push` | Envoie les changements sur GitHub | +| `git pull` | Récupère les derniers changements | +| `git branch` | Liste les branches locales | +| `git switch ` | Change de branche | +| `git checkout -b ` | Crée et bascule sur une nouvelle branche | +| `git log --oneline` | Historique rapide des commits | +| `git stash` / `pop` | Sauvegarde temporaire de changements | +| git fetch origin
git reset --hard origin/nom_de_la_branche_distante` | Ecrase ta branche locale avec le contenu de la branche distante | +| git checkout -b nouvelle_branche
git fetch origin
git reset --hard origin/stable-version
| nouvelle_branche identique à origin/stable-version | +| git remote -v | URL du dépôt distant | +| git fetch origin
git merge origin/nom_de_la_branche | Mettre à jour une branche locale depuis un dépôt distant | +| git fetch origin
git reset --hard origin/nom_de_la_branche
| Mettre à jour en écrasant les modifications locales | +| git fetch --prune | Nettoie les fichiers obsolètes | --- diff --git a/inbox/ROBO_MAT_Code_WLangage_Organise.json b/inbox/ROBO_MAT_Code_WLangage_Organise.json new file mode 100644 index 0000000..e36f355 --- /dev/null +++ b/inbox/ROBO_MAT_Code_WLangage_Organise.json @@ -0,0 +1,6 @@ +{ + "clsMistral": {}, + "clsDeepSeek": {}, + "clsRAG": {}, + "clsDeepl": {} +} \ No newline at end of file diff --git a/inbox/Sans titre.md b/inbox/Sans titre.md new file mode 100644 index 0000000..e69de29 diff --git a/webdev/00_Template_Analyse_ROBO_MAT.md b/webdev/00_Template_Analyse_ROBO_MAT.md new file mode 100644 index 0000000..ca5e1ad --- /dev/null +++ b/webdev/00_Template_Analyse_ROBO_MAT.md @@ -0,0 +1,88 @@ +# 📦 Analyse complète du projet WebDev : ROBO_MAT + +> Objectif : Répertorier et analyser **tout le code WLangage** du projet, de manière organisée, pour une future conversion en Python. + +--- + +## 🗂️ Structure du projet + +- Nom du projet : `robo_mat` +- Source principale : `robo_mat.wdp` +- Type : WebDev - Application Web +- Structure récupérée depuis le système de fichiers + +--- + +## ✅ Plan d’extraction du code + +### 1. Pages (interface utilisateur) + +| Page | Contenu détecté | Code extrait ? | Remarques | +|------------|------------------|----------------|-----------| +| PAGE_TEST | Boutons + Événements | 🔲 Non / 🔳 En cours / ✅ Oui | À vérifier | + +--- + +### 2. Classes (fichiers .wdc) + +| Classe | But supposé | Code extrait ? | Remarques | +|---------------|---------------------|----------------|-----------| +| clsMistral | Interaction avec modèle LLM | 🔲 | Peut contenir méthodes d’appel API | +| clsOllama | Interaction avec Ollama local | 🔲 | Vérifier présence de prompt / réponse | +| clsDeepSeek | LLM externe ? | 🔲 | Source d’intelligence contextuelle ? | +| clsPerplexity | LLM externe ? | 🔲 | à creuser | +| clsRAG | RAG orchestrateur ? | 🔲 | Peut contenir la logique du flow | +| clsLLM | Classe commune ? | 🔲 | Factory ou interface commune ? | +| clsDeepl | Traduction ? | 🔲 | Fonction d’appel d’API DeepL ? | + +--- + +### 3. Procédures globales + +| Nom du fichier | Fonctions incluses | Code extrait ? | +|----------------|---------------------|----------------| +| info_connexion.gds | Connexion utilisateur ? | 🔲 | + +--- + +### 4. Code Projet (initialisation) + +- 🔲 À vérifier via `Projet > Code du projet` + +--- + +## 📌 Fichiers présents à analyser (non encore extraits) + +- [x] `robo_mat.wdp` ✅ 2025-03-24 +- [x] `PAGE_TEST.wwh` ✅ 2025-03-24 +- [x] Tous les `.wdc` de `/LLM/` ✅ 2025-03-24 +- [x] `info_connexion.gds` ✅ 2025-03-24 +- [x] Classement et extraction du code via interface WebDev ✅ 2025-03-24 +- [x] Explorateur de gauche → tout élément en **gras** ✅ 2025-03-24 +- [x] Utilisation du menu `Code > Tous les codes` pour compléter l’inventaire ✅ 2025-03-24 + +--- + +## 🧰 Étapes recommandées + +1. 📦 **Centraliser tous les éléments en gras** dans l’explorateur WebDev +2. 🧠 **Ouvrir chaque classe (.wdc)** et copier le code de chaque méthode +3. 📄 **Ouvrir PAGE_TEST.wwh** → bouton droit sur chaque champ > `Code` +4. 📋 Documenter manuellement ce que fait chaque méthode ou événement +5. 🗃️ Conserver un fichier `.md` par classe et par page + +--- + +## 🧪 Notes et observations + +> À compléter au fur et à mesure de l’extraction et de l’analyse + +- Exemple : La classe `clsMistral` contient une méthode `getResponse()` qui utilise une URL locale +- Exemple : Le bouton "Envoyer" de `PAGE_TEST` appelle `clsMistral::getResponse()` + +--- + +## 🧠 Finalité + +L’objectif est d’obtenir une **photographie fidèle du code WLangage**, structurée par fonctionnalité, pour permettre ensuite une **refonte en Python** claire et cohérente. +[[Analyse_ROBO_MAT_Complete]] diff --git a/webdev/01_WLangage_Récupération_Projet_WebDev.md b/webdev/01_WLangage_Récupération_Projet_WebDev.md new file mode 100644 index 0000000..13552fb --- /dev/null +++ b/webdev/01_WLangage_Récupération_Projet_WebDev.md @@ -0,0 +1,115 @@ +# 📁 Étape 1 — Identifier & comprendre un projet WebDev + +> 🧠 Objectif : Retrouver où est stocké ton projet WebDev, comprendre l’interface, et localiser les fichiers et sources de code WLangage à extraire. + +--- + +## 🧭 1. Où se trouve le dossier de ton projet WebDev ? + +### 🧩 Structure typique d’un projet WebDev : + +Quand tu ouvres un projet WebDev, il est composé de plusieurs dossiers/fichiers sur ton disque, comme : + +``` +MonProjet\ +├── MonProjet.WDP <- Fichier principal du projet +├── MonProjet_WEBDEV\ <- Contient les sources (pages, procédures, etc.) +│ ├── *.WDW <- Pages/fenêtres +│ ├── *.WDG <- Procédures globales +│ ├── *.WDM <- Analyse (base de données) +├── AAAWEB\ <- Code HTML/CSS/JS généré +├── EXE\ <- Résultat des générations +``` + +--- + +## 🧑‍💻 2. Retrouver l’emplacement du projet **depuis WebDev** + +> 💡 Si tu as déjà ton projet ouvert dans WebDev, voici comment trouver son emplacement exact : + +### 🔹 Étape 1 : Ouvrir les **informations du projet** + +1. En haut à gauche de WebDev : + 🖱️ Clique sur le **menu "Projet"** (dans la barre de menus principale). + +2. Dans ce menu : + 🖱️ Clique sur `Informations sur le projet…` + (_ou parfois juste `Projet > Propriétés du projet` selon ta version_) + +3. Une fenêtre s’ouvre avec plusieurs onglets. + +4. Dans l’onglet `Général`, tu verras : + - **Nom du projet** + - **Répertoire du projet** ← **copie ce chemin** ! + +> 📝 Note : Le fichier du projet principal se termine par `.WDP`. C’est lui que tu peux utiliser pour rouvrir le projet plus tard. + +--- + +## 🖥️ 3. Structure de l’interface WebDev (vue développeur) + +> 🧭 Voici les principales zones que tu dois repérer dans l’IDE WebDev : + +| Zone | À quoi ça sert ? | +|--------------------------|------------------| +| **Explorateur de projet** | Liste tous les éléments : pages, classes, procédures, composants, etc. | +| **Éditeur de code** | Permet d’écrire du WLangage pour les événements, procédures, classes, etc. | +| **Éditeur de page** | Interface graphique pour créer des pages (drag & drop, CSS, JS, champs, etc.) | +| **Panneau de propriétés** | Modifie les propriétés de l’élément actuellement sélectionné (nom, style, code, etc.) | + +--- + +## 📌 4. Naviguer dans ton projet WebDev + +Voici **les éléments de code à repérer** dans l'explorateur de projet : + +### 🔹 a. Pages + +1. Dans le volet de gauche (**Explorateur**), clique sur `Pages`. +2. Double-clique sur une page pour l’ouvrir. +3. Clique droit sur un champ ou bouton > `Code` → Tu vois les événements liés. + +### 🔹 b. Procédures globales + +1. Dans l’explorateur, repère un dossier nommé `Procédures globales`. +2. Clique droit dessus > `Ouvrir` ou `Code`. +3. Toutes les fonctions sont visibles et réutilisables dans tout le projet. + +### 🔹 c. Procédures locales (dans une page) + +1. Ouvre une page +2. Dans la fenêtre, clique sur l’icône `Code` ou via clic droit > `Code` +3. Les procédures locales sont affichées en haut ou dans un onglet + +### 🔹 d. Classes + +1. Explorateur > `Classes` (si ton projet en utilise) +2. Clic droit > `Code` → Tu y vois la déclaration et les méthodes + +--- + +## 💡 Astuce : Revenir rapidement sur ton projet + +- Depuis WebDev : + Menu `Fichier > Ouvrir un projet récent` + +- Depuis ton disque : + Double-clique sur le fichier `.WDP` du dossier projet + +--- + +## ✅ À faire maintenant + +- [x] Ouvre `Projet > Informations sur le projet` et note le chemin. ✅ 2025-03-24 +- [x] Explore l’explorateur WebDev et note les pages, procédures, classes disponibles. ✅ 2025-03-24 +- [x] Clique sur une page > bouton droit > `Code` → vérifie que tu peux lire les événements. ✅ 2025-03-24 +- [x] Idem pour une procédure globale ou une classe. ✅ 2025-03-24 + +--- + +## 📘 Prochaine étape (à venir) + +👉 Extraire le code manuellement ou semi-automatiquement (copier/coller ou repérage des fichiers sources `.WDG`, `.WDW`, etc.). + +--- +[[Application webdev (1)]] \ No newline at end of file diff --git a/webdev/Analyse_ROBO_MAT_Complete.md b/webdev/Analyse_ROBO_MAT_Complete.md new file mode 100644 index 0000000..55c12e9 --- /dev/null +++ b/webdev/Analyse_ROBO_MAT_Complete.md @@ -0,0 +1,1511 @@ +# 📘 Analyse complète du projet WebDev : ROBO_MAT + +> Objectif : Regrouper **tout le code WLangage** du projet dans un seul fichier `.md`, organisé selon les conventions et les sections de WebDev, afin de faciliter la compréhension, l’analyse et la réécriture en Python. + +--- + +## 🧭 Table des matières + +1. [Code du projet (initialisation/fermeture)](#code-du-projet) +2. [Pages](#pages) + - [PAGE_TEST](#page_test) +3. [Classes](#classes) + - [clsMistral](#clsMistral) + - [clsOllama](#clsOllama) + - [clsDeepSeek](#clsDeepSeek) + - [clsPerplexity](#clsPerplexity) + - [clsRAG](#clsRAG) + - [clsLLM](#clsLLM) + - [clsDeepl](#clsDeepl) +4. [Procédures globales](#procedures-globales) + - [info_connexion.gds](#info_connexion) + +--- + +## 🔧 Code du projet + +### ▶️ Initialisation du projet +```wlanguage + +``` + +### ⏹️ Fermeture du projet +```wlanguage + +``` + +--- + +## 📄 Pages + +### 🧩 PAGE_TEST + +#### 🏗️ Déclaration +```wlanguage + +``` + +#### ▶️ Événements +```wlanguage + +``` + +#### 🔧 Terminaison +```wlanguage + +``` + +#### 📍 Autres onglets (si présents) +```wlanguage + +``` + +--- + +## 🧱 Classes + +> 💡 Pour chaque classe, on respecte les sections affichées dans WebDev : **Déclaration, Constructeur, Destructeur, Méthodes, etc.** + +### 🧠 clsMistral + +#### 🔹 Déclaration de clsMistral +```wlanguage +clsMistral est une Classe + hérite de clsLLM + maxToken est un entier + seed est un entier + presence_penalty est un réel + frequency_penalty est un réel + n est un entier + prediction est un JSON + safe_prompt est un booléen + o_stop est une chaîne + PRIVÉ + m_tabModels est un tableau de chaînes +FIN +``` + +#### Terminaison de clsMistral +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() + +//:Modele = "open-mixtral-8x22b-2404" +:Modele = "mistral-large-latest" +:o_temperature = 0.2 +:o_top_p = 1 +:maxToken = 1000 +:presence_penalty = 0 +:frequency_penalty = 0 +:n=1 +prediction.type = "content" +prediction.content = "" +safe_prompt = Faux +o_stop = "string" +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE PUBLIQUE model_list() +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant + +SI TableauOccurrence(m_tabModels) > 1 ALORS + RENVOYER (m_tabModels) +FIN + +reqLLM.URL = :urlBase+"models" +reqLLM.Méthode = httpGet +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = "Bearer " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 200 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + POUR i = 1 _À_ TableauOccurrence(vReponse.data) + TableauAjoute(m_tabModels,vReponse.data[i].id) + FIN +SINON + TableauAjoute(m_tabModels,hReponse.Contenu) +FIN +RENVOYER(m_tabModels) +``` + +#### Affectation de la propriété model_list +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PUBLIQUE urlBase() +RENVOYER("https://api.mistral.ai/v1/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PUBLIQUE cleAPI() + +RENVOYER("2iGzTzE9csRQ9IoASoUjplHwEjA200Vh") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE PUBLIQUE urlFonction() + +RENVOYER("chat/completions") +``` +#### Affectation de la propriété urlFonction +```wlangage + +``` +#### ❌ Destructeur +```wlanguage +PROCÉDURE Destructeur() + +``` + +#### 📦 Méthode interrogerRetourneReponse +```wlanguage +PROCÉDURE PROTÉGÉE interrogerRetourneReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne +vReponse est un Variant +vReponse = JSONVersVariant(sReponse) +sRetour = vReponse.choices[1].message.content +RENVOYER(sRetour) +``` +#### Méthode even_LLM_POST +```wlangage +/* +Model (string) or Model (null) (Model) + +ID of the model to use. You can use the List Available Models API to see all of your available models, or see our Model overview for model descriptions. +Temperature (number) or Temperature (null) (Temperature) + +What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. The default value varies depending on the model you are targeting. Call the /models endpoint to retrieve the appropriate value. +top_p +number (Top P) [ 0 .. 1 ] +Default: 1 + +Nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. +Max Tokens (integer) or Max Tokens (null) (Max Tokens) + +The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. +stream +boolean (Stream) +Default: false + +Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. +Stop (string) or Array of Stop (strings) (Stop) + +Stop generation if this token is detected. Or if one of these tokens is detected when providing an array +Random Seed (integer) or Random Seed (null) (Random Seed) + +The seed to use for random sampling. If set, different calls will generate deterministic results. +required + +Array of any (Messages) + +The prompt(s) to generate completions for, encoded as a list of dict with role and content. +object (ResponseFormat) +Array of Tools (objects) or Tools (null) (Tools) +ToolChoice (object) or ToolChoiceEnum (string) (Tool Choice) +Default: "auto" +presence_penalty +number (Presence Penalty) [ -2 .. 2 ] +Default: 0 + +presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. +frequency_penalty +number (Frequency Penalty) [ -2 .. 2 ] +Default: 0 + +frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. +N (integer) or N (null) (N) + +Number of completions to return for each request, input tokens are only billed once. +object (Prediction) +Default: {"type":"content","content":""} + +Enable users to specify expected results, optimizing response times by leveraging known or predictable content. This approach is especially effective for updating text documents or code files with minimal changes, reducing latency while maintaining high-quality results. +safe_prompt +boolean +Default: false + +Whether to inject a safety prompt before all conversations. + + + +*/ +PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne ) + +Contenu.messages[1].role = "system" +Contenu.messages[1].content = :prompt_system +Contenu.messages[2].role = "user" +Contenu.messages[2].content = sQuestion +Contenu.temperature = o_temperature +Contenu.top_p = o_top_p +SI :maxToken <> 0 ALORS + Contenu.max_tokens = maxToken +FIN +SI :seed <> 0 ALORS + Contenu.random_seed = :seed +FIN +SI :format <> "" ALORS + Contenu.response_format = :format +FIN +// Contenu.tools A déterminer +// Contenu.tool_choice A déterminer +Contenu.presence_penalty = presence_penalty +Contenu.frequency_penalty = frequency_penalty +Contenu.n = 1 +Contenu.prediction = :prediction +Contenu.stop = o_stop +``` +--- + +### 🧠 clsOllama +#### 🔹 Déclaration +```wlanguage +clsOllama est une Classe + hérite de clsLLM + + suffix est une chaîne + images est un Buffer + + // Options : Définie ci-dessous + template est une chaîne // le modèle d'invite à utiliser (remplace ce qui est défini dans le Modelfile) + // stream est un booléen Définie en protégé car webdev ne fonctionne pas avec le stream activé + raw est un booléen // si true, aucun formatage ne sera appliqué à l'invite. Vous pouvez choisir d'utiliser le paramètre raw si vous spécifiez une invite entièrement formatée dans votre demande à l'API. + keep_alive est une Durée // contrôle la durée pendant laquelle le modèle restera chargé en mémoire à la suite de la demande (par défaut : 5m) + + o_mirostat est un entier // Active l'échantillonnage Mirostat pour contrôler la perplexité. (par défaut : 0, 0 = désactivé, 1 = Mirostat, 2 = Mirostat 2.0) + o_mirostat_eta est un réel // Influe sur la vitesse à laquelle l'algorithme réagit au retour d'information du texte généré. Un taux d'apprentissage plus faible entraînera des ajustements plus lents, tandis qu'un taux d'apprentissage plus élevé rendra l'algorithme plus réactif. (Valeur par défaut : 0,1) + o_mirostat_tau est un réel // Contrôle l'équilibre entre la cohérence et la diversité du résultat. Une valeur plus faible permet d'obtenir un texte plus ciblé et plus cohérent. (Valeur par défaut : 5.0) + o_num_ctx est un entier // Définit la taille de la fenêtre contextuelle utilisée pour générer le prochain jeton. (Valeur par défaut : 2048) + o_repeat_last_n est un entier // Définit la distance à laquelle le modèle doit regarder en arrière pour éviter les répétitions. (Par défaut : 64, 0 = désactivé, -1 = num_ctx) + o_repeat_penalty est un réel // Définit le degré de pénalisation des répétitions. Une valeur plus élevée (par exemple, 1,5) pénalisera plus fortement les répétitions, tandis qu'une valeur plus faible (par exemple, 0,9) sera plus indulgente. (Valeur par défaut : 1,1) + + o_seed est un entier // Définit la graine de nombres aléatoires à utiliser pour la génération. En définissant un nombre spécifique, le modèle générera le même texte pour la même invite (valeur par défaut : 0). + o_stop est un JSON // Définit les séquences d'arrêt à utiliser. Lorsque ce modèle est rencontré, le LLM arrête de générer du texte et revient. Plusieurs motifs d'arrêt peuvent être définis en spécifiant plusieurs paramètres d'arrêt distincts dans un fichier modèle. + o_num_predict est un entier // Nombre maximum de tokens à prédire lors de la génération de texte. (Valeur par défaut : -1, génération infinie) + o_min_p est un réel // Alternative au top_p, elle vise à assurer un équilibre entre la qualité et la variété. Le paramètre p représente la probabilité minimale pour qu'un jeton soit pris en considération, par rapport à la probabilité du jeton le plus probable. Par exemple, avec p=0,05 et le jeton le plus probable ayant une probabilité de 0,9, les logits ayant une valeur inférieure à 0,045 sont filtrés. (Valeur par défaut : 0,0) + + // Regarder la rubrique "TEMPLATE" + + /* + Dans l'API d'Ollama, le paramètre template dans la fonction POST /api/generate permet de spécifier un modèle de prompt personnalisé qui remplace celui défini dans le fichier de modèle (Modelfile). Le modèle de prompt est utilisé pour structurer la manière dont le modèle générera sa réponse en fonction du prompt fourni. + + Par défaut, chaque modèle Ollama est associé à un modèle de prompt prédéfini, tel que : + + Copier + {{ .System }} + {{ .Prompt }} + En utilisant le paramètre template, vous pouvez fournir un modèle de prompt spécifique pour une requête donnée, ce qui permet de personnaliser la structure de la réponse du modèle pour cette interaction particulière. + + Par exemple, si vous souhaitez que le modèle réponde sous forme de liste numérotée, vous pouvez inclure le paramètre template dans votre requête comme suit + { + "model": "votre_modele", + "prompt": "Énumérez les étapes pour préparer une tasse de thé.", + "template": "{{ .System }}\n1. {{ .Prompt }}\n2. Faites chauffer de l'eau.\n3. Infusez le thé.\n4. Servez et dégustez." + } + */ + +FIN +``` + +#### Terminaison de clsOllama +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +o_mirostat = 0 +o_mirostat_eta = 0.1 +o_mirostat_tau = 5 +o_num_ctx = 2048 +o_repeat_last_n = 64 +o_repeat_penalty = 1.1 +o_temperature = 0.8 +o_seed = 0 +o_stop = [] +o_num_predict = -1 +o_top_k = 40 +o_top_p = 0.9 +o_min_p = 0 + + +raw = False +keep_alive = 5min +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne +RENVOYER("http://217.182.105.173:11434/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne +RENVOYER("") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### ❌ Destructeur +```wlanguage +PROCÉDURE Destructeur() + +``` +### Méthode Interroger +```wlangage +PROCÉDURE Interroger(LOCAL sQuestion est une chaîne ) +m_sUrlFonction = "api/generate" +RENVOYER(LLM_POST(sQuestion)) +``` +#### Méthode even_LLM_POST +```wlangage +PROCÉDURE PROTÉGÉ VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne) +Contenu.system = :prompt_system +Contenu.prompt = sQuestion +Contenu.stream = :stream +Contenu.suffix = :suffix +Contenu.format = :format +Contenu.raw = :raw +Contenu.keep_alive = :keep_alive +SI :images <> "" ALORS + // A traiter +FIN + +Contenu.options.mirostat = o_mirostat +Contenu.options.mirostat_eta = o_mirostat_eta +Contenu.options.mirostat_tau = o_mirostat_tau +Contenu.options.num_ctx = o_num_ctx +Contenu.options.repeat_last_n = o_repeat_last_n +Contenu.options.repeat_penalty = o_repeat_penalty +Contenu.options.temperature = o_temperature +Contenu.options.seed = o_seed +Contenu.options.stop = o_stop +Contenu.options.num_predict = o_num_predict +Contenu.options.top_k = o_top_k +Contenu.options.top_p = o_top_p +Contenu.options.min_p = o_min_p + + +``` + +#### 📦 Méthode interrogerRetourneReponse +```wlanguage +PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne ) +vMaReponse est un Variant +vMaReponse = JSONVersVariant(sReponse) +RENVOYER(vMaReponse.response) +``` + +--- + +### 🧠 clsDeepSeek +#### 🔹 Déclaration de clsDeepSeek +```wlanguage +clsDeepSeek est une Classe + hérite de clsLLM + frequency_penalty est un entier // Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + max_tokens est un entier /* integer between 1 and 8192. The maximum number of tokens that can be generated in the chat completion. + The total length of input tokens and generated tokens is limited by the model's context length. + IF max_tokens is NOT specified, the Default value 4096 is used. + */ + presence_penalty est un entier //Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + logprobs est un booléen // Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. + top_logprobs est un entier // An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. + tool_choice est une chaîne /* Controls which (if any) tool is called by the model. + none means the model will not call any tool and instead generates a message. + auto means the model can pick between generating a message or calling one or more tools. + required means the model must call one or more tools. + Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. + none is the default when no tools are present. auto is the default if tools are present. + */ +FIN + +``` +#### Terminaison de clsDeepSeek +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() + +:Modele = "deepseek-chat" +frequency_penalty = 0 +max_tokens = 4096 +presence_penalty = 0 +o_top_p = 1 +logprobs = Faux +top_logprobs = 0 +tool_choice = "" +``` +Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne + +RENVOYER("sk-d359d9236ca84a5986f889631832d1e6") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne + +RENVOYER("https://api.deepseek.com/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE urlFonction() : chaîne + +RENVOYER("chat/completions") +``` +#### Affectation de la propiété urlFonction +```wlangage +PROCÉDURE urlFonction(Valeur est une chaîne) +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE model_list() : tableau de chaînes + +tabRetour est un tableau de chaînes = ["deepseek-chat","deepseek-reasoner"] +RENVOYER(tabRetour) +``` +#### Affectation de la propriété model_list +```wlangage + +``` +#### destructeur +```wlangage +PROCÉDURE Destructeur() +``` +#### 📦 Méthode even_LLM_POST +```wlanguage +PROCÉDURE PROTÉGÉ VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne ) + +Contenu.messages[1].role = "system" +Contenu.messages[1].content = :prompt_system +Contenu.messages[2].role = "user" +Contenu.messages[2].content = sQuestion +Contenu.stream = :stream +Contenu.frequency_penalty = :frequency_penalty +Contenu.max_tokens = :max_tokens +Contenu.presence_penalty = :presence_penalty +SI :logprobs = Vrai ALORS + Contenu.logprobs = :logprobs + Contenu.top_logprobs = :top_logprobs +FIN +SI :tool_choice <> "" ALORS + Contenu.tool_choice = :tool_choice +FIN +``` +#### Méthode interrogerRetourReponse +```wlangage +PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne +vReponse est un Variant +vReponse = JSONVersVariant(sReponse) +sRetour = vReponse.choices[1].message.content +RENVOYER(sRetour) +``` + +--- +### 🧠 clsPerplexity +#### 🔹 Déclaration de clsPerplexity +```wlanguage +clsPerplexity est une Classe + hérite de clsLLM + maxToken est un entier + presence_penalty est un entier + frequency_penaly est un entier + search_recency_filter est une chaîne + search_domain_filter est un tableau de chaîne +FIN +``` +#### Terminaison de clsPerplexity +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +maxToken = 1000 +o_temperature = 0.5 +o_top_p = 0.8 +o_top_k = 0 +presence_penalty = 0 +frequency_penaly = 1 +search_recency_filter = "all" // year +prompt_system = "Soyez précis et concis. Répondez uniquement en français. Effectuez une recherche approfondie et fournissez des informations détaillées et à jour." +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne +RENVOYER("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") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne +RENVOYER("https://api.perplexity.ai/chat/completions") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### ❌ Destructeur +```wlanguage +PROCÉDURE Destructeur() + +``` +### Méthode Interroger +```wlangage +PROCÉDURE Interroger(LOCAL sQuestion est une chaîne) +:Modele = "sonar" +RENVOYER(LLM_POST(sQuestion)) +``` +#### Méthode even_LLM_POST +```wlangage +PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne) + +Contenu.messages[1].role = "system" +Contenu.messages[1].content = :prompt_system +Contenu.messages[2].role = "user" +Contenu.messages[2].content = sQuestion +SI :maxToken <> 0 ALORS + Contenu.max_tokens = maxToken +FIN +Contenu.temperature = o_temperature +SI :format <> "" ALORS + Contenu.response_format = :format +FIN +Contenu.top_p =o_top_p +SI TableauOccurrence(search_domain_filter) <> 0 ALORS + // ["perplexity.ai"] + Contenu.search_domain_filter = search_domain_filter +FIN +Contenu.return_images = Faux +Contenu.return_related_questions = Faux +SI search_recency_filter <> "all" ALORS + Contenu.search_recency_filter = search_recency_filter +FIN +Contenu.top_k = o_top_k +Contenu.presence_penalty = presence_penalty +Contenu.frequency_penalty = frequency_penaly +Contenu.response_format = Null +``` +#### Méthode interrogerRetourneReponse +```wlangage +/* +Format de sortie +{ + "id":"f5fd096e-b694-4135-8fd2-ab241e3c15bf", + "model":"sonar", + "created":1738769945, + "usage": + { + "prompt_tokens":13, + "completion_tokens":72, + "total_tokens":85 + }, + "citations": + [ + "https://www.youtube.com/watch?v=TOrph-vS_a8", + "https://www.teidebynight.com/how-many-stars-are-in-the-milky-way/" + ], + "object":"chat.completion", + "choices": + [ + { + "index":0, + "finish_reason":"stop", + "message": + { + "role":"assistant", + "content":"The Milky Way galaxy is estimated to contain between **100 billion and 400 billion stars**. A more precise estimate suggests that there are approximately **100 billion stars** in our galaxy. These estimates vary due to the challenges of counting stars, such as the presence of gas, dust, and black holes that obscure many stars from view[1][2]." + }, + "delta": + { + "role":"assistant", + "content":"" + } + } + ] +} +*/ +PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne ) +vRepoonse est un Variant = JSONVersVariant(sReponse) +sRetour est une chaîne +sRetour = vRepoonse.choices[1].message.content + +RENVOYER(sRetour) +``` + +--- + +### 🧠 clsRAG +#### 🔹 Déclaration de clsRAG +```wlanguage +clsRAG est une Classe +PUBLIQUE CONSTANT + sessionID est une chaîne +PRIVÉ + reqRAG est une restRequête + taContenu est un tableau associatif de Variant + m_sChatID est une chaîne + mn_Question est un entier +FIN +``` +#### Terminaison de clsRAG +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +reqRAG.Entête["Authorization"] = "Bearer " + "ragflow-c4YTNkMzcwZDM1ODExZWZiODA2MDI0Mm" +reqRAG.Entête["Content-Type"] = "application/json" + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PRIVÉE urlBase() + +RENVOYER("http://10.103.0.100/api/v1/chats/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété chatID +```wlangage +PROCÉDURE PRIVÉE chatID() +SI m_sChatID <> "" ALORS + RENVOYER(m_sChatID) +SINON + RENVOYER("ffb1058ed4b811ef8a900242ac120003") +FIN + +``` +#### Affectation de la propriété chatID +```wlangage +PROCÉDURE PRIVÉ chatID(Valeur) + +m_sChatID = Valeur +``` +#### Récupération de la propriété Contenu +```wlangage +PROCÉDURE PRIVÉE Contenu() +bufContenu est un Buffer +Sérialise(taContenu,bufContenu,psdJSON) +RENVOYER(bufContenu) +``` +#### Affectation de la propriété Contenu +```wlangage + +``` +#### Récupération de la propriété urlChat +```wlangage +PROCÉDURE PRIVÉE urlChat() + +RENVOYER(:urlBase+chatID+"/") +``` +#### Affectation de la propriété urlChat +```wlangage + +``` +#### Destructeur +```wlangage +PROCÉDURE Destructeur() + +SI mn_Question = 0 OU EnModeTest() ALORS + supprimeSessionChat() +FIN +``` +#### 📦 Méthode creeSessionChat +```wlanguage +PROCÉDURE PRIVÉ creeSessionChat() +vMaReponse est un Variant +hReponse est une httpRéponse +TableauSupprimeTout(taContenu) +reqRAG.URL = :urlChat+"sessions" +reqRAG.Méthode = httpPost +taContenu["name"] = DateHeureVersChaîne(DateHeureSys,"AAAAMMJJ_HHmmSS") +reqRAG.Contenu = :Contenu + +hReponse = RESTEnvoie(reqRAG) +SI ErreurDétectée ALORS + RENVOYER(Faux,TexteVersHTML(ErreurInfo())) +SINON + vMaReponse = JSONVersVariant(hReponse.Contenu) + SI vMaReponse.code = 0 + :sessionID = vMaReponse.data.id + RENVOYER(Vrai,:formateReponse(vMaReponse.data.messages[1].content)) + SINON + RENVOYER(Faux,:formateReponse(vMaReponse.message)) + FIN +FIN +``` +#### Méthode Chat +```wlangage +PROCÉDURE Chat(LOCAL sQuestion est une chaîne) +bSessionCree est un booléen +sReponse est une chaîne +vMaReponse est un Variant +SI :sessionID = "" ALORS + (bSessionCree,sReponse) = creeSessionChat() + SI PAS bSessionCree ALORS + RENVOYER(:formateReponse(sReponse)) + FIN +FIN + +mn_Question++ +hReponse est une httpRéponse +TableauSupprimeTout(taContenu) +reqRAG.URL = :urlChat+"completions" +reqRAG.Méthode = httpPost +taContenu["question"] = sQuestion +taContenu["stream"] = False +taContenu["session_id"] = :sessionID +reqRAG.Contenu = :Contenu + +hReponse = RESTEnvoie(reqRAG) +SI ErreurDétectée ALORS + RENVOYER(TexteVersHTML(ErreurInfo())) +SINON + vMaReponse = JSONVersVariant(hReponse.Contenu) + SI vMaReponse.code = 0 ALORS + sReponse = vMaReponse.data.answer + RENVOYER(:formateReponse(sReponse)) + SINON + sReponse = vMaReponse.message + RENVOYER(:formateReponse(sReponse)) + FIN +FIN +``` +### Méthode formateReponse +```wlangage +PROCÉDURE PUBLIQUE formateReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne ANSI +sRetour+="
" +sRetour+=UnicodeVersAnsi(UTF8VersUnicode(MarkdownVersHTML(sReponse))) +sRetour+="
" +//sRetourANSI = UnicodeVersAnsi(sRetourUnicode) +RENVOYER(sRetour) +``` +#### Méthode formateQuestion +```wlangage +PROCÉDURE GLOBALE formateQuestion(LOCAL sQuestion est une chaîne) +sRetour est une chaîne +sRetour = "
" +sRetour+= sQuestion +sRetour+= "
" +RENVOYER(sRetour) +``` +#### Méthode supprimeSessionChat +```wlangage +PROCÉDURE PRIVÉ supprimeSessionChat() +vMaReponse est un Variant +sReponse est une chaîne +hReponse est une httpRéponse +TableauSupprimeTout(taContenu) +reqRAG.URL = :urlChat+"/sessions" +reqRAG.Méthode = httpDelete +taContenu["ids"] = [sessionID] +reqRAG.Contenu = :Contenu + +hReponse = RESTEnvoie(reqRAG) +SI ErreurDétectée ALORS + RENVOYER(TexteVersHTML(ErreurInfo())) +SINON + vMaReponse = JSONVersVariant(hReponse.Contenu) + SI vMaReponse.code = 0 ALORS + RENVOYER("OK") + SINON + sReponse = vMaReponse.message + RENVOYER(sReponse) + FIN +FIN + +``` + +--- + +### 🧠 clsLLM +#### 🔹 Déclaration de clsLLM +```wlanguage +clsLLM est une Classe + PUBLIQUE + // Paramètres + Modele est une chaîne + prompt_system est une chaîne // message système à (remplace ce qui est défini dans le fichier modèle) + + o_temperature est un réel // La température du modèle. En augmentant la température, le modèle répondra de manière plus créative. (Valeur par défaut : 0,8) + + // Options + // https://github.com/ollama/ollama/blob/main/docs/modelfile.md#format + o_top_k est un entier // Réduit la probabilité de générer des non-sens. Une valeur plus élevée (par exemple 100) donnera des réponses plus diversifiées, tandis qu'une valeur plus faible (par exemple 10) sera plus conservatrice. (Valeur par défaut : 40) + o_top_p est un réel // Fonctionne avec top-k. Une valeur élevée (par exemple, 0,95) conduira à un texte plus diversifié, tandis qu'une valeur plus faible (par exemple, 0,5) générera un texte plus ciblé et conservateur. (Valeur par défaut : 0,9) + PUBLIQUE CONSTANTE + dureeTraitement est une Durée + reponseErreur est un booléen + PROTÉGÉ + Contenu est un JSON + m_sUrlFonction est une chaîne + stream est un booléen + m_sFormat est une chaîne + heureDepart est une Heure + heureFin est une Heure +FIN +``` +#### Terminaison de clsLLM +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +stream = Faux +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉ ABSTRAITE urlBase() : chaîne +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉ ABSTRAITE cleAPI() :chaîne +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE PUBLIQUE urlFonction() +RENVOYER(m_sUrlFonction) +``` +#### Affectation de la propriété urlFonction +```wlangage +PROCÉDURE PUBLIQUE urlFonction(Valeur) +m_sUrlFonction = Valeur +``` +#### Récupération de la propriété format +```wlangage +PROCÉDURE PUBLIQUE format() + +RENVOYER(m_sFormat) +``` +#### Affectation de la propriété format +```wlangage +PROCÉDURE PUBLIQUE format(Valeur) +m_sFormat = Valeur +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE PUBLIQUE model_list():tableau de chaînes +tabModels est un tableau de chaînes +RENVOYER(tabModels) +``` +#### Affectation de la propriété model_list +```wlangage + +``` +#### Récupération de la propriété commandeAutorisation +```wlangage +PROCÉDURE PUBLIQUE commandeAutorisation() + +RENVOYER("Bearer") +``` +#### Affectation de la propriété commandeAutorisation +```wlangage + +``` +#### Destructeur +```wlangage +PROCÉDURE Destructeur() +``` +#### 📦 Méthode Interroger +```wlanguage +PROCÉDURE Interroger(LOCAL sQuestion est une chaîne):chaîne +sReponse est une chaîne +sReponse = LLM_POST(sQuestion) +RENVOYER(sReponse) +``` +#### Méthode LLM_POST +```wlangage +PROCÉDURE PROTÉGÉE LLM_POST(LOCAL sQuestion est une chaîne):chaîne +sErreur est une chaîne +sReponse est une chaîne +hReponse est une httpRéponse +reqLLM est une restRequête + + +reqLLM.URL = :urlBase+urlFonction +reqLLM.Méthode = httpPost +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation+ " " + :cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" + +Contenu="" +SI :Modele <> "" ALORS + Contenu.model = :Modele +FIN + +even_LLM_POST(sQuestion) + +reqLLM.Contenu = Contenu +reqLLM..DuréeNonRéponse = 2min +dureeTraitement = 0 +heureDepart = HeureSys() +hReponse = RESTEnvoie(reqLLM) +SI ErreurDétectée ALORS + reponseErreur = Vrai + RENVOYER(ErreurInfo(errComplet)) +FIN +SI hReponse.CodeEtat = 200 OU hReponse.CodeEtat = 201 ALORS + sReponse = interrogerRetourneReponse(hReponse.Contenu) + heureFin = HeureSys() + dureeTraitement = heureFin - heureDepart + reponseErreur = Faux + RENVOYER(sReponse) +SINON + sErreur = hReponse.Contenu + heureFin = HeureSys() + dureeTraitement = heureFin - heureDepart + reponseErreur = Vrai + RENVOYER(sErreur) +FIN +``` +#### Méthode even_LLM_POST +```wlangage +PROCÉDURE PROTÉGÉE ABSTRAITE VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne ) +``` +#### Méthode interrogerRetourneReponse +```wlangage +PROCÉDURE PROTÉGÉ ABSTRAITE VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne ):chaîne +``` + +--- + +### 🧠 clsDeepl +#### 🔹 Déclaration de clsDeepl +```wlanguage +clsDeepl est une Classe + hérite de clsLLM + langueSource est une chaîne + langueDesti est une chaîne + context est une chaîne + split_sentences est une chaîne + preserve_formatting est un booléen + formality est une chaîne + show_billed_characters est un booléen + tag_handling est une chaîne + outline_detection est un booléen + non_splitting_tags est un tableau de chaînes + splitting_tags est un tableau de chaînes + ignore_tags est un tableau de chaînes +PUBLIC CONSTANTE + glossaire_id est un tableau associatif (ccSansCasse) de chaînes + m_tabGlossaireListePaire est un tableau de 0 par 2 chaînes + +FIN +``` +#### Terminaison de clsDeepl +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() + +langueSource = "FR" +langueDesti = "EN" +Modele = "prefer_quality_optimized" +split_sentences = 0 +preserve_formatting = Vrai +formality = "default" // more less prefer_mode prefer_less +show_billed_characters = Faux +tag_handling = "" // xml html +outline_detection = Vrai +``` +#### Récupération de la propriété commandeAutorisation +```wlangage +PROCÉDURE PUBLIQUE commandeAutorisation() +RENVOYER("DeepL-Auth-Key") +``` +#### Affectation de la propriété commandeAutorisation +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne + +RENVOYER("d42ee2f7-f4e6-d437-3237-fa40b4f45e65") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne +RENVOYER("https://api.deepl.com/v2/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE urlFonction() : chaîne +RENVOYER("translate") +``` +#### Affectation de la propriété urlFonction +```wlangage +PROCÉDURE urlFonction(Valeur est une chaîne) +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE model_list() : tableau de chaînes +tabModel est un tableau de chaîne +TableauAjoute(tabModel,"quality_optimized") +TableauAjoute(tabModel,"latency_optimized") +TableauAjoute(tabModel,"prefer_quality_optimized") +RENVOYER(tabModel) +``` +#### Affectation de la propriété model_list +```wlangage + +``` +#### Récupération de la propriété glossaire_liste_paire_possible +```wlangage +PROCÉDURE PUBLIQUE glossaire_liste_paire_possible() +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant +SI TableauOccurrence(m_tabGlossaireListePaire) > 1 ALORS + RENVOYER(m_tabGlossaireListePaire) +FIN +reqLLM.URL = :urlBase+"glossary-language-pairs" +reqLLM.Méthode = httpGet +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 200 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + TableauSupprimeTout(m_tabGlossaireListePaire) + POUR i = 1 _À_ TableauOccurrence(vReponse.supported_languages) + TableauAjouteLigne(m_tabGlossaireListePaire,vReponse.supported_languages[i].source_lang,vReponse.supported_languages[i].target_lang) + FIN +SINON + TableauAjoute(m_tabGlossaireListePaire,hReponse.Contenu) +FIN +RENVOYER(m_tabGlossaireListePaire) +``` +#### Affectation de la propriété glossaire_liste_paire_possible +```wlangage + +``` +#### Destructeur +```wlangage +PROCÉDURE Destructeur() +``` +#### 📦 Méthode even_LLM_POST +```wlanguage +/* + +Voir https://developers.deepl.com/docs/api-reference/translate + +text (required) + +Text to be translated. Only UTF-8-encoded plain text is supported. The parameter may be specified multiple times and translations are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences. Up to 50 texts can be sent for translation in one request. + +Type: array[string] + +source_lang (optional) + +Language of the text to be translated. If omitted, the API will attempt to detect the language of the text and translate it. You can find supported source languages here. + +Type: string + +target_lang (required) + +The language into which the text should be translated. You can find supported target languages here. + +Type: string + +context (optional) + +The context parameter makes it possible to include additional context that can influence a translation but is not translated itself. This additional context can potentially improve translation quality when translating short, low-context source texts such as product names on an e-commerce website, article headlines on a news website, or UI elements. + +For example: + + When translating a product name, you might pass the product description as context. + + When translating a news article headline, you might pass the first few sentences or a summary of the article as context. + + For best results, we recommend sending a few complete sentences of context in the same language as the source text. There is no size limit for the contextparameter itself, but the request body size limit of 128 KiB still applies to all text translation requests. + + If you send a request with multiple text parameters, the context parameter will be applied to each one. + + Characters included in the context parameter will not be counted toward billing (i.e. there is no additional cost for using the context parameter, and only characters sent in the text parameter(s) will be counted toward billing for text translation even when the context parameter is included in a request). + + Type: string + + model_type (optional) + + Specifies which DeepL model should be used for translation. The quality_optimized value is supported only in the Pro v2 API at this time (https://api.deepl.com/v2/translate). + + Possible values are: + + latency_optimized (uses lower latency “classic” translation models, which support all language pairs; default value) + + quality_optimized (uses higher latency, improved quality “next-gen” translation models, which support only a subset of language pairs; if a language pair that is not supported by next-gen models is included in the request, it will fail. Consider using prefer_quality_optimized instead.) + + prefer_quality_optimized (prioritizes use of higher latency, improved quality “next-gen” translation models, which support only a subset of DeepL languages; if a request includes a language pair not supported by next-gen models, the request will fall back to latency_optimized classic models) + + Requests with the model_type parameter will include an additional response field model_type_used to specify whether DeepL’s latency_optimized or quality_optimized model was used for translation. + + Note: in the future, if DeepL’s quality optimized models achieve language pair and latency performance parity with classic models, it’s possible that next-gen models will be used regardless of the value passed in the model_type parameter. + + Language pairs supported by DeepL’s next-gen models are documented below. + + + Type: enum + + split_sentences (optional) + + Sets whether the translation engine should first split the input into sentences. For text translations where tag_handling is not set to html, the default value is 1, meaning the engine splits on punctuation and on newlines. + + For text translations where tag_handling=html, the default value is nonewlines, meaning the engine splits on punctuation only, ignoring newlines. + + + The use of nonewlines as the default value for text translations where tag_handling=html is new behavior that was implemented in November 2022, when HTML handling was moved out of beta. + + Possible values are: + + 0 - no splitting at all, whole input is treated as one sentence + + 1 (default when tag_handling is not set to html) - splits on punctuation and on newlines + + nonewlines (default when tag_handling=html) - splits on punctuation only, ignoring newlines + + For applications that send one sentence per text parameter, we recommend setting split_sentences to 0, in order to prevent the engine from splitting the sentence unintentionally. + + + Please note that newlines will split sentences when split_sentences=1. We recommend cleaning files so they don't contain breaking sentences or setting the parameter split_sentences to nonewlines. + + Please note that this value will be ignored when using next-gen models (model_type_used=quality_optimized) and a value of... + + 0will be used if tag_handlingis not enabled + + nonewlines will be used if tag_handlingis enabled + + ...as these settings yield the best quality. + + Type: string + + preserve_formatting (optional) + + Sets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. + + The formatting aspects affected by this setting include: + + Punctuation at the beginning and end of the sentence + + Upper/lower case at the beginning of the sentence + + Type: boolean + + formality (optional) + + Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages DE (German), FR (French), IT (Italian), ES (Spanish), NL (Dutch), PL (Polish), PT-BR and PT-PT (Portuguese), JA (Japanese), and RU (Russian). Learn more about the plain/polite feature for Japanese here. + + Setting this parameter with a target language that does not support formality will fail, unless one of the prefer_... options are used. Possible options are: + + default (default) + + more - for a more formal language + + less - for a more informal language + + prefer_more - for a more formal language if available, otherwise fallback to default formality + + prefer_less - for a more informal language if available, otherwise fallback to default formality + + Type: string + + glossary_id (optional) + + Specify the glossary to use for the translation. + + Important: This requires the source_lang parameter to be set and the language pair of the glossary has to match the language pair of the request. + + Type: string + + show_billed_characters (optional) + + When true, the response will include an additional key-value pair with the key billed_characters and a value that is an integer showing the number of characters from the request that will be counted by DeepL for billing purposes. + + For example: "billed_characters":42 + + + + Note: At some point in the future, we intend to include billed_characters in the API response by default, at which point it will be necessary to set show_billed_characters to false in order to for an API response not to include billed_characters. We will notify users in advance of making this change. + + Type: boolean + + tag_handling (optional) + + Sets which kind of tags should be handled. Options currently available: + + xml: Enable XML tag handling; see XML handling. + + html: Enable HTML tag handling; see HTML handling. + + Type: string + + outline_detection (optional) + + The automatic detection of the XML structure won't yield best results in all XML files. You can disable this automatic mechanism altogether by setting the outline_detection parameter to false and selecting the tags that should be considered structure tags. This will split sentences using the splitting_tags parameter. + + In the example below, we achieve the same results as the automatic engine by disabling automatic detection with outline_detection=0 and setting the parameters manually to tag_handling=xml, split_sentences=nonewlines, and splitting_tags=par,title. + + Example request: + + + + A document's title + + + This is the first sentence. Followed by a second one. + This is the third sentence. + + + + Example response: + + + + Der Titel eines Dokuments + + + Das ist der erste Satz. Gefolgt von einem zweiten. + Dies ist der dritte Satz. + + + + While this approach is slightly more complicated, it allows for greater control over the structure of the translation output. + +Type: boolean + +non_splitting_tags (optional) + +Comma-separated list of XML tags which never split sentences. Learn more. + +Type: array[string] + +splitting_tags (optional) + +Comma-separated list of XML tags which always cause splits. Learn more. + +Type: array[string] + +ignore_tags (optional) + +Comma-separated list of XML tags that indicate text not to be translated. Learn more. + +Type: array[string] + +*/ +PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne ) + +Contenu.text[1] = sQuestion +Contenu.source_lang = langueSource +Contenu.target_lang = langueDesti +SI context <> "" ALORS + Contenu.context = context +FIN +Contenu.model_type = :Modele +Contenu.split_sentences = split_sentences +Contenu.preserve_formatting = preserve_formatting +Contenu.formality = formality +SI glossaireRetrouveID(langueSource,langueDesti) <> "" + Contenu.glossary_id = glossaireRetrouveID(langueSource,langueDesti) +FIN +Contenu.show_billed_characters = show_billed_characters +Contenu.tag_handling = tag_handling +Contenu.outline_detection = outline_detection +SI TableauOccurrence(non_splitting_tags) <> 0 ALORS + Contenu.non_splitting_tags = non_splitting_tags +FIN +SI TableauOccurrence(splitting_tags) <> 0 ALORS + Contenu.splitting_tags = splitting_tags +FIN +SI TableauOccurrence(ignore_tags) <> 0 ALORS + Contenu.ignore_tags = ignore_tags +FIN +``` +#### Méthode interrogerRetourneReponse +```wlangage +PROCÉDURE PROTÉGÉE interrogerRetourneReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne +vReponse est un Variant +vReponse = JSONVersVariant(sReponse) +sRetour = vReponse.translations[1].text +RENVOYER(sRetour) +``` +#### Méthode glossaire_cree +```wlangage +/* + Entrées au format tsv : sourcecible + csv : source,cible + +*/ +PROCÉDURE glossaire_cree(LOCAL sLanguageSource est une chaîne, LOCAL sLangageDesti est une chaîne, LOCAL sEntrees est une chaîne,LOCAL sFormat est une chaîne = "tsv") +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant +param est un JSON + +sID est une chaîne = glossaireRetrouveID(sLanguageSource,sLangageDesti) +SI sID <> "" ALORS + glossaireSupprime(sID) +FIN + +reqLLM.URL = :urlBase+"glossaries" +reqLLM.Méthode = httpPost +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" + +param.name = ChaîneFormate(sLanguageSource,ccMajuscule)+"_"+ChaîneFormate(sLangageDesti,ccMajuscule) +param.entries = sEntrees +param.source_lang = sLanguageSource +param.target_lang = sLangageDesti +param.entries_format = sFormat + +reqLLM.Contenu = param +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 201 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + RENVOYER(vReponse.glossary_id) +SINON + RENVOYER(hReponse.Contenu) +FIN +``` +#### Méthode glossaireRetrouveID +```wlangage +PROCÉDURE PRIVÉ glossaireRetrouveID(LOCAL sLanguageSource est une chaîne, LOCAL sLangageDesti est une chaîne) +sDesignation est une chaîne = ChaîneFormate(sLanguageSource,ccMajuscule)+"_"+ChaîneFormate(sLangageDesti,ccMajuscule) +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant +SI PAS glossaire_id[sDesignation]..Vide ALORS + RENVOYER(glossaire_id[sDesignation]) +FIN +reqLLM.URL = :urlBase+"glossaries" +reqLLM.Méthode = httpGet +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 200 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + TableauSupprimeTout(glossaire_id) + POUR i = 1 _À_ TableauOccurrence(vReponse.glossaries) + sDesignation = ChaîneFormate(vReponse.glossaries[i].source_lang,ccMajuscule)+"_"+ChaîneFormate(vReponse.glossaries[i].target_lang,ccMajuscule) + glossaire_id[sDesignation] = vReponse.glossaries[i].glossary_id + FIN + sDesignation = ChaîneFormate(sLanguageSource,ccMajuscule)+"_"+ChaîneFormate(sLangageDesti,ccMajuscule) + RENVOYER(glossaire_id[sDesignation]) +SINON + RENVOYER(hReponse.Contenu) +FIN + +``` +#### Méthode glossaireSupprime +```wlangage +PROCÉDURE PRIVÉE glossaireSupprime(LOCAL sID est une chaîne) +hReponse est une httpRéponse +reqLLM est une restRequête +reqLLM.URL = :urlBase+"glossaries/"+sID +reqLLM.Méthode = httpDelete +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +POUR TOUT sIDenCours,sDesignation de glossaire_id + SI sIDenCours = sID ALORS + TableauSupprime(glossaire_id,ElémentCourant) + FIN +FIN +SI hReponse.CodeEtat = 204 ALORS + RENVOYER("") +SINON + RENVOYER(hReponse.Contenu) +FIN +``` + +--- + +## 📚 Procédures globales + +### 🔧 info_connexion.gds + +#### 📌 Fonctions définies +```wlanguage +// Liste ou copie des fonctions globales +``` + +--- + +## 🧠 Notes d’analyse + +> Utilise cette section pour noter : +- Les interactions entre les objets +- Les appels entre classes +- Les dépendances vers des APIs +- Ce que chaque objet semble faire +- Ce que tu veux changer / améliorer en Python + +[[ROBO_MAT_Analyse_Fonctionnelle]] +[[ROBO_MAT_Code_WLangage_Organise|version épurée]] diff --git a/webdev/Application webdev (1).md b/webdev/Application webdev (1).md new file mode 100644 index 0000000..983e9ac --- /dev/null +++ b/webdev/Application webdev (1).md @@ -0,0 +1,135 @@ + +--- +## 2. Emplacement du projet + +- Description du projet + - Nom du projet: robo_mat + - Répertoire du projet: C:\Mes Projets\robo_mat + - Répertoire dans la liste des tâches: C:\Mes Projets\robo_mat\Taches + - Fichier principal du projet: robo_mat.wpd + - GDS: + - Serveur: CS:\\10.103.0.3\GDS + - Répertoire: GDS:\\Projets WebDev\robo_mat + +Récupération arborescence du projet: +```bash +tree "C:\Mes Projets\robo_mat\" /F > "$env:USERPROFILE\Desktop\structure_projet_robo_mat.txt" + +``` + +![[structure_projet_robo_mat.txt]] +[[structure_projet_robo_mat]] + +--- + +## 🧠 Ce que signifie le gras dans l’Explorateur WebDev : + +|Élément|Signification| +|---|---| +|🔤 **Nom en gras**|Contient **du code WLangage actif** (ex : dans un événement, une procédure, un champ…) ou a été **modifié** depuis sa création.| +|📄 Nom en normal|Pas encore modifié ou utilisé, aucun code associé pour l’instant.| + +--- + +## ✅ Étapes rapides pour localiser **tout le code** dans ton projet + +Je te propose cette méthode **manuelle rapide et fiable**, parfaite pour ton cas (petit projet en début de dev) : + +--- + +### 🧭 Étape 1 : Ouvrir l’**Explorateur de projet** (gauche) + +Regarde chaque **section** de l’arborescence : + +- `Pages` +- `Classes` +- `Procédures globales` +- `Composants internes` +- `Projet` + +🔍 **Repère ce qui est en gras** → cela indique **des éléments actifs** à explorer. + +--- + +### 🧪 Étape 2 : Vérifie **chaque élément en gras** + +#### ▶️ Pour une **Page** (ex. `PAGE_TEST`) : + +1. Double-clique pour l’ouvrir +2. Clique droit sur un champ ou bouton > `Code` +3. Regarde les événements associés (clic, chargement, etc.) + +#### ▶️ Pour une **Classe** : + +1. Clique sur le nom de la classe (ex. `clsMistral`) +2. Clique droit > `Code` → Tu verras les **méthodes WLangage** définies à l’intérieur + +#### ▶️ Pour les **Procédures globales** : + +1. Clique sur `Procédures` dans l’explorateur +2. Ouvre les fichiers listés (souvent `.WDG`) +3. Tu peux copier/coller chaque fonction + +--- + +### 🧪 Étape 3 : Vérifie le **code projet** (initialisation) + +- Menu `Projet > Code du projet` +- Tu verras l’**initialisation**, la **fermeture** du projet, et éventuellement du code d’initialisation de session + +--- + +## 🎯 Résumé de la **stratégie optimale de récupération** + +|Étape|Objectif|Action| +|---|---|---| +|1️⃣|Localiser visuellement le code|Utiliser l’explorateur de gauche, repérer les noms **en gras**| +|2️⃣|Explorer chaque élément actif|Double-clique > bouton droit > `Code`| +|3️⃣|Centraliser manuellement|Copier/coller le code dans un fichier `.md` par page / classe| +|4️⃣|Organiser pour la suite|Classer les extraits pour les convertir en Python plus tard| + +--- +## ✅ À quoi sert `Code > Tous les codes` dans WebDev ? + +Cette option te permet d’**afficher dans une seule fenêtre** : + +- Tout le code écrit dans les **événements** (pages, champs, boutons) +- Les **procédures locales** et **globales** +- Les **classes et leurs méthodes** +- Le **code d'initialisation du projet**, et plus encore… + +--- + +## 📦 Avantages concrets pour ta tâche + +|Avantage|Description| +|---|---| +|🧠 Centralisation|Tu vois **tout le code WLangage du projet** sans ouvrir chaque objet un par un| +|🔍 Recherche rapide|Tu peux faire des recherches globales (`Ctrl + F`) dans tous les fichiers| +|🧾 Copier facilement|Tu peux sélectionner et **copier/coller** directement dans un `.md`| +|📜 Vue claire|L’interface est souvent hiérarchisée par **pages**, **procédures**, **classes**, etc.| + +--- + +## ✅ Étapes pour utiliser cette fonction + +1. Dans WebDev : + **Menu `Code` (en haut)** → `Tous les codes…` + +2. Une nouvelle **fenêtre d’exploration de code** s’ouvre : + + - Navigation à gauche : par **pages**, **procédures**, **classes** + - Fenêtre centrale : tout le **code WLangage écrit** + - Tu peux tout **copier/coller** en une fois ou par section + +--- + +## 🚀 Recommandation pour l’extraction + +🛠️ Pour ton projet qui est au début, et d’après ce que tu m’as dit (1 page, plusieurs classes) : + +- **Ouvre `Code > Tous les codes`** +- Copie le code de chaque section (page, classes) +- **Colle-les dans des fichiers `.md`** que je peux t’aider à structurer proprement + +--- diff --git a/webdev/PJ/structure_projet_robo_mat.txt b/webdev/PJ/structure_projet_robo_mat.txt new file mode 100644 index 0000000000000000000000000000000000000000..acec895592cb84cd0559921411ddb4f8816321f2 GIT binary patch literal 95544 zcmd5_+j1Pak?rS=*niN&zB#0rku+m_-$>mj#1WUIHC~4!Iwant8Q#pxXzWk&C+)}V z?l}d*SwNwHOaQI!=nzSfl?Mk0iEAZ*|NGzl#qHvHakn_c_dEP_ym+uU!cY8qxwygS zGk$ly`1i%XE#3})y})137ypCbT@Fvt;%4|ipY+zh;;(1JllsO$BXBS zhl{6+KQ3M_{xIM^Tm0wZuZx|k*{|@l~zYhP~#&4E*Vhg_`lYinl zeqIl_&+nNZFCHPy%f)H%%+BHi(q2mLJ&tV&o~X1DOMCCdK^{4G~L{<){B=eFRJSIFyU zpx+KT=68AuYv2tOV4B}{#CqHjtE9!j;Pu<^tXq68k;li#58J=8pQmlLr8Tv#Pj`v7 zlWkVHKDn}gJ(M4Fdy87d9)V@3^9S0#zW05b)$Y)aoPg<>A-y;7xl=s9h1T&%6gZ+(Q+Qis_Q(GRpU9N8oi&vM=#LI9HZV_G#=a8b&aiUTE^Bk{X*+H z&Bm>>MKz9b*s8OYy)o$>TG|z#+S@dr+S^o*?Q3*@4&83h|9>9ZRGaQ&%Nq4!d#ie} zy;Z%?zD_;P6E234;Rj=H{TyS8v2BflQv|DqQv|DuF+z=wFQDCL)MAVOc^kWKV@sP} zV@sP(Vp*e)AD@qBrxvYJ_IBOoP;45`q1g0Hqtt0@Z~K@I$DlPDiltRIv9xOCEo=3; zKyGdR#@X{PmHK!~yFT91u8*^<)8`UnJ+69v9_G_FokH6hf0`m#b(09DxI%Lbg;;a%jI#&Yx-~*eiHMcGOhQ{*sf4z+av9s!l*}G9KEL-wi&kShyIQfe zO|RJ6rdViQr!KP&j z!KUOCL8qg8cgZLNj`(cvEyYTDWKG*3vxVKECfuPmoY`zW1rsB{JeY-JQ$+H$>*(qS~jOK8q_K8%C8RIZnJ+c)qk_8T8ia@Y8J zUMOkzKGj%vOr!E#K?<1k*e}gF_0q($B*B&sc>hJdoGYW!ZOI?bw-FAf?V-;%B zqg_pUPb$-+ojpCi={+1)&Fpy;TYI{G=3Jw#*yhva8$#AgMw@YLnDd$V*(G9D#%)^O zQ=h@7&k(1^8li6qrdGOE;1&GwElOLWgK|0ZPy5wt&9gcle#K`WN>SfKjKP1(uAEZJO6-r%_#uz88^e9z8^Ma}cChrApWpMMKf7r%G~ z|4K*c$usk-XZ{(MCOx&xR4m>Os-MCxmos^OfAKf8y5+f5KC+P!o9rz<22qqgGO=tM zM|+Cp^LwxMZ{<1eDV5s};!jx@cEO2CY~yQAjnwl?M4Pe)rZ2Cwmt>5_c z!#ZQP{)DtSQ_)+xmF^{Cf3K0xQ~bL?p7XUx#)IU0h3Bc$Ez)Mxs?PsP7=C3XueoRM z=J|}K{!%DsvCw+Gw>Ur^KPu7Pv&+T%?DM;*-AhC=kH?B!%VLi`jsnuO(ON8B8$OTb zXMk;-JW4&AJ_>~>^=y28YE|*}S_ZEWbxO}+T-PyrSpUYaJQvVbwjpLKQ~J+$E6{cxw-@73 zhc<0J+Yqyr=@V%C{R*_5$L+;9)S*pV&o;ztW%_jRTc>Z2wr?J+O+j-L(EpDzQ5_M?L2NT#-R>v+IqGjW-HVAe$6`LaQ-@vSJU>* zquJWNX%Ey=7E`pgUYE+1FzxD<5L*?rd!Ab<gjjr=9Am9Mg<7_H^|%tul{c^BlNJ=vLDBZr~*OcIPixQRLf}Z76Vo zufM>Lo)2qWeDg__^6P|U`+RIo**^d7F=hV>-p>h0yFAbF$uj;-8tw&h9{gw+mAH6NzDMN= zLheioBW4N<_N$PB zF1>WyIiH?9Uz1+TxlMDNteC6go$mMAcnjw0c&Gc_Hr|41<2^lricuf7wnm51gV(gy z=i8Drvnfg|w|2#*2<@Dv`LwE)I#bNX%e9-9v&QD?K?$Rl7uQWVv*bG}X>IdLNv_h? zwOqKX^b#Yj{OM>ph2{}zIQdxE`E%FixTG!HIn2iu>6nD}efUV9q4Anf8S)YPK76Dv zsN*B{J^18y6KTsV#%STicM`eN@=Bai_PzLo-f1blF{==zCpYob7H)#llbd*L3pYXO z$1V2WdVVod8^>{E?-qI<_C4vS<#L_KW37T`=;by|(`-Y;RdE*Y@5NaVSH)RsMK8{R zxEjuJP3glsMs4BF9bLH-F-vtWW#5ZWSQ9MTjah{#J-La;w{R1bp4`NX@Qoq{x2~J;r zQpei(2~JObaUE;n7-O~Z9G?-JdS_p*8!3c-oI;k9ih(8(-=K@wfKF=E=20hQM}kz zwo{IR)SIJtbt^|f>dP_q@HUq*LeK^IQS;s3zY2)VhAJ_SJXxoEF=$$rw9GeiK7bo$~T26w{i<5X~Ehjv;)AKVDLo>v;)AFJ5t7uH_cvwD23>hg8!pr0jd~3BA^$)|gd@(vzEbZVNX->B&vJ zw}qRa^y3zLZ#};lsg0vQE41}3iR^buA@%1N`nOHZRGve;)$kRc@55K{R>N27K_9+? zw+g;-z39O?#%$s3Z$7K(Z(`dXJVKARsO8y&2)#IoSJ!e9gkGG)b89&XLLW}CXV&qG zQQElq8|&&kJhtw`CG=67N}f@O(T|t-X+1B&=*LTZwVsz?^x_r!YAv@Ir;Q&Y)p=@K z?v};Ute$sRrBV8F3;o!pU(7JX>d#aBx}B$B_2(&m-p*67dh?8ZzLjf?*TUD|deOEE zavr5Gx6tn`I!+meSp9j5-?#G=to}U3@7s9_R&SoM&$n`o@ml!C_lVYvz~(S|@(MlP zqF~G}MC#2^yuFp9Aob=bp5Dq)kot0rJ-m%)jArBNP9u`LZ+*P1uBMc%+qlTuSsk0H zy^W7MQAeT!{&Q{J0&7(IAR)vsYTMX_;nWgsOtz5z6BEA#C1 zIDPp^JK4rhaBTdXzl1jr)U*+Kgmz9-KgsKr%GVUb#>@GLzwKFb&-C03xP;Ndi)X`f zR-V7Zy2NZArG;DhhU^lrG(rof^4;4dPHBWXPVw#B=^Lo$8O_`G;gh~yTF*!9+xhU+ z$QFG<`#yXmfBE*wwnLym$i98KT^Hrz!7)*32K~Y+BM?;x71OoObV4 z)#q-yiEDq%WFE!FjrRo{;2pv3{cRzZaizOiBxl{mWjYqj`OK8f)ZW7975XjS8S)Iu zTw=7AzO6nkr+KTIv@NCKQ;uzF(w!=oQ{JaMwX&q`&p#dC7sPv6bZ76Dt=qXg!Ogy! zRwK=2Y;EDf2v*)BvBVu1JkRO^p79}WW(qYTU-c(4rhLvl} z4(V8ZNsiANuV!zG{5evq;&sroY6UMecsc&tRn8Z;@g&k5tETeC~a!CC>Yi zD>v@Ckkj*1C^g)|aY_nR!>x=`$L$kxe1+b#o>vaR#)%$v2QKlQs5-ANS=Vu)?z{_? zUVjU%uEB5GC*(`eGt*)97VH^A1 z3hPZB{wng5S5RL*^Et|=(4MEzBl^@EpBp`P?|kG{vzJSllRSETUY?-de80kaQ-{Bb z{NxqXm(P5T@+q|EDfEaw^~UE$kKH>TdDZOY66Pe2UZ0nzLx1DyPS0_@4R;m%rz3EE z8O*bvqOO8_I12Bw26q+wryi0clO{NBDQh1ueI26V8>rY ze)2W0M~?C-wC5=tHMWkerDjZ5Kyui<^O0B0UM`_ZdGz|c__=)lHBeVBb@;2uPhLTN z`ON1ipF(?{LXXJ#wmmm`?B4mvtJa#6JbHaz{9Jxj^`;Jg75T|4s4t)S9OYAJ&y(J_ z?YYro_s&ONwbq>E(d+XvziLtYj@I=vHr!S4pN_!wWiZcvin?DM!5{%)@W4N{^A89-0k}Sb9R>W53rwh8w_56!%M_@oFR&m z5kn8~dl$#1-3x6)>cdg$dQZM3)ZW}R`vvCJ6}BFy4?pY9)Om&}q*{)QvE=@cL+npz zEAui^AC6K!J^7YUdvo``mFp+Q9uTT4Y&}jNeksqYW0*p!=XePZnpW-q6 zm3vV?Ahy)~*6W~WtHJ0wP z2x^X_cH!k5J@{PbnU$>VT*94BdKPKBn)EHZecVp7>3*!5bf-HR%Gxin^T0>=daY{G zcKba%f+pS2!j>j?CAir3Q?NhD?p^0;IN{TlwEhBpxYK+a9({qYjPQPr_WTm494+%a z6iu!zIDPradA+$(Df1JYzWj8j$&~pCPAk7x=&SFBQD$5D&f)asC*@)--;kf+^yMez z(#B74>iM&{kkIr~0*M01ToQ$AwfhmYu8$4Bffe3;hn77vHdA^JbAvGDvP zuEx6Cinyos!EjpFgJG8>cS{})e@*e^Ot=?5Pr+v=CrCxq+2mZ>M%XcIiChzdn8J?vNl+ky=_Ik*pJNu9) zGMBCP2CvRNC%HQW|FH*p-NwK3rQFhDd0fAv+fs%lo1C}i)7AJxI`!Dn&OyrHC~D`@ zoWtks>FGT+%yHVzp1#)e!_-q&_Oz|_DCCf{wsR@h&M@`xc}sfM(LwBY;&F4Wgl8H) zY2lb^XB^sc@e}&w?V)w@Ezq>TIviTZ6v|6j@8R^D@}3V{Bfpl z_Eu9aM`)eXqo#SATcnacvvl6(3)<|k?}~FY*2DkJYxoUzag0ByXT6Q*Fm0`0;#7}k zi$9`#Uf`|vxBu#u*z0_pVb_LwxDr&3uI&m)>(9Ku!0O~<_}Lcx%=fzWI_R+L)X-tu zH1TzRYw(8e2aos$zEQ7)2GN#(4WcdAaj*CkrT-m1Tc{0BanenF?k&hR6)ea$HNsx{ zDRg)|v<_^)Tk3=!*QSIX*QP^yr10&~Iy_zce(?t=)1rqR-=>Ql-=>cr%lNk9InG^p z+|+w$5N#T05Vg5Z&3?Z_o?pTfzJVt^z0W&W99)l)UU`UnPAe|gnKZqe757?+I~^;z zwU0*_$y`J;P@h---H$=$F*xE#ucKHnIFi(8l;gp#ZkI72JeBhpYsj?>Vh>(j zURg3e|GtFWSSrY?%OjLE5#DK!iSMkYz-NM#qVr2xYyza z|99the7$<;?vK>*;>rno+ON@WS$IA9>b%~d>`sRoc!c+YUt5(hb@nRsr(f2_gZl|@ zkUmE{>(XM(VG|S?pT{mEfc2@9=CgjKcxNQz>Umc9y3`qSSid41fAH3A?moL&nsRK*5S_HX{>Z1lekJ^zb39*I zm!G7#Y=T1TZB=}$wi!ySb0q0UvYVj9B}OG&opHC=uCK;~Jl3y_zmaTRium+5K?!$0 z!uphO>91c2fA9Uel;G`|$2cK_b(O2O>*V3qcGk~e{a&$$GC4sRMJJm(Cab2NC+`s!26V|~iVIC>X-^cBWUS6{6@amAI<5!^$@x0&(D z1^)e+|L)(T@jMOp7SEr@#ar>pZ}MozahZEdAiIO@w&UHY7VFo@@g3T(y0pD@P3jjz zU&?zN-AvY-9=w?fw264TvpXu;qjB= zNB`U#Y(Zcj!FGbZQk|W}6WDLEUvVdfTGI1Yw$zS>K8RxsOYTm<@d6*df4A7tfB44H zwbr&YY0Hr~Xv$dq|td0w$ zXS4eRxTXK8-?XXDAZ{S#o&*KL+3$OliLIYO@d44kb3 z+XXAu9k6UR<){6+*w&CkA2q&%m786pRc^Js{WkQzMlLy;W6sL!Cf<^aI8Fbb^y|2RN z*+YCYtl`0DmqWf;*W3=EG9PEf66bs9bCj4nqnfRPu16Rn&}X=UrcHepK5_uouklZN z^XJ!^Q){`&x#*k5%-uq=K32Sy@fB*{c*d2!lX=rPrtd>pFH4TNSU*|2H&Mlq-zF(I ze{Un-tZ*#pMi_3Lb3LUz&v6r#49j}+R1EoTl7jPhA#RR}^Bgx($*`<9PsNbmCMh_7 z_n?1I{Was6!tvHTw{?%V=9#T;y!8&FEUw~k*20y8%^4p|na$r%Z1Y2%~9SgeoH{xD#P|HfS89=xq32pOJ#)=l7Au5n{nzgrAEAD8*jLZjUWk^KCNU zM(g4c#P%6tix`vO_TFgTq0ia!toic0^f~KyMr%e=@I4>jO&yQ+-Z1~=NDg5U;#ha# z2+m8CHRGVP5g}P#%F#xAYHRTW{{30~wA&@1!{(U7ord`i@h@y^ zc&eDrHoZ%))Z#ElwB*i!W8`ZWd(5=yaYq5)%xj;&L@HdTXS|)xCalTyAs3ya$rWuG zr^a^!+SFV$pzdjZW|Z5H_6AB=a`s|~k=5tMo!rWueTouV~Yh(UZ5Z9B4?TNv4y3rncBHC zWEh3YIwUng`e1tEYed=Yz*lq%j8oY|uKf5(Q@8dP|7A#rBSS4GANTD%{q4V60G++) zVSS#n5%$^a8>qzR`*>?B&W}J~Pt3Z?KF00d)o3c*d3!o{g`eZYXeBL&BkWz%KFgEf zIqTslMZ@k-!&vnaxzd(pXmNwHAWw?z(4U4jo)PgHPVd2=BOdNj);`ZW894KE^Nf-e zZx>;_KKC({(+HpTcBQuW&xSfn&nWX?+ruZh7QqqnKk(hP8@l*>Z(r-nKMmf?$ZED# zO!-(9k^K`+Kd0Y^mW<~vl~daC_XI`Mz%1XO8q@vIk`nU_XzDpek2}S<&ZrCe~vl( ur`+=%+kf|QuUD8$K7^mUz0pVb-zB*6&c%-dTMMS&ec{_`)>?}_pZ$M5y7$@u literal 0 HcmV?d00001 diff --git a/webdev/PJ/wlangage_class_code.json b/webdev/PJ/wlangage_class_code.json new file mode 100644 index 0000000..66d5b47 --- /dev/null +++ b/webdev/PJ/wlangage_class_code.json @@ -0,0 +1,340 @@ +{ + "classes": { + "clsMistral": { + "heritage": "clsLLM", + "attributs": { + "maxToken": "entier", + "seed": "entier", + "presence_penalty": "réel", + "frequency_penalty": "réel", + "n": "entier", + "prediction": "JSON", + "safe_prompt": "booléen", + "o_stop": "chaîne", + "m_tabModels": "tableau de chaînes (PRIVÉ)" + }, + "methodes": { + "Constructeur": { + "code": "PROCÉDURE Constructeur()\n\n//:Modele = \"open-mixtral-8x22b-2404\"\n:Modele = \"mistral-large-latest\"\n:o_temperature = 0.2\n:o_top_p = 1\n:maxToken = 1000\n:presence_penalty =\t0\n:frequency_penalty = 0\n:n=1\nprediction.type = \"content\"\nprediction.content = \"\"\nsafe_prompt = Faux\no_stop = \"string\"" + }, + "model_list": { + "code": "PROCÉDURE PUBLIQUE model_list()\nhReponse\test une httpRéponse\nreqLLM\t\test une restRequête\nvReponse est un Variant\n\nSI TableauOccurrence(m_tabModels) > 1 ALORS\n\tRENVOYER (m_tabModels)\nFIN\n\nreqLLM.URL\t\t\t\t= :urlBase+\"models\"\nreqLLM.Méthode\t\t\t= httpGet\nSI :cleAPI <> \"\" ALORS\n\treqLLM.Entête[\"Authorization\"]\t= \"Bearer \" + cleAPI\nFIN\nreqLLM.Entête[\"Content-Type\"]\t= \"application/json\"\t\nhReponse\t\t\t\t= RESTEnvoie(reqLLM)\nSI hReponse.CodeEtat = 200 ALORS\n\tvReponse = JSONVersVariant(hReponse.Contenu)\n\tPOUR i = 1 _À_ TableauOccurrence(vReponse.data)\n\t\tTableauAjoute(m_tabModels,vReponse.data[i].id)\n\tFIN\nSINON\n\tTableauAjoute(m_tabModels,hReponse.Contenu)\nFIN\nRENVOYER(m_tabModels)" + }, + "urlBase": { + "code": "PROCÉDURE PUBLIQUE urlBase()\nRENVOYER(\"https://api.mistral.ai/v1/\")" + }, + "cleAPI": { + "code": "PROCÉDURE PUBLIQUE cleAPI()\n\nRENVOYER(\"2iGzTzE9csRQ9IoASoUjplHwEjA200Vh\")" + }, + "urlFonction": { + "code": "PROCÉDURE PUBLIQUE urlFonction()\n\nRENVOYER(\"chat/completions\")" + }, + "Destructeur": { + "code": "PROCÉDURE Destructeur()" + }, + "interrogerRetourneReponse": { + "code": "PROCÉDURE PROTÉGÉE interrogerRetourneReponse(LOCAL sReponse est une chaîne)\nsRetour est une chaîne\nvReponse est un Variant\nvReponse = JSONVersVariant(sReponse)\nsRetour = vReponse.choices[1].message.content\nRENVOYER(sRetour)" + }, + "even_LLM_POST": { + "code": "PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne )\n\nContenu.messages[1].role\t= \"system\"\nContenu.messages[1].content\t= :prompt_system\nContenu.messages[2].role\t= \"user\"\nContenu.messages[2].content\t= sQuestion\nContenu.temperature = o_temperature\nContenu.top_p\t\t= o_top_p\nSI :maxToken <> 0 ALORS\n\tContenu.max_tokens = maxToken\nFIN\nSI :seed <> 0 ALORS\n\tContenu.random_seed = :seed\nFIN\nSI :format <> \"\" ALORS\n\tContenu.response_format = :format\nFIN\n// Contenu.tools A déterminer\n// Contenu.tool_choice A déterminer\nContenu.presence_penalty\t= presence_penalty\nContenu.frequency_penalty\t= frequency_penalty\nContenu.n = 1\nContenu.prediction = :prediction\nContenu.stop = o_stop" + } + } + }, + "clsOllama": { + "heritage": "clsLLM", + "attributs": { + "suffix": "chaîne", + "images": "Buffer", + "template": "chaîne", + "raw": "booléen", + "keep_alive": "Durée", + "o_mirostat": "entier", + "o_mirostat_eta": "réel", + "o_mirostat_tau": "réel", + "o_num_ctx": "entier", + "o_repeat_last_n": "entier", + "o_repeat_penalty": "réel", + "o_seed": "entier", + "o_stop": "JSON", + "o_num_predict": "entier", + "o_min_p": "réel" + }, + "methodes": { + "Constructeur": { + "code": "PROCÉDURE Constructeur()\no_mirostat\t\t\t= 0\no_mirostat_eta\t\t= 0.1\no_mirostat_tau\t\t= 5\no_num_ctx\t\t\t= 2048\no_repeat_last_n\t\t= 64\no_repeat_penalty\t= 1.1\no_temperature\t\t= 0.8\no_seed\t\t\t\t= 0\no_stop\t\t\t\t= []\no_num_predict\t\t= -1\no_top_k\t\t\t\t= 40\no_top_p\t\t\t\t= 0.9\no_min_p\t\t\t\t= 0\n\n\nraw\t\t\t\t\t= False\nkeep_alive\t\t\t= 5min" + }, + "urlBase": { + "code": "PROCÉDURE PROTÉGÉE urlBase() : chaîne\nRENVOYER(\"http://217.182.105.173:11434/\")" + }, + "cleAPI": { + "code": "PROCÉDURE PROTÉGÉE cleAPI() : chaîne\nRENVOYER(\"\")" + }, + "Destructeur": { + "code": "PROCÉDURE Destructeur()" + }, + "Interroger": { + "code": "PROCÉDURE Interroger(LOCAL sQuestion est une chaîne )\nm_sUrlFonction = \"api/generate\"\nRENVOYER(LLM_POST(sQuestion))" + }, + "even_LLM_POST": { + "code": "PROCÉDURE PROTÉGÉ VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne)\nContenu.system\t\t= :prompt_system\nContenu.prompt\t\t= sQuestion\nContenu.stream\t\t= :stream\nContenu.suffix\t\t= :suffix\nContenu.format\t\t= :format\nContenu.raw\t\t\t= :raw\nContenu.keep_alive\t= :keep_alive\nSI :images <> \"\" ALORS\n\t// A traiter\nFIN\n\nContenu.options.mirostat\t\t\t= o_mirostat\nContenu.options.mirostat_eta\t\t= o_mirostat_eta\nContenu.options.mirostat_tau\t\t= o_mirostat_tau\nContenu.options.num_ctx\t\t\t\t= o_num_ctx\nContenu.options.repeat_last_n\t\t= o_repeat_last_n\nContenu.options.repeat_penalty\t\t= o_repeat_penalty\nContenu.options.temperature\t\t\t= o_temperature\nContenu.options.seed\t\t\t\t= o_seed\nContenu.options.stop\t\t\t\t= o_stop\nContenu.options.num_predict\t\t\t= o_num_predict\nContenu.options.top_k\t\t\t\t= o_top_k\nContenu.options.top_p\t\t\t\t= o_top_p\nContenu.options.min_p\t\t\t\t= o_min_p" + }, + "interrogerRetourneReponse": { + "code": "PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne )\nvMaReponse\test un Variant\nvMaReponse\t\t\t\t= JSONVersVariant(sReponse)\nRENVOYER(vMaReponse.response)" + } + } + }, + "clsDeepSeek": { + "heritage": "clsLLM", + "attributs": { + "frequency_penalty": "entier", + "max_tokens": "entier", + "presence_penalty": "entier", + "logprobs": "booléen", + "top_logprobs": "entier", + "tool_choice": "chaîne" + }, + "methodes": { + "Constructeur": { + "code": "PROCÉDURE Constructeur()\n\n:Modele = \"deepseek-chat\"\nfrequency_penalty = 0\nmax_tokens = 4096\npresence_penalty = 0\no_top_p\t= 1\nlogprobs = Faux\ntop_logprobs = 0\ntool_choice = \"\"" + }, + "cleAPI": { + "code": "PROCÉDURE PROTÉGÉE cleAPI() : chaîne\n\nRENVOYER(\"sk-d359d9236ca84a5986f889631832d1e6\")" + }, + "urlBase": { + "code": "PROCÉDURE PROTÉGÉE urlBase() : chaîne\n\nRENVOYER(\"https://api.deepseek.com/\")" + }, + "urlFonction": { + "code": "PROCÉDURE urlFonction() : chaîne\n\nRENVOYER(\"chat/completions\")" + }, + "model_list": { + "code": "PROCÉDURE model_list() : tableau de chaînes\n\ntabRetour est un tableau de chaînes = [\"deepseek-chat\",\"deepseek-reasoner\"]\nRENVOYER(tabRetour)" + }, + "Destructeur": { + "code": "PROCÉDURE Destructeur()" + }, + "even_LLM_POST": { + "code": "PROCÉDURE PROTÉGÉ VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne )\n\nContenu.messages[1].role\t= \"system\"\nContenu.messages[1].content\t= :prompt_system\nContenu.messages[2].role\t= \"user\"\nContenu.messages[2].content\t= sQuestion\nContenu.stream\t\t= :stream\nContenu.frequency_penalty\t= :frequency_penalty\nContenu.max_tokens\t\t\t= :max_tokens\nContenu.presence_penalty\t= :presence_penalty\nSI :logprobs = Vrai ALORS\n\tContenu.logprobs\t\t\t= :logprobs\n\tContenu.top_logprobs\t\t= :top_logprobs\nFIN\nSI :tool_choice <> \"\" ALORS\n\tContenu.tool_choice\t\t\t= :tool_choice\nFIN" + }, + "interrogerRetourneReponse": { + "code": "PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne)\nsRetour\t\test une chaîne\nvReponse\test un Variant\nvReponse\t= JSONVersVariant(sReponse)\nsRetour\t\t= vReponse.choices[1].message.content\nRENVOYER(sRetour)" + } + } + }, + "clsPerplexity": { + "heritage": "clsLLM", + "attributs": { + "maxToken": "entier", + "presence_penalty": "entier", + "frequency_penaly": "entier", + "search_recency_filter": "chaîne", + "search_domain_filter": "tableau de chaîne" + }, + "methodes": { + "Constructeur": { + "code": "PROCÉDURE Constructeur()\nmaxToken = 1000\no_temperature = 0.5\no_top_p = 0.8\no_top_k = 0\npresence_penalty = 0\nfrequency_penaly = 1\nsearch_recency_filter = \"all\" // year\nprompt_system = \"Soyez précis et concis. Répondez uniquement en français. Effectuez une recherche approfondie et fournissez des informations détaillées et à jour.\"" + }, + "cleAPI": { + "code": "PROCÉDURE PROTÉGÉE cleAPI() : chaîne\nRENVOYER(\"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\")" + }, + "urlBase": { + "code": "PROCÉDURE PROTÉGÉE urlBase() : chaîne\nRENVOYER(\"https://api.perplexity.ai/chat/completions\")" + }, + "Destructeur": { + "code": "PROCÉDURE Destructeur()" + }, + "Interroger": { + "code": "PROCÉDURE Interroger(LOCAL sQuestion est une chaîne)\n:Modele = \"sonar\"\nRENVOYER(LLM_POST(sQuestion))" + }, + "even_LLM_POST": { + "code": "PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne)\n\nContenu.messages[1].role = \"system\"\nContenu.messages[1].content = :prompt_system\nContenu.messages[2].role = \"user\"\nContenu.messages[2].content = sQuestion\nSI :maxToken <> 0 ALORS\n\tContenu.max_tokens = maxToken\nFIN\nContenu.temperature = o_temperature\nSI :format <> \"\" ALORS\n\tContenu.response_format = :format\nFIN\nContenu.top_p =o_top_p\nSI TableauOccurrence(search_domain_filter) <> 0 ALORS\n\t// [\"perplexity.ai\"]\n\tContenu.search_domain_filter = search_domain_filter\nFIN\nContenu.return_images = Faux\nContenu.return_related_questions = Faux\nSI search_recency_filter <> \"all\" ALORS\n\tContenu.search_recency_filter = search_recency_filter\nFIN\nContenu.top_k = o_top_k\nContenu.presence_penalty = presence_penalty\nContenu.frequency_penalty = frequency_penaly\nContenu.response_format = Null" + }, + "interrogerRetourneReponse": { + "code": "PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne )\nvRepoonse est un Variant = JSONVersVariant(sReponse)\nsRetour est une chaîne\nsRetour = vRepoonse.choices[1].message.content\n\nRENVOYER(sRetour)" + } + } + }, + "clsRAG": { + "heritage": "", + "attributs": { + "sessionID": "chaîne (PUBLIQUE CONSTANT)", + "reqRAG": "restRequête (PRIVÉ)", + "taContenu": "tableau associatif de Variant (PRIVÉ)", + "m_sChatID": "chaîne (PRIVÉ)", + "mn_Question": "entier (PRIVÉ)" + }, + "methodes": { + "Constructeur": { + "code": "PROCÉDURE Constructeur()\nreqRAG.Entête[\"Authorization\"]\t= \"Bearer \" + \"ragflow-c4YTNkMzcwZDM1ODExZWZiODA2MDI0Mm\"\nreqRAG.Entête[\"Content-Type\"]\t= \"application/json\"\t" + }, + "urlBase": { + "code": "PROCÉDURE PRIVÉE urlBase()\n\nRENVOYER(\"http://10.103.0.100/api/v1/chats/\")" + }, + "chatID": { + "code": "PROCÉDURE PRIVÉE chatID()\nSI m_sChatID <> \"\" ALORS \n\tRENVOYER(m_sChatID)\nSINON\n\tRENVOYER(\"ffb1058ed4b811ef8a900242ac120003\")\nFIN" + }, + "setChatID": { + "code": "PROCÉDURE PRIVÉ chatID(Valeur)\n\nm_sChatID = Valeur" + }, + "Contenu": { + "code": "PROCÉDURE PRIVÉE Contenu()\nbufContenu est un Buffer\nSérialise(taContenu,bufContenu,psdJSON)\nRENVOYER(bufContenu)" + }, + "urlChat": { + "code": "PROCÉDURE PRIVÉE urlChat()\n\nRENVOYER(:urlBase+chatID+\"/\")" + }, + "Destructeur": { + "code": "PROCÉDURE Destructeur()\n\nSI mn_Question = 0 OU EnModeTest() ALORS\n\tsupprimeSessionChat()\t\nFIN" + }, + "creeSessionChat": { + "code": "PROCÉDURE PRIVÉ creeSessionChat()\nvMaReponse est un Variant\nhReponse est une httpRéponse\nTableauSupprimeTout(taContenu)\nreqRAG.URL = :urlChat+\"sessions\"\nreqRAG.Méthode = httpPost\ntaContenu[\"name\"] = DateHeureVersChaîne(DateHeureSys,\"AAAAMMJJ_HHmmSS\")\nreqRAG.Contenu = :Contenu\n\nhReponse = RESTEnvoie(reqRAG)\nSI ErreurDétectée ALORS\n\tRENVOYER(Faux,TexteVersHTML(ErreurInfo()))\nSINON\n\tvMaReponse = JSONVersVariant(hReponse.Contenu)\n\tSI vMaReponse.code = 0\n\t\t:sessionID = vMaReponse.data.id\n\t\tRENVOYER(Vrai,:formateReponse(vMaReponse.data.messages[1].content))\n\tSINON\n\t\tRENVOYER(Faux,:formateReponse(vMaReponse.message))\n\tFIN\nFIN" + }, + "Chat": { + "code": "PROCÉDURE Chat(LOCAL sQuestion est une chaîne)\nbSessionCree est un booléen\nsReponse est une chaîne\nvMaReponse\test un Variant\nSI :sessionID = \"\" ALORS\n\t(bSessionCree,sReponse) = creeSessionChat()\n\tSI PAS bSessionCree ALORS\n\t\tRENVOYER(:formateReponse(sReponse))\n\tFIN\t\nFIN\n\nmn_Question++\nhReponse\test une httpRéponse\nTableauSupprimeTout(taContenu)\nreqRAG.URL\t\t\t= :urlChat+\"completions\"\nreqRAG.Méthode\t\t= httpPost\ntaContenu[\"question\"]\t\t= sQuestion\ntaContenu[\"stream\"]\t\t\t= False\ntaContenu[\"session_id\"]\t\t= :sessionID\nreqRAG.Contenu\t\t= :Contenu\n\nhReponse\t\t\t= RESTEnvoie(reqRAG)\nSI ErreurDétectée ALORS\n\tRENVOYER(TexteVersHTML(ErreurInfo()))\nSINON\n\tvMaReponse = JSONVersVariant(hReponse.Contenu)\n\tSI vMaReponse.code = 0 ALORS\n\t\tsReponse = vMaReponse.data.answer\n\t\tRENVOYER(:formateReponse(sReponse))\n\tSINON\n\t\tsReponse = vMaReponse.message\n\t\tRENVOYER(:formateReponse(sReponse))\n\tFIN\nFIN" + }, + "formateReponse": { + "code": "PROCÉDURE PUBLIQUE formateReponse(LOCAL sReponse est une chaîne)\nsRetour est une chaîne ANSI\nsRetour+=\"
\"\nsRetour+=UnicodeVersAnsi(UTF8VersUnicode(MarkdownVersHTML(sReponse)))\nsRetour+=\"
\"\n//sRetourANSI = UnicodeVersAnsi(sRetourUnicode)\nRENVOYER(sRetour)" + }, + "formateQuestion": { + "code": "PROCÉDURE GLOBALE formateQuestion(LOCAL sQuestion est une chaîne)\nsRetour est une chaîne\nsRetour = \"
\"\nsRetour+= sQuestion\nsRetour+= \"
\"\nRENVOYER(sRetour)" + }, + "supprimeSessionChat": { + "code": "PROCÉDURE PRIVÉ supprimeSessionChat()\nvMaReponse\test un Variant\nsReponse\test une chaîne\nhReponse\test une httpRéponse\nTableauSupprimeTout(taContenu)\nreqRAG.URL\t\t\t\t\t= :urlChat+\"/sessions\"\nreqRAG.Méthode\t\t\t\t= httpDelete\ntaContenu[\"ids\"]\t\t\t= [sessionID]\nreqRAG.Contenu\t\t\t\t= :Contenu\n\nhReponse\t\t\t\t\t= RESTEnvoie(reqRAG)\nSI ErreurDétectée ALORS\n\tRENVOYER(TexteVersHTML(ErreurInfo()))\nSINON\n\tvMaReponse = JSONVersVariant(hReponse.Contenu)\n\tSI vMaReponse.code = 0 ALORS\n\t\tRENVOYER(\"OK\")\n\tSINON\n\t\tsReponse = vMaReponse.message\n\t\tRENVOYER(sReponse)\n\tFIN\nFIN" + } + } + }, + "clsLLM": { + "type": "abstraite", + "attributs_publics": { + "Modele": "chaîne", + "prompt_system": "chaîne", + "o_temperature": "réel", + "o_top_k": "entier", + "o_top_p": "réel" + }, + "constantes_publiques": { + "dureeTraitement": "Durée", + "reponseErreur": "booléen" + }, + "attributs_proteges": { + "Contenu": "JSON", + "m_sUrlFonction": "chaîne", + "stream": "booléen", + "m_sFormat": "chaîne", + "heureDepart": "Heure", + "heureFin": "Heure" + }, + "methodes": { + "Constructeur": { + "type": "procédure", + "code": "stream = Faux" + }, + "urlBase": { + "type": "procédure protégée abstraite", + "retour": "chaîne" + }, + "cleAPI": { + "type": "procédure protégée abstraite", + "retour": "chaîne" + }, + "urlFonction": { + "type": "procédure publique", + "code": "RENVOYER(m_sUrlFonction)" + }, + "format": { + "type": "procédure publique", + "code": "RENVOYER(m_sFormat)" + }, + "model_list": { + "type": "procédure publique", + "retour": "tableau de chaînes", + "code": "tabModels est un tableau de chaînes\nRENVOYER(tabModels)" + }, + "commandeAutorisation": { + "type": "procédure publique", + "code": "RENVOYER(\"Bearer\")" + }, + "Interroger": { + "type": "procédure", + "parametres": ["sQuestion est une chaîne"], + "retour": "chaîne", + "code": "sReponse est une chaîne\nsReponse = LLM_POST(sQuestion)\nRENVOYER(sReponse)" + }, + "LLM_POST": { + "type": "procédure protégée", + "code": "// Code complet de la méthode LLM_POST" + }, + "even_LLM_POST": { + "type": "procédure protégée abstraite virtuelle", + "parametres": ["sQuestion est une chaîne "] + }, + "interrogerRetourneReponse": { + "type": "procédure protégé abstraite virtuelle", + "parametres": ["sReponse est une chaîne "], + "retour": "chaîne" + } + } + }, + "clsDeepl": { + "herite_de": "clsLLM", + "attributs": { + "langueSource": "chaîne", + "langueDesti": "chaîne", + "context": "chaîne", + "split_sentences": "chaîne", + "preserve_formatting": "booléen", + "formality": "chaîne", + "show_billed_characters": "booléen", + "tag_handling": "chaîne", + "outline_detection": "booléen", + "non_splitting_tags": "tableau de chaînes", + "splitting_tags": "tableau de chaînes", + "ignore_tags": "tableau de chaînes" + }, + "constantes_publiques": { + "glossaire_id": "tableau associatif (ccSansCasse) de chaînes", + "m_tabGlossaireListePaire": "tableau de 0 par 2 chaînes" + }, + "methodes": { + "Constructeur": { + "type": "procédure", + "code": "// Initialisation des attributs par défaut" + }, + "commandeAutorisation": { + "type": "procédure publique", + "code": "RENVOYER(\"DeepL-Auth-Key\")" + }, + "cleAPI": { + "type": "procédure protégée", + "code": "RENVOYER(\"d42ee2f7-f4e6-d437-3237-fa40b4f45e65\")" + }, + "urlBase": { + "type": "procédure protégée", + "code": "RENVOYER(\"https://api.deepl.com/v2/\")" + }, + "model_list": { + "type": "procédure", + "code": "// Code qui retourne la liste des modèles disponibles" + }, + "even_LLM_POST": { + "type": "procédure protégée", + "code": "// Code complet de gestion des paramètres DeepL" + }, + "interrogerRetourneReponse": { + "type": "procédure protégée", + "code": "// Code de traitement de la réponse DeepL" + }, + "glossaire_cree": { + "type": "procédure", + "code": "// Code de création d'un glossaire" + }, + "glossaireRetrouveID": { + "type": "procédure privée", + "code": "// Code de récupération d'ID de glossaire" + }, + "glossaireSupprime": { + "type": "procédure privée", + "code": "// Code de suppression d'un glossaire" + } + } + } + } +} \ No newline at end of file diff --git a/webdev/ROBO_MAT_Analyse_Fonctionnelle.md b/webdev/ROBO_MAT_Analyse_Fonctionnelle.md new file mode 100644 index 0000000..4419995 --- /dev/null +++ b/webdev/ROBO_MAT_Analyse_Fonctionnelle.md @@ -0,0 +1,64 @@ +# 🔍 Analyse fonctionnelle du projet ROBO_MAT + +--- + +## 🧠 Partie 1 — À quoi sert le projet `ROBO_MAT` ? + +### 📌 Hypothèse générale + +Le projet `ROBO_MAT` semble être une **interface de test ou de démonstration de plusieurs modèles LLM (Large Language Models)** connectés via différentes classes, chacune représentant un moteur ou un fournisseur : + +| Classe | Description fonctionnelle | +|----------------|-----------------------------------------------------| +| `clsMistral` | Dialogue avec le modèle Mistral (peut-être local) | +| `clsOllama` | Dialogue avec Ollama (exécutable local ou API) | +| `clsDeepSeek` | Dialogue avec un modèle nommé DeepSeek | +| `clsPerplexity`| Dialogue avec l’API Perplexity | +| `clsDeepl` | Appel au service de traduction DeepL | +| `clsLLM` | Probable classe générique/base pour tous les LLM | +| `clsRAG` | Fonction RAG (Retrieve & Generate) pour améliorer la pertinence des réponses | + +Ces classes sont toutes **rassemblées dans un composant interne `LLM`**, ce qui laisse penser qu’il s’agit d’un **module central** dédié à l'interaction avec différents moteurs d'IA. + +--- + +### 🧩 Page `PAGE_TEST`[[ROBO_MAT_Analyse_Page_TEST_et_LLM]] + +Cette page semble être une **interface de test utilisateur** avec différents boutons. +Chaque bouton appelle une méthode spécifique dans l’une des classes LLM, permettant : +- de tester les réponses, +- de comparer les modèles, +- de valider les appels aux services distants. + +**Aucune logique métier complexe n’est détectée** dans cette page. Elle sert probablement de démonstrateur technique. + +--- + +## 🧭 Organisation technique + +Voici l’ordre dans lequel les composants sont organisés : + +- **PAGE_TEST** (interface de test) +- **Composant interne `LLM`** + - Contient 7 classes : + - clsMistral [[ROBO_MAT_Analyse_clsMistral]] + - clsOllama + - clsDeepSeek + - clsPerplexity + - clsRAG + - clsLLM + - clsDeepl + +Les classes sont **écrites en WLangage** avec des sections typiques : `Déclaration`, `Constructeur`, `Méthodes`, etc. Ce découpage est analogue à une classe Python mais plus segmenté dans l’interface. + +--- + +## 🔧 Conclusion + +> Le projet `ROBO_MAT` est probablement une **boîte à outils de test LLMs** développée en WebDev. Il s’agit d’un prototype (ou brouillon) permettant de : +- Centraliser l'appel à différents modèles, +- Tester les interactions avec chacun, +- Servir de base à un futur outil plus complet (ex : assistant IA, moteur de recherche interne, interface traducteur multilangue, etc.). + +Je vais maintenant poursuivre avec l’analyse **détaillée de la page `PAGE_TEST`**, suivie des classes une par une. + diff --git a/webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md b/webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md new file mode 100644 index 0000000..47c2ed0 --- /dev/null +++ b/webdev/ROBO_MAT_Analyse_Page_TEST_et_LLM.md @@ -0,0 +1,195 @@ +# 📄 Analyse de la page PAGE_TEST & hypothèses d’appel LLM + +--- + +## 🧩 PAGE_TEST — Interface de test + +La page `PAGE_TEST` contient uniquement des éléments visuels (probablement des **boutons**), chacun **lié à une méthode spécifique** d’une des classes du composant interne `LLM`. + +### 🔍 Objectif : +Elle sert de **panneau de commande utilisateur** pour tester différents moteurs d’IA ou services via les classes : + +- `clsMistral` +- `clsOllama` +- `clsDeepSeek` +- `clsPerplexity` +- `clsRAG` +- `clsLLM` +- `clsDeepl` + +--- + +## 🔗 Hypothèses sur les appels aux modèles LLM + +Voici les lignes de code extraites contenant des éléments pouvant être des **URLs ou endpoints d’API** : + +```wlanguage +- - [clsOllama](#clsOllama) +- hReponse est une httpRéponse +- reqLLM est une restRequête +- reqLLM.URL = :urlBase+"models" +- reqLLM.Méthode = httpGet +- SI :cleAPI <> "" ALORS +- reqLLM.Entête["Authorization"] = "Bearer " + cleAPI +- #### Récupération de la propriété urlBase +- PROCÉDURE PUBLIQUE urlBase() +- RENVOYER("https://api.mistral.ai/v1/") +- #### Affectation de la propriété urlBase +- #### Récupération de la propriété cleAPI +- PROCÉDURE PUBLIQUE cleAPI() +- #### Affectation de la propriété cleAPI +- #### Récupération de la propriété urlFonction +- PROCÉDURE PUBLIQUE urlFonction() +- #### Affectation de la propriété urlFonction +- ID of the model to use. You can use the List Available Models API to see all of your available models, or see our Model overview for model descriptions. +- ### 🧠 clsOllama +- clsOllama est une Classe +- raw est un booléen // si true, aucun formatage ne sera appliqué à l'invite. Vous pouvez choisir d'utiliser le paramètre raw si vous spécifiez une invite entièrement formatée dans votre demande à l'API. +- o_min_p est un réel // Alternative au top_p, elle vise à assurer un équilibre entre la qualité et la variété. Le paramètre p représente la probabilité minimale pour qu'un jeton soit pris en considération, par rapport à la probabilité du jeton le plus probable. Par exemple, avec p=0,05 et le jeton le plus probable ayant une probabilité de 0,9, les logits ayant une valeur inférieure à 0,045 sont filtrés. (Valeur par défaut : 0,0) +- Dans l'API d'Ollama, le paramètre template dans la fonction POST /api/generate permet de spécifier un modèle de prompt personnalisé qui remplace celui défini dans le fichier de modèle (Modelfile). Le modèle de prompt est utilisé pour structurer la manière dont le modèle générera sa réponse en fonction du prompt fourni. +- Par défaut, chaque modèle Ollama est associé à un modèle de prompt prédéfini, tel que : +- En utilisant le paramètre template, vous pouvez fournir un modèle de prompt spécifique pour une requête donnée, ce qui permet de personnaliser la structure de la réponse du modèle pour cette interaction particulière. +- Par exemple, si vous souhaitez que le modèle réponde sous forme de liste numérotée, vous pouvez inclure le paramètre template dans votre requête comme suit +- #### Terminaison de clsOllama +- #### Récupération de la propriété urlBase +- PROCÉDURE PROTÉGÉE urlBase() : chaîne +- RENVOYER("http://217.182.105.173:11434/") +- #### Affectation de la propriété urlBase +- #### Récupération de la propriété cleAPI +- PROCÉDURE PROTÉGÉE cleAPI() : chaîne +- #### Affectation de la propriété cleAPI +- m_sUrlFonction = "api/generate" +- Récupération de la propriété cleAPI +- PROCÉDURE PROTÉGÉE cleAPI() : chaîne +- #### Affectation de la propriété cleAPI +- #### Récupération de la propriété urlBase +- PROCÉDURE PROTÉGÉE urlBase() : chaîne +- RENVOYER("https://api.deepseek.com/") +- #### Affectation de la propriété urlBase +- #### Récupération de la propriété urlFonction +- PROCÉDURE urlFonction() : chaîne +- #### Affectation de la propiété urlFonction +- PROCÉDURE urlFonction(Valeur est une chaîne) +- #### Récupération de la propriété cleAPI +- PROCÉDURE PROTÉGÉE cleAPI() : chaîne +- #### Affectation de la propriété cleAPI +- #### Récupération de la propriété urlBase +- PROCÉDURE PROTÉGÉE urlBase() : chaîne +- RENVOYER("https://api.perplexity.ai/chat/completions") +- #### Affectation de la propriété urlBase +- "https://www.youtube.com/watch?v=TOrph-vS_a8", +- "https://www.teidebynight.com/how-many-stars-are-in-the-milky-way/" +- reqRAG est une restRequête +- #### Récupération de la propriété urlBase +- PROCÉDURE PRIVÉE urlBase() +- RENVOYER("http://10.103.0.100/api/v1/chats/") +- #### Affectation de la propriété urlBase +- #### Récupération de la propriété urlChat +- PROCÉDURE PRIVÉE urlChat() +- RENVOYER(:urlBase+chatID+"/") +- #### Affectation de la propriété urlChat +- hReponse est une httpRéponse +- reqRAG.URL = :urlChat+"sessions" +- reqRAG.Méthode = httpPost +- hReponse est une httpRéponse +- reqRAG.URL = :urlChat+"completions" +- reqRAG.Méthode = httpPost +- hReponse est une httpRéponse +- reqRAG.URL = :urlChat+"/sessions" +- reqRAG.Méthode = httpDelete +- // https://github.com/ollama/ollama/blob/main/docs/modelfile.md#format +- m_sUrlFonction est une chaîne +- #### Récupération de la propriété urlBase +- PROCÉDURE PROTÉGÉ ABSTRAITE urlBase() : chaîne +- #### Affectation de la propriété urlBase +- #### Récupération de la propriété cleAPI +- PROCÉDURE PROTÉGÉ ABSTRAITE cleAPI() :chaîne +- #### Affectation de la propriété cleAPI +- #### Récupération de la propriété urlFonction +- PROCÉDURE PUBLIQUE urlFonction() +- RENVOYER(m_sUrlFonction) +- #### Affectation de la propriété urlFonction +- PROCÉDURE PUBLIQUE urlFonction(Valeur) +- m_sUrlFonction = Valeur +- hReponse est une httpRéponse +- reqLLM est une restRequête +- reqLLM.URL = :urlBase+urlFonction +- reqLLM.Méthode = httpPost +- SI :cleAPI <> "" ALORS +- reqLLM.Entête["Authorization"] = :commandeAutorisation+ " " + :cleAPI +- #### Récupération de la propriété cleAPI +- PROCÉDURE PROTÉGÉE cleAPI() : chaîne +- #### Affectation de la propriété cleAPI +- #### Récupération de la propriété urlBase +- PROCÉDURE PROTÉGÉE urlBase() : chaîne +- RENVOYER("https://api.deepl.com/v2/") +- #### Affectation de la propriété urlBase +- #### Récupération de la propriété urlFonction +- PROCÉDURE urlFonction() : chaîne +- #### Affectation de la propriété urlFonction +- PROCÉDURE urlFonction(Valeur est une chaîne) +- hReponse est une httpRéponse +- reqLLM est une restRequête +- reqLLM.URL = :urlBase+"glossary-language-pairs" +- reqLLM.Méthode = httpGet +- SI :cleAPI <> "" ALORS +- reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +- POUR i = 1 _À_ TableauOccurrence(vReponse.supported_languages) +- TableauAjouteLigne(m_tabGlossaireListePaire,vReponse.supported_languages[i].source_lang,vReponse.supported_languages[i].target_lang) +- Voir https://developers.deepl.com/docs/api-reference/translate +- Text to be translated. Only UTF-8-encoded plain text is supported. The parameter may be specified multiple times and translations are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences. Up to 50 texts can be sent for translation in one request. +- Language of the text to be translated. If omitted, the API will attempt to detect the language of the text and translate it. You can find supported source languages here. +- The language into which the text should be translated. You can find supported target languages here. +- Specifies which DeepL model should be used for translation. The quality_optimized value is supported only in the Pro v2 API at this time (https://api.deepl.com/v2/translate). +- latency_optimized (uses lower latency “classic” translation models, which support all language pairs; default value) +- quality_optimized (uses higher latency, improved quality “next-gen” translation models, which support only a subset of language pairs; if a language pair that is not supported by next-gen models is included in the request, it will fail. Consider using prefer_quality_optimized instead.) +- prefer_quality_optimized (prioritizes use of higher latency, improved quality “next-gen” translation models, which support only a subset of DeepL languages; if a request includes a language pair not supported by next-gen models, the request will fall back to latency_optimized classic models) +- Language pairs supported by DeepL’s next-gen models are documented below. +- Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages DE (German), FR (French), IT (Italian), ES (Spanish), NL (Dutch), PL (Polish), PT-BR and PT-PT (Portuguese), JA (Japanese), and RU (Russian). Learn more about the plain/polite feature for Japanese here. +- Setting this parameter with a target language that does not support formality will fail, unless one of the prefer_... options are used. Possible options are: +- Important: This requires the source_lang parameter to be set and the language pair of the glossary has to match the language pair of the request. +- Note: At some point in the future, we intend to include billed_characters in the API response by default, at which point it will be necessary to set show_billed_characters to false in order to for an API response not to include billed_characters. We will notify users in advance of making this change. +- hReponse est une httpRéponse +- reqLLM est une restRequête +- reqLLM.URL = :urlBase+"glossaries" +- reqLLM.Méthode = httpPost +- SI :cleAPI <> "" ALORS +- reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +- hReponse est une httpRéponse +- reqLLM est une restRequête +- reqLLM.URL = :urlBase+"glossaries" +- reqLLM.Méthode = httpGet +- SI :cleAPI <> "" ALORS +- reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +- hReponse est une httpRéponse +- reqLLM est une restRequête +- reqLLM.URL = :urlBase+"glossaries/"+sID +- reqLLM.Méthode = httpDelete +- SI :cleAPI <> "" ALORS +- reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +- - Les dépendances vers des APIs +``` + +### 🔧 Interprétation & Hypothèses : + +| Élément détecté | Hypothèse | +|----------------------------------------|---------------------------------------------------------------------------| +| `localhost:11434` | Serveur Ollama local en écoute sur le port par défaut (`11434`) | +| `http://` ou `https://` avec `/api/` | Appel à une API REST distante (ex: DeepL, Perplexity) | +| `127.0.0.1` | Appels test en local, donc modèles exécutés sur la machine de dev | +| `clsRAG`, `clsLLM`, `clsDeepl` | Probables wrappers d’appel à des APIs locales ou distantes | + +### 📎 Probabilité d’implémentation actuelle : +✔️ **Modèles locaux** (Ollama, Mistral) → via `localhost`, probablement exécutés via Ollama CLI/API. +✔️ **Modèles distants** (DeepL, Perplexity) → via API REST, avec ou sans clé API (non visible ici). + +--- + +## 📌 Conclusion intermédiaire + +> La page `PAGE_TEST` joue le rôle d’un **tableau de bord de test multi-LLM**, avec des **appels dirigés vers des APIs locales ou distantes** selon les classes. +Elle est **simple**, mais très utile pour tester rapidement les réponses des différents moteurs IA via un clic utilisateur. + +--- + +👉 Je suis prêt à continuer avec l’analyse **classe par classe**, en commençant par `clsMistral` si cela te convient. diff --git a/webdev/ROBO_MAT_Code_WLangage_Organise.md b/webdev/ROBO_MAT_Code_WLangage_Organise.md new file mode 100644 index 0000000..b6a828c --- /dev/null +++ b/webdev/ROBO_MAT_Code_WLangage_Organise.md @@ -0,0 +1,1512 @@ +# 📘 Analyse complète du projet WebDev : ROBO_MAT + +> Objectif : Regrouper **tout le code WLangage** du projet dans un seul fichier `.md`, organisé selon les conventions et les sections de WebDev, afin de faciliter la compréhension, l’analyse et la réécriture en Python. + +--- + +## 🧭 Table des matières + +1. [Code du projet (initialisation/fermeture)](#code-du-projet) +2. [Pages](#pages) + - [PAGE_TEST](#page_test) +3. [Classes](#classes) + - [clsMistral](#clsMistral) + - [clsOllama](#clsOllama) + - [clsDeepSeek](#clsDeepSeek) + - [clsPerplexity](#clsPerplexity) + - [clsRAG](#clsRAG) + - [clsLLM](#clsLLM) + - [clsDeepl](#clsDeepl) +4. [Procédures globales](#procedures-globales) + - [info_connexion.gds](#info_connexion) + +--- + +## 🔧 Code du projet + +### ▶️ Initialisation du projet +```wlanguage + +``` + +### ⏹️ Fermeture du projet +```wlanguage + +``` + +--- + +## 📄 Pages + +### 🧩 PAGE_TEST + +#### 🏗️ Déclaration +```wlanguage + +``` + +#### ▶️ Événements +```wlanguage + +``` + +#### 🔧 Terminaison +```wlanguage + +``` + +#### 📍 Autres onglets (si présents) +```wlanguage + +``` + +--- + +## 🧱 Classes + +> 💡 Pour chaque classe, on respecte les sections affichées dans WebDev : **Déclaration, Constructeur, Destructeur, Méthodes, etc.** + +### 🧠 clsMistral + +#### 🔹 Déclaration de clsMistral +```wlanguage +clsMistral est une Classe + hérite de clsLLM + maxToken est un entier + seed est un entier + presence_penalty est un réel + frequency_penalty est un réel + n est un entier + prediction est un JSON + safe_prompt est un booléen + o_stop est une chaîne + PRIVÉ + m_tabModels est un tableau de chaînes +FIN +``` + +#### Terminaison de clsMistral +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() + +//:Modele = "open-mixtral-8x22b-2404" +:Modele = "mistral-large-latest" +:o_temperature = 0.2 +:o_top_p = 1 +:maxToken = 1000 +:presence_penalty = 0 +:frequency_penalty = 0 +:n=1 +prediction.type = "content" +prediction.content = "" +safe_prompt = Faux +o_stop = "string" +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE PUBLIQUE model_list() +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant + +SI TableauOccurrence(m_tabModels) > 1 ALORS + RENVOYER (m_tabModels) +FIN + +reqLLM.URL = :urlBase+"models" +reqLLM.Méthode = httpGet +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = "Bearer " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 200 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + POUR i = 1 _À_ TableauOccurrence(vReponse.data) + TableauAjoute(m_tabModels,vReponse.data[i].id) + FIN +SINON + TableauAjoute(m_tabModels,hReponse.Contenu) +FIN +RENVOYER(m_tabModels) +``` + +#### Affectation de la propriété model_list +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PUBLIQUE urlBase() +RENVOYER("https://api.mistral.ai/v1/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PUBLIQUE cleAPI() + +RENVOYER("2iGzTzE9csRQ9IoASoUjplHwEjA200Vh") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE PUBLIQUE urlFonction() + +RENVOYER("chat/completions") +``` +#### Affectation de la propriété urlFonction +```wlangage + +``` +#### ❌ Destructeur +```wlanguage +PROCÉDURE Destructeur() + +``` + +#### 📦 Méthode interrogerRetourneReponse +```wlanguage +PROCÉDURE PROTÉGÉE interrogerRetourneReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne +vReponse est un Variant +vReponse = JSONVersVariant(sReponse) +sRetour = vReponse.choices[1].message.content +RENVOYER(sRetour) +``` +#### Méthode even_LLM_POST +```wlangage +/* +Model (string) or Model (null) (Model) + +ID of the model to use. You can use the List Available Models API to see all of your available models, or see our Model overview for model descriptions. +Temperature (number) or Temperature (null) (Temperature) + +What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. The default value varies depending on the model you are targeting. Call the /models endpoint to retrieve the appropriate value. +top_p +number (Top P) [ 0 .. 1 ] +Default: 1 + +Nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. +Max Tokens (integer) or Max Tokens (null) (Max Tokens) + +The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. +stream +boolean (Stream) +Default: false + +Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. +Stop (string) or Array of Stop (strings) (Stop) + +Stop generation if this token is detected. Or if one of these tokens is detected when providing an array +Random Seed (integer) or Random Seed (null) (Random Seed) + +The seed to use for random sampling. If set, different calls will generate deterministic results. +required + +Array of any (Messages) + +The prompt(s) to generate completions for, encoded as a list of dict with role and content. +object (ResponseFormat) +Array of Tools (objects) or Tools (null) (Tools) +ToolChoice (object) or ToolChoiceEnum (string) (Tool Choice) +Default: "auto" +presence_penalty +number (Presence Penalty) [ -2 .. 2 ] +Default: 0 + +presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. +frequency_penalty +number (Frequency Penalty) [ -2 .. 2 ] +Default: 0 + +frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. +N (integer) or N (null) (N) + +Number of completions to return for each request, input tokens are only billed once. +object (Prediction) +Default: {"type":"content","content":""} + +Enable users to specify expected results, optimizing response times by leveraging known or predictable content. This approach is especially effective for updating text documents or code files with minimal changes, reducing latency while maintaining high-quality results. +safe_prompt +boolean +Default: false + +Whether to inject a safety prompt before all conversations. + + + +*/ +PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne ) + +Contenu.messages[1].role = "system" +Contenu.messages[1].content = :prompt_system +Contenu.messages[2].role = "user" +Contenu.messages[2].content = sQuestion +Contenu.temperature = o_temperature +Contenu.top_p = o_top_p +SI :maxToken <> 0 ALORS + Contenu.max_tokens = maxToken +FIN +SI :seed <> 0 ALORS + Contenu.random_seed = :seed +FIN +SI :format <> "" ALORS + Contenu.response_format = :format +FIN +// Contenu.tools A déterminer +// Contenu.tool_choice A déterminer +Contenu.presence_penalty = presence_penalty +Contenu.frequency_penalty = frequency_penalty +Contenu.n = 1 +Contenu.prediction = :prediction +Contenu.stop = o_stop +``` +--- + +### 🧠 clsOllama +#### 🔹 Déclaration +```wlanguage +clsOllama est une Classe + hérite de clsLLM + + suffix est une chaîne + images est un Buffer + + // Options : Définie ci-dessous + template est une chaîne // le modèle d'invite à utiliser (remplace ce qui est défini dans le Modelfile) + // stream est un booléen Définie en protégé car webdev ne fonctionne pas avec le stream activé + raw est un booléen // si true, aucun formatage ne sera appliqué à l'invite. Vous pouvez choisir d'utiliser le paramètre raw si vous spécifiez une invite entièrement formatée dans votre demande à l'API. + keep_alive est une Durée // contrôle la durée pendant laquelle le modèle restera chargé en mémoire à la suite de la demande (par défaut : 5m) + + o_mirostat est un entier // Active l'échantillonnage Mirostat pour contrôler la perplexité. (par défaut : 0, 0 = désactivé, 1 = Mirostat, 2 = Mirostat 2.0) + o_mirostat_eta est un réel // Influe sur la vitesse à laquelle l'algorithme réagit au retour d'information du texte généré. Un taux d'apprentissage plus faible entraînera des ajustements plus lents, tandis qu'un taux d'apprentissage plus élevé rendra l'algorithme plus réactif. (Valeur par défaut : 0,1) + o_mirostat_tau est un réel // Contrôle l'équilibre entre la cohérence et la diversité du résultat. Une valeur plus faible permet d'obtenir un texte plus ciblé et plus cohérent. (Valeur par défaut : 5.0) + o_num_ctx est un entier // Définit la taille de la fenêtre contextuelle utilisée pour générer le prochain jeton. (Valeur par défaut : 2048) + o_repeat_last_n est un entier // Définit la distance à laquelle le modèle doit regarder en arrière pour éviter les répétitions. (Par défaut : 64, 0 = désactivé, -1 = num_ctx) + o_repeat_penalty est un réel // Définit le degré de pénalisation des répétitions. Une valeur plus élevée (par exemple, 1,5) pénalisera plus fortement les répétitions, tandis qu'une valeur plus faible (par exemple, 0,9) sera plus indulgente. (Valeur par défaut : 1,1) + + o_seed est un entier // Définit la graine de nombres aléatoires à utiliser pour la génération. En définissant un nombre spécifique, le modèle générera le même texte pour la même invite (valeur par défaut : 0). + o_stop est un JSON // Définit les séquences d'arrêt à utiliser. Lorsque ce modèle est rencontré, le LLM arrête de générer du texte et revient. Plusieurs motifs d'arrêt peuvent être définis en spécifiant plusieurs paramètres d'arrêt distincts dans un fichier modèle. + o_num_predict est un entier // Nombre maximum de tokens à prédire lors de la génération de texte. (Valeur par défaut : -1, génération infinie) + o_min_p est un réel // Alternative au top_p, elle vise à assurer un équilibre entre la qualité et la variété. Le paramètre p représente la probabilité minimale pour qu'un jeton soit pris en considération, par rapport à la probabilité du jeton le plus probable. Par exemple, avec p=0,05 et le jeton le plus probable ayant une probabilité de 0,9, les logits ayant une valeur inférieure à 0,045 sont filtrés. (Valeur par défaut : 0,0) + + // Regarder la rubrique "TEMPLATE" + + /* + Dans l'API d'Ollama, le paramètre template dans la fonction POST /api/generate permet de spécifier un modèle de prompt personnalisé qui remplace celui défini dans le fichier de modèle (Modelfile). Le modèle de prompt est utilisé pour structurer la manière dont le modèle générera sa réponse en fonction du prompt fourni. + + Par défaut, chaque modèle Ollama est associé à un modèle de prompt prédéfini, tel que : + + Copier + {{ .System }} + {{ .Prompt }} + En utilisant le paramètre template, vous pouvez fournir un modèle de prompt spécifique pour une requête donnée, ce qui permet de personnaliser la structure de la réponse du modèle pour cette interaction particulière. + + Par exemple, si vous souhaitez que le modèle réponde sous forme de liste numérotée, vous pouvez inclure le paramètre template dans votre requête comme suit + { + "model": "votre_modele", + "prompt": "Énumérez les étapes pour préparer une tasse de thé.", + "template": "{{ .System }}\n1. {{ .Prompt }}\n2. Faites chauffer de l'eau.\n3. Infusez le thé.\n4. Servez et dégustez." + } + */ + +FIN +``` + +#### Terminaison de clsOllama +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +o_mirostat = 0 +o_mirostat_eta = 0.1 +o_mirostat_tau = 5 +o_num_ctx = 2048 +o_repeat_last_n = 64 +o_repeat_penalty = 1.1 +o_temperature = 0.8 +o_seed = 0 +o_stop = [] +o_num_predict = -1 +o_top_k = 40 +o_top_p = 0.9 +o_min_p = 0 + + +raw = False +keep_alive = 5min +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne +RENVOYER("http://217.182.105.173:11434/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne +RENVOYER("") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### ❌ Destructeur +```wlanguage +PROCÉDURE Destructeur() + +``` +### Méthode Interroger +```wlangage +PROCÉDURE Interroger(LOCAL sQuestion est une chaîne ) +m_sUrlFonction = "api/generate" +RENVOYER(LLM_POST(sQuestion)) +``` +#### Méthode even_LLM_POST +```wlangage +PROCÉDURE PROTÉGÉ VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne) +Contenu.system = :prompt_system +Contenu.prompt = sQuestion +Contenu.stream = :stream +Contenu.suffix = :suffix +Contenu.format = :format +Contenu.raw = :raw +Contenu.keep_alive = :keep_alive +SI :images <> "" ALORS + // A traiter +FIN + +Contenu.options.mirostat = o_mirostat +Contenu.options.mirostat_eta = o_mirostat_eta +Contenu.options.mirostat_tau = o_mirostat_tau +Contenu.options.num_ctx = o_num_ctx +Contenu.options.repeat_last_n = o_repeat_last_n +Contenu.options.repeat_penalty = o_repeat_penalty +Contenu.options.temperature = o_temperature +Contenu.options.seed = o_seed +Contenu.options.stop = o_stop +Contenu.options.num_predict = o_num_predict +Contenu.options.top_k = o_top_k +Contenu.options.top_p = o_top_p +Contenu.options.min_p = o_min_p + + +``` + +#### 📦 Méthode interrogerRetourneReponse +```wlanguage +PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne ) +vMaReponse est un Variant +vMaReponse = JSONVersVariant(sReponse) +RENVOYER(vMaReponse.response) +``` + +--- + +### 🧠 clsDeepSeek +#### 🔹 Déclaration de clsDeepSeek +```wlanguage +clsDeepSeek est une Classe + hérite de clsLLM + frequency_penalty est un entier // Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + max_tokens est un entier /* integer between 1 and 8192. The maximum number of tokens that can be generated in the chat completion. + The total length of input tokens and generated tokens is limited by the model's context length. + IF max_tokens is NOT specified, the Default value 4096 is used. + */ + presence_penalty est un entier //Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + logprobs est un booléen // Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. + top_logprobs est un entier // An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. + tool_choice est une chaîne /* Controls which (if any) tool is called by the model. + none means the model will not call any tool and instead generates a message. + auto means the model can pick between generating a message or calling one or more tools. + required means the model must call one or more tools. + Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. + none is the default when no tools are present. auto is the default if tools are present. + */ +FIN + +``` +#### Terminaison de clsDeepSeek +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() + +:Modele = "deepseek-chat" +frequency_penalty = 0 +max_tokens = 4096 +presence_penalty = 0 +o_top_p = 1 +logprobs = Faux +top_logprobs = 0 +tool_choice = "" +``` +Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne + +RENVOYER("sk-d359d9236ca84a5986f889631832d1e6") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne + +RENVOYER("https://api.deepseek.com/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE urlFonction() : chaîne + +RENVOYER("chat/completions") +``` +#### Affectation de la propiété urlFonction +```wlangage +PROCÉDURE urlFonction(Valeur est une chaîne) +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE model_list() : tableau de chaînes + +tabRetour est un tableau de chaînes = ["deepseek-chat","deepseek-reasoner"] +RENVOYER(tabRetour) +``` +#### Affectation de la propriété model_list +```wlangage + +``` +#### destructeur +```wlangage +PROCÉDURE Destructeur() +``` +#### 📦 Méthode even_LLM_POST +```wlanguage +PROCÉDURE PROTÉGÉ VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne ) + +Contenu.messages[1].role = "system" +Contenu.messages[1].content = :prompt_system +Contenu.messages[2].role = "user" +Contenu.messages[2].content = sQuestion +Contenu.stream = :stream +Contenu.frequency_penalty = :frequency_penalty +Contenu.max_tokens = :max_tokens +Contenu.presence_penalty = :presence_penalty +SI :logprobs = Vrai ALORS + Contenu.logprobs = :logprobs + Contenu.top_logprobs = :top_logprobs +FIN +SI :tool_choice <> "" ALORS + Contenu.tool_choice = :tool_choice +FIN +``` +#### Méthode interrogerRetourReponse +```wlangage +PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne +vReponse est un Variant +vReponse = JSONVersVariant(sReponse) +sRetour = vReponse.choices[1].message.content +RENVOYER(sRetour) +``` + +--- +### 🧠 clsPerplexity +#### 🔹 Déclaration de clsPerplexity +```wlanguage +clsPerplexity est une Classe + hérite de clsLLM + maxToken est un entier + presence_penalty est un entier + frequency_penaly est un entier + search_recency_filter est une chaîne + search_domain_filter est un tableau de chaîne +FIN +``` +#### Terminaison de clsPerplexity +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +maxToken = 1000 +o_temperature = 0.5 +o_top_p = 0.8 +o_top_k = 0 +presence_penalty = 0 +frequency_penaly = 1 +search_recency_filter = "all" // year +prompt_system = "Soyez précis et concis. Répondez uniquement en français. Effectuez une recherche approfondie et fournissez des informations détaillées et à jour." +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne +RENVOYER("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") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne +RENVOYER("https://api.perplexity.ai/chat/completions") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### ❌ Destructeur +```wlanguage +PROCÉDURE Destructeur() + +``` +### Méthode Interroger +```wlangage +PROCÉDURE Interroger(LOCAL sQuestion est une chaîne) +:Modele = "sonar" +RENVOYER(LLM_POST(sQuestion)) +``` +#### Méthode even_LLM_POST +```wlangage +PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne) + +Contenu.messages[1].role = "system" +Contenu.messages[1].content = :prompt_system +Contenu.messages[2].role = "user" +Contenu.messages[2].content = sQuestion +SI :maxToken <> 0 ALORS + Contenu.max_tokens = maxToken +FIN +Contenu.temperature = o_temperature +SI :format <> "" ALORS + Contenu.response_format = :format +FIN +Contenu.top_p =o_top_p +SI TableauOccurrence(search_domain_filter) <> 0 ALORS + // ["perplexity.ai"] + Contenu.search_domain_filter = search_domain_filter +FIN +Contenu.return_images = Faux +Contenu.return_related_questions = Faux +SI search_recency_filter <> "all" ALORS + Contenu.search_recency_filter = search_recency_filter +FIN +Contenu.top_k = o_top_k +Contenu.presence_penalty = presence_penalty +Contenu.frequency_penalty = frequency_penaly +Contenu.response_format = Null +``` +#### Méthode interrogerRetourneReponse +```wlangage +/* +Format de sortie +{ + "id":"f5fd096e-b694-4135-8fd2-ab241e3c15bf", + "model":"sonar", + "created":1738769945, + "usage": + { + "prompt_tokens":13, + "completion_tokens":72, + "total_tokens":85 + }, + "citations": + [ + "https://www.youtube.com/watch?v=TOrph-vS_a8", + "https://www.teidebynight.com/how-many-stars-are-in-the-milky-way/" + ], + "object":"chat.completion", + "choices": + [ + { + "index":0, + "finish_reason":"stop", + "message": + { + "role":"assistant", + "content":"The Milky Way galaxy is estimated to contain between **100 billion and 400 billion stars**. A more precise estimate suggests that there are approximately **100 billion stars** in our galaxy. These estimates vary due to the challenges of counting stars, such as the presence of gas, dust, and black holes that obscure many stars from view[1][2]." + }, + "delta": + { + "role":"assistant", + "content":"" + } + } + ] +} +*/ +PROCÉDURE PROTÉGÉ VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne ) +vRepoonse est un Variant = JSONVersVariant(sReponse) +sRetour est une chaîne +sRetour = vRepoonse.choices[1].message.content + +RENVOYER(sRetour) +``` + +--- + +### 🧠 clsRAG +#### 🔹 Déclaration de clsRAG +```wlanguage +clsRAG est une Classe +PUBLIQUE CONSTANT + sessionID est une chaîne +PRIVÉ + reqRAG est une restRequête + taContenu est un tableau associatif de Variant + m_sChatID est une chaîne + mn_Question est un entier +FIN +``` +#### Terminaison de clsRAG +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +reqRAG.Entête["Authorization"] = "Bearer " + "ragflow-c4YTNkMzcwZDM1ODExZWZiODA2MDI0Mm" +reqRAG.Entête["Content-Type"] = "application/json" + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PRIVÉE urlBase() + +RENVOYER("http://10.103.0.100/api/v1/chats/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété chatID +```wlangage +PROCÉDURE PRIVÉE chatID() +SI m_sChatID <> "" ALORS + RENVOYER(m_sChatID) +SINON + RENVOYER("ffb1058ed4b811ef8a900242ac120003") +FIN + +``` +#### Affectation de la propriété chatID +```wlangage +PROCÉDURE PRIVÉ chatID(Valeur) + +m_sChatID = Valeur +``` +#### Récupération de la propriété Contenu +```wlangage +PROCÉDURE PRIVÉE Contenu() +bufContenu est un Buffer +Sérialise(taContenu,bufContenu,psdJSON) +RENVOYER(bufContenu) +``` +#### Affectation de la propriété Contenu +```wlangage + +``` +#### Récupération de la propriété urlChat +```wlangage +PROCÉDURE PRIVÉE urlChat() + +RENVOYER(:urlBase+chatID+"/") +``` +#### Affectation de la propriété urlChat +```wlangage + +``` +#### Destructeur +```wlangage +PROCÉDURE Destructeur() + +SI mn_Question = 0 OU EnModeTest() ALORS + supprimeSessionChat() +FIN +``` +#### 📦 Méthode creeSessionChat +```wlanguage +PROCÉDURE PRIVÉ creeSessionChat() +vMaReponse est un Variant +hReponse est une httpRéponse +TableauSupprimeTout(taContenu) +reqRAG.URL = :urlChat+"sessions" +reqRAG.Méthode = httpPost +taContenu["name"] = DateHeureVersChaîne(DateHeureSys,"AAAAMMJJ_HHmmSS") +reqRAG.Contenu = :Contenu + +hReponse = RESTEnvoie(reqRAG) +SI ErreurDétectée ALORS + RENVOYER(Faux,TexteVersHTML(ErreurInfo())) +SINON + vMaReponse = JSONVersVariant(hReponse.Contenu) + SI vMaReponse.code = 0 + :sessionID = vMaReponse.data.id + RENVOYER(Vrai,:formateReponse(vMaReponse.data.messages[1].content)) + SINON + RENVOYER(Faux,:formateReponse(vMaReponse.message)) + FIN +FIN +``` +#### Méthode Chat +```wlangage +PROCÉDURE Chat(LOCAL sQuestion est une chaîne) +bSessionCree est un booléen +sReponse est une chaîne +vMaReponse est un Variant +SI :sessionID = "" ALORS + (bSessionCree,sReponse) = creeSessionChat() + SI PAS bSessionCree ALORS + RENVOYER(:formateReponse(sReponse)) + FIN +FIN + +mn_Question++ +hReponse est une httpRéponse +TableauSupprimeTout(taContenu) +reqRAG.URL = :urlChat+"completions" +reqRAG.Méthode = httpPost +taContenu["question"] = sQuestion +taContenu["stream"] = False +taContenu["session_id"] = :sessionID +reqRAG.Contenu = :Contenu + +hReponse = RESTEnvoie(reqRAG) +SI ErreurDétectée ALORS + RENVOYER(TexteVersHTML(ErreurInfo())) +SINON + vMaReponse = JSONVersVariant(hReponse.Contenu) + SI vMaReponse.code = 0 ALORS + sReponse = vMaReponse.data.answer + RENVOYER(:formateReponse(sReponse)) + SINON + sReponse = vMaReponse.message + RENVOYER(:formateReponse(sReponse)) + FIN +FIN +``` +### Méthode formateReponse +```wlangage +PROCÉDURE PUBLIQUE formateReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne ANSI +sRetour+="
" +sRetour+=UnicodeVersAnsi(UTF8VersUnicode(MarkdownVersHTML(sReponse))) +sRetour+="
" +//sRetourANSI = UnicodeVersAnsi(sRetourUnicode) +RENVOYER(sRetour) +``` +#### Méthode formateQuestion +```wlangage +PROCÉDURE GLOBALE formateQuestion(LOCAL sQuestion est une chaîne) +sRetour est une chaîne +sRetour = "
" +sRetour+= sQuestion +sRetour+= "
" +RENVOYER(sRetour) +``` +#### Méthode supprimeSessionChat +```wlangage +PROCÉDURE PRIVÉ supprimeSessionChat() +vMaReponse est un Variant +sReponse est une chaîne +hReponse est une httpRéponse +TableauSupprimeTout(taContenu) +reqRAG.URL = :urlChat+"/sessions" +reqRAG.Méthode = httpDelete +taContenu["ids"] = [sessionID] +reqRAG.Contenu = :Contenu + +hReponse = RESTEnvoie(reqRAG) +SI ErreurDétectée ALORS + RENVOYER(TexteVersHTML(ErreurInfo())) +SINON + vMaReponse = JSONVersVariant(hReponse.Contenu) + SI vMaReponse.code = 0 ALORS + RENVOYER("OK") + SINON + sReponse = vMaReponse.message + RENVOYER(sReponse) + FIN +FIN + +``` + +--- + +### 🧠 clsLLM +#### 🔹 Déclaration de clsLLM +```wlanguage +clsLLM est une Classe + PUBLIQUE + // Paramètres + Modele est une chaîne + prompt_system est une chaîne // message système à (remplace ce qui est défini dans le fichier modèle) + + o_temperature est un réel // La température du modèle. En augmentant la température, le modèle répondra de manière plus créative. (Valeur par défaut : 0,8) + + // Options + // https://github.com/ollama/ollama/blob/main/docs/modelfile.md#format + o_top_k est un entier // Réduit la probabilité de générer des non-sens. Une valeur plus élevée (par exemple 100) donnera des réponses plus diversifiées, tandis qu'une valeur plus faible (par exemple 10) sera plus conservatrice. (Valeur par défaut : 40) + o_top_p est un réel // Fonctionne avec top-k. Une valeur élevée (par exemple, 0,95) conduira à un texte plus diversifié, tandis qu'une valeur plus faible (par exemple, 0,5) générera un texte plus ciblé et conservateur. (Valeur par défaut : 0,9) + PUBLIQUE CONSTANTE + dureeTraitement est une Durée + reponseErreur est un booléen + PROTÉGÉ + Contenu est un JSON + m_sUrlFonction est une chaîne + stream est un booléen + m_sFormat est une chaîne + heureDepart est une Heure + heureFin est une Heure +FIN +``` +#### Terminaison de clsLLM +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() +stream = Faux +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉ ABSTRAITE urlBase() : chaîne +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉ ABSTRAITE cleAPI() :chaîne +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE PUBLIQUE urlFonction() +RENVOYER(m_sUrlFonction) +``` +#### Affectation de la propriété urlFonction +```wlangage +PROCÉDURE PUBLIQUE urlFonction(Valeur) +m_sUrlFonction = Valeur +``` +#### Récupération de la propriété format +```wlangage +PROCÉDURE PUBLIQUE format() + +RENVOYER(m_sFormat) +``` +#### Affectation de la propriété format +```wlangage +PROCÉDURE PUBLIQUE format(Valeur) +m_sFormat = Valeur +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE PUBLIQUE model_list():tableau de chaînes +tabModels est un tableau de chaînes +RENVOYER(tabModels) +``` +#### Affectation de la propriété model_list +```wlangage + +``` +#### Récupération de la propriété commandeAutorisation +```wlangage +PROCÉDURE PUBLIQUE commandeAutorisation() + +RENVOYER("Bearer") +``` +#### Affectation de la propriété commandeAutorisation +```wlangage + +``` +#### Destructeur +```wlangage +PROCÉDURE Destructeur() +``` +#### 📦 Méthode Interroger +```wlanguage +PROCÉDURE Interroger(LOCAL sQuestion est une chaîne):chaîne +sReponse est une chaîne +sReponse = LLM_POST(sQuestion) +RENVOYER(sReponse) +``` +#### Méthode LLM_POST +```wlangage +PROCÉDURE PROTÉGÉE LLM_POST(LOCAL sQuestion est une chaîne):chaîne +sErreur est une chaîne +sReponse est une chaîne +hReponse est une httpRéponse +reqLLM est une restRequête + + +reqLLM.URL = :urlBase+urlFonction +reqLLM.Méthode = httpPost +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation+ " " + :cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" + +Contenu="" +SI :Modele <> "" ALORS + Contenu.model = :Modele +FIN + +even_LLM_POST(sQuestion) + +reqLLM.Contenu = Contenu +reqLLM..DuréeNonRéponse = 2min +dureeTraitement = 0 +heureDepart = HeureSys() +hReponse = RESTEnvoie(reqLLM) +SI ErreurDétectée ALORS + reponseErreur = Vrai + RENVOYER(ErreurInfo(errComplet)) +FIN +SI hReponse.CodeEtat = 200 OU hReponse.CodeEtat = 201 ALORS + sReponse = interrogerRetourneReponse(hReponse.Contenu) + heureFin = HeureSys() + dureeTraitement = heureFin - heureDepart + reponseErreur = Faux + RENVOYER(sReponse) +SINON + sErreur = hReponse.Contenu + heureFin = HeureSys() + dureeTraitement = heureFin - heureDepart + reponseErreur = Vrai + RENVOYER(sErreur) +FIN +``` +#### Méthode even_LLM_POST +```wlangage +PROCÉDURE PROTÉGÉE ABSTRAITE VIRTUELLE even_LLM_POST(LOCAL sQuestion est une chaîne ) +``` +#### Méthode interrogerRetourneReponse +```wlangage +PROCÉDURE PROTÉGÉ ABSTRAITE VIRTUELLE interrogerRetourneReponse(LOCAL sReponse est une chaîne ):chaîne +``` + +--- + +### 🧠 clsDeepl +#### 🔹 Déclaration de clsDeepl +```wlanguage +clsDeepl est une Classe + hérite de clsLLM + langueSource est une chaîne + langueDesti est une chaîne + context est une chaîne + split_sentences est une chaîne + preserve_formatting est un booléen + formality est une chaîne + show_billed_characters est un booléen + tag_handling est une chaîne + outline_detection est un booléen + non_splitting_tags est un tableau de chaînes + splitting_tags est un tableau de chaînes + ignore_tags est un tableau de chaînes +PUBLIC CONSTANTE + glossaire_id est un tableau associatif (ccSansCasse) de chaînes + m_tabGlossaireListePaire est un tableau de 0 par 2 chaînes + +FIN +``` +#### Terminaison de clsDeepl +```wlangage + +``` +#### 🛠️ Constructeur +```wlanguage +PROCÉDURE Constructeur() + +langueSource = "FR" +langueDesti = "EN" +Modele = "prefer_quality_optimized" +split_sentences = 0 +preserve_formatting = Vrai +formality = "default" // more less prefer_mode prefer_less +show_billed_characters = Faux +tag_handling = "" // xml html +outline_detection = Vrai +``` +#### Récupération de la propriété commandeAutorisation +```wlangage +PROCÉDURE PUBLIQUE commandeAutorisation() +RENVOYER("DeepL-Auth-Key") +``` +#### Affectation de la propriété commandeAutorisation +```wlangage + +``` +#### Récupération de la propriété cleAPI +```wlangage +PROCÉDURE PROTÉGÉE cleAPI() : chaîne + +RENVOYER("d42ee2f7-f4e6-d437-3237-fa40b4f45e65") +``` +#### Affectation de la propriété cleAPI +```wlangage + +``` +#### Récupération de la propriété urlBase +```wlangage +PROCÉDURE PROTÉGÉE urlBase() : chaîne +RENVOYER("https://api.deepl.com/v2/") +``` +#### Affectation de la propriété urlBase +```wlangage + +``` +#### Récupération de la propriété urlFonction +```wlangage +PROCÉDURE urlFonction() : chaîne +RENVOYER("translate") +``` +#### Affectation de la propriété urlFonction +```wlangage +PROCÉDURE urlFonction(Valeur est une chaîne) +``` +#### Récupération de la propriété model_list +```wlangage +PROCÉDURE model_list() : tableau de chaînes +tabModel est un tableau de chaîne +TableauAjoute(tabModel,"quality_optimized") +TableauAjoute(tabModel,"latency_optimized") +TableauAjoute(tabModel,"prefer_quality_optimized") +RENVOYER(tabModel) +``` +#### Affectation de la propriété model_list +```wlangage + +``` +#### Récupération de la propriété glossaire_liste_paire_possible +```wlangage +PROCÉDURE PUBLIQUE glossaire_liste_paire_possible() +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant +SI TableauOccurrence(m_tabGlossaireListePaire) > 1 ALORS + RENVOYER(m_tabGlossaireListePaire) +FIN +reqLLM.URL = :urlBase+"glossary-language-pairs" +reqLLM.Méthode = httpGet +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 200 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + TableauSupprimeTout(m_tabGlossaireListePaire) + POUR i = 1 _À_ TableauOccurrence(vReponse.supported_languages) + TableauAjouteLigne(m_tabGlossaireListePaire,vReponse.supported_languages[i].source_lang,vReponse.supported_languages[i].target_lang) + FIN +SINON + TableauAjoute(m_tabGlossaireListePaire,hReponse.Contenu) +FIN +RENVOYER(m_tabGlossaireListePaire) +``` +#### Affectation de la propriété glossaire_liste_paire_possible +```wlangage + +``` +#### Destructeur +```wlangage +PROCÉDURE Destructeur() +``` +#### 📦 Méthode even_LLM_POST +```wlanguage +/* + +Voir https://developers.deepl.com/docs/api-reference/translate + +text (required) + +Text to be translated. Only UTF-8-encoded plain text is supported. The parameter may be specified multiple times and translations are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences. Up to 50 texts can be sent for translation in one request. + +Type: array[string] + +source_lang (optional) + +Language of the text to be translated. If omitted, the API will attempt to detect the language of the text and translate it. You can find supported source languages here. + +Type: string + +target_lang (required) + +The language into which the text should be translated. You can find supported target languages here. + +Type: string + +context (optional) + +The context parameter makes it possible to include additional context that can influence a translation but is not translated itself. This additional context can potentially improve translation quality when translating short, low-context source texts such as product names on an e-commerce website, article headlines on a news website, or UI elements. + +For example: + + When translating a product name, you might pass the product description as context. + + When translating a news article headline, you might pass the first few sentences or a summary of the article as context. + + For best results, we recommend sending a few complete sentences of context in the same language as the source text. There is no size limit for the contextparameter itself, but the request body size limit of 128 KiB still applies to all text translation requests. + + If you send a request with multiple text parameters, the context parameter will be applied to each one. + + Characters included in the context parameter will not be counted toward billing (i.e. there is no additional cost for using the context parameter, and only characters sent in the text parameter(s) will be counted toward billing for text translation even when the context parameter is included in a request). + + Type: string + + model_type (optional) + + Specifies which DeepL model should be used for translation. The quality_optimized value is supported only in the Pro v2 API at this time (https://api.deepl.com/v2/translate). + + Possible values are: + + latency_optimized (uses lower latency “classic” translation models, which support all language pairs; default value) + + quality_optimized (uses higher latency, improved quality “next-gen” translation models, which support only a subset of language pairs; if a language pair that is not supported by next-gen models is included in the request, it will fail. Consider using prefer_quality_optimized instead.) + + prefer_quality_optimized (prioritizes use of higher latency, improved quality “next-gen” translation models, which support only a subset of DeepL languages; if a request includes a language pair not supported by next-gen models, the request will fall back to latency_optimized classic models) + + Requests with the model_type parameter will include an additional response field model_type_used to specify whether DeepL’s latency_optimized or quality_optimized model was used for translation. + + Note: in the future, if DeepL’s quality optimized models achieve language pair and latency performance parity with classic models, it’s possible that next-gen models will be used regardless of the value passed in the model_type parameter. + + Language pairs supported by DeepL’s next-gen models are documented below. + + + Type: enum + + split_sentences (optional) + + Sets whether the translation engine should first split the input into sentences. For text translations where tag_handling is not set to html, the default value is 1, meaning the engine splits on punctuation and on newlines. + + For text translations where tag_handling=html, the default value is nonewlines, meaning the engine splits on punctuation only, ignoring newlines. + + + The use of nonewlines as the default value for text translations where tag_handling=html is new behavior that was implemented in November 2022, when HTML handling was moved out of beta. + + Possible values are: + + 0 - no splitting at all, whole input is treated as one sentence + + 1 (default when tag_handling is not set to html) - splits on punctuation and on newlines + + nonewlines (default when tag_handling=html) - splits on punctuation only, ignoring newlines + + For applications that send one sentence per text parameter, we recommend setting split_sentences to 0, in order to prevent the engine from splitting the sentence unintentionally. + + + Please note that newlines will split sentences when split_sentences=1. We recommend cleaning files so they don't contain breaking sentences or setting the parameter split_sentences to nonewlines. + + Please note that this value will be ignored when using next-gen models (model_type_used=quality_optimized) and a value of... + + 0will be used if tag_handlingis not enabled + + nonewlines will be used if tag_handlingis enabled + + ...as these settings yield the best quality. + + Type: string + + preserve_formatting (optional) + + Sets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. + + The formatting aspects affected by this setting include: + + Punctuation at the beginning and end of the sentence + + Upper/lower case at the beginning of the sentence + + Type: boolean + + formality (optional) + + Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages DE (German), FR (French), IT (Italian), ES (Spanish), NL (Dutch), PL (Polish), PT-BR and PT-PT (Portuguese), JA (Japanese), and RU (Russian). Learn more about the plain/polite feature for Japanese here. + + Setting this parameter with a target language that does not support formality will fail, unless one of the prefer_... options are used. Possible options are: + + default (default) + + more - for a more formal language + + less - for a more informal language + + prefer_more - for a more formal language if available, otherwise fallback to default formality + + prefer_less - for a more informal language if available, otherwise fallback to default formality + + Type: string + + glossary_id (optional) + + Specify the glossary to use for the translation. + + Important: This requires the source_lang parameter to be set and the language pair of the glossary has to match the language pair of the request. + + Type: string + + show_billed_characters (optional) + + When true, the response will include an additional key-value pair with the key billed_characters and a value that is an integer showing the number of characters from the request that will be counted by DeepL for billing purposes. + + For example: "billed_characters":42 + + + + Note: At some point in the future, we intend to include billed_characters in the API response by default, at which point it will be necessary to set show_billed_characters to false in order to for an API response not to include billed_characters. We will notify users in advance of making this change. + + Type: boolean + + tag_handling (optional) + + Sets which kind of tags should be handled. Options currently available: + + xml: Enable XML tag handling; see XML handling. + + html: Enable HTML tag handling; see HTML handling. + + Type: string + + outline_detection (optional) + + The automatic detection of the XML structure won't yield best results in all XML files. You can disable this automatic mechanism altogether by setting the outline_detection parameter to false and selecting the tags that should be considered structure tags. This will split sentences using the splitting_tags parameter. + + In the example below, we achieve the same results as the automatic engine by disabling automatic detection with outline_detection=0 and setting the parameters manually to tag_handling=xml, split_sentences=nonewlines, and splitting_tags=par,title. + + Example request: + + + + A document's title + + + This is the first sentence. Followed by a second one. + This is the third sentence. + + + + Example response: + + + + Der Titel eines Dokuments + + + Das ist der erste Satz. Gefolgt von einem zweiten. + Dies ist der dritte Satz. + + + + While this approach is slightly more complicated, it allows for greater control over the structure of the translation output. + +Type: boolean + +non_splitting_tags (optional) + +Comma-separated list of XML tags which never split sentences. Learn more. + +Type: array[string] + +splitting_tags (optional) + +Comma-separated list of XML tags which always cause splits. Learn more. + +Type: array[string] + +ignore_tags (optional) + +Comma-separated list of XML tags that indicate text not to be translated. Learn more. + +Type: array[string] + +*/ +PROCÉDURE PROTÉGÉE even_LLM_POST(LOCAL sQuestion est une chaîne ) + +Contenu.text[1] = sQuestion +Contenu.source_lang = langueSource +Contenu.target_lang = langueDesti +SI context <> "" ALORS + Contenu.context = context +FIN +Contenu.model_type = :Modele +Contenu.split_sentences = split_sentences +Contenu.preserve_formatting = preserve_formatting +Contenu.formality = formality +SI glossaireRetrouveID(langueSource,langueDesti) <> "" + Contenu.glossary_id = glossaireRetrouveID(langueSource,langueDesti) +FIN +Contenu.show_billed_characters = show_billed_characters +Contenu.tag_handling = tag_handling +Contenu.outline_detection = outline_detection +SI TableauOccurrence(non_splitting_tags) <> 0 ALORS + Contenu.non_splitting_tags = non_splitting_tags +FIN +SI TableauOccurrence(splitting_tags) <> 0 ALORS + Contenu.splitting_tags = splitting_tags +FIN +SI TableauOccurrence(ignore_tags) <> 0 ALORS + Contenu.ignore_tags = ignore_tags +FIN +``` +#### Méthode interrogerRetourneReponse +```wlangage +PROCÉDURE PROTÉGÉE interrogerRetourneReponse(LOCAL sReponse est une chaîne) +sRetour est une chaîne +vReponse est un Variant +vReponse = JSONVersVariant(sReponse) +sRetour = vReponse.translations[1].text +RENVOYER(sRetour) +``` +#### Méthode glossaire_cree +```wlangage +/* + Entrées au format tsv : sourcecible + csv : source,cible + +*/ +PROCÉDURE glossaire_cree(LOCAL sLanguageSource est une chaîne, LOCAL sLangageDesti est une chaîne, LOCAL sEntrees est une chaîne,LOCAL sFormat est une chaîne = "tsv") +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant +param est un JSON + +sID est une chaîne = glossaireRetrouveID(sLanguageSource,sLangageDesti) +SI sID <> "" ALORS + glossaireSupprime(sID) +FIN + +reqLLM.URL = :urlBase+"glossaries" +reqLLM.Méthode = httpPost +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" + +param.name = ChaîneFormate(sLanguageSource,ccMajuscule)+"_"+ChaîneFormate(sLangageDesti,ccMajuscule) +param.entries = sEntrees +param.source_lang = sLanguageSource +param.target_lang = sLangageDesti +param.entries_format = sFormat + +reqLLM.Contenu = param +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 201 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + RENVOYER(vReponse.glossary_id) +SINON + RENVOYER(hReponse.Contenu) +FIN +``` +#### Méthode glossaireRetrouveID +```wlangage +PROCÉDURE PRIVÉ glossaireRetrouveID(LOCAL sLanguageSource est une chaîne, LOCAL sLangageDesti est une chaîne) +sDesignation est une chaîne = ChaîneFormate(sLanguageSource,ccMajuscule)+"_"+ChaîneFormate(sLangageDesti,ccMajuscule) +hReponse est une httpRéponse +reqLLM est une restRequête +vReponse est un Variant +SI PAS glossaire_id[sDesignation]..Vide ALORS + RENVOYER(glossaire_id[sDesignation]) +FIN +reqLLM.URL = :urlBase+"glossaries" +reqLLM.Méthode = httpGet +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +SI hReponse.CodeEtat = 200 ALORS + vReponse = JSONVersVariant(hReponse.Contenu) + TableauSupprimeTout(glossaire_id) + POUR i = 1 _À_ TableauOccurrence(vReponse.glossaries) + sDesignation = ChaîneFormate(vReponse.glossaries[i].source_lang,ccMajuscule)+"_"+ChaîneFormate(vReponse.glossaries[i].target_lang,ccMajuscule) + glossaire_id[sDesignation] = vReponse.glossaries[i].glossary_id + FIN + sDesignation = ChaîneFormate(sLanguageSource,ccMajuscule)+"_"+ChaîneFormate(sLangageDesti,ccMajuscule) + RENVOYER(glossaire_id[sDesignation]) +SINON + RENVOYER(hReponse.Contenu) +FIN + +``` +#### Méthode glossaireSupprime +```wlangage +PROCÉDURE PRIVÉE glossaireSupprime(LOCAL sID est une chaîne) +hReponse est une httpRéponse +reqLLM est une restRequête +reqLLM.URL = :urlBase+"glossaries/"+sID +reqLLM.Méthode = httpDelete +SI :cleAPI <> "" ALORS + reqLLM.Entête["Authorization"] = :commandeAutorisation + " " + cleAPI +FIN +reqLLM.Entête["Content-Type"] = "application/json" +hReponse = RESTEnvoie(reqLLM) +POUR TOUT sIDenCours,sDesignation de glossaire_id + SI sIDenCours = sID ALORS + TableauSupprime(glossaire_id,ElémentCourant) + FIN +FIN +SI hReponse.CodeEtat = 204 ALORS + RENVOYER("") +SINON + RENVOYER(hReponse.Contenu) +FIN +``` + +--- + +## 📚 Procédures globales + +### 🔧 info_connexion.gds + +#### 📌 Fonctions définies +```wlanguage +// Liste ou copie des fonctions globales +``` + +--- + +## 🧠 Notes d’analyse + +> Utilise cette section pour noter : +- Les interactions entre les objets +- Les appels entre classes +- Les dépendances vers des APIs +- Ce que chaque objet semble faire +- Ce que tu veux changer / améliorer en Python + +[[ROBO_MAT_Analyse_Fonctionnelle]] + +![[wlangage_class_code.json]] \ No newline at end of file diff --git a/webdev/Rappel de certaines notions WLangage et Classes.md b/webdev/Rappel de certaines notions WLangage et Classes.md new file mode 100644 index 0000000..bf78de5 --- /dev/null +++ b/webdev/Rappel de certaines notions WLangage et Classes.md @@ -0,0 +1,75 @@ + +--- +Merci pour ce JSON très bien structuré, il va grandement faciliter l'analyse. Voici ce que nous allons faire étape par étape, comme demandé : + +--- + +## 🧠 1. Rappel des notions « Récupération / Affectation » en WLangage + +|Terme simplifié|Nom WLangage réel|Description| +|---|---|---| +|Récupération|`RENVOYER(...)`|Renvoie une valeur depuis une fonction / méthode, équivalent au `return` Python.| +|Affectation|`variable = valeur`|Affectation d'une valeur à une variable, comme en Python (`var = value`).| +|Accès attribut|`:attribut`|Accès à l’attribut de l’objet courant (`self.attribut` en Python).| +|Paramètre|`LOCAL nom est un type`|Déclaration de paramètres, équivalent à `def f(nom: type)` en Python.| + +Exemples : + +```wlanguage +PROCÉDURE maFonction() +sTexte est une chaîne = "Bonjour" +RENVOYER(sTexte) +``` + +```python +def maFonction(): + sTexte = "Bonjour" + return sTexte +``` + +--- + +## 🧱 2. Rappel complet des concepts de **classes** en WLangage + +Le système objet de WLangage est inspiré d'autres langages objets, mais avec quelques spécificités : + +|Élément|En WLangage|Équivalent Python|Remarques| +|---|---|---|---| +|Déclaration de classe|`CLASSE MaClasse`|`class MaClasse:`|Identique| +|Héritage|`CLASSE MaClasse HÉRITE MaBase`|`class MaClasse(MaBase):`|Identique| +|Attribut privé|`x est un entier (PRIVÉ)`|`self._x: int` ou `__x`|Respect de l'encapsulation| +|Attribut protégé|`x (PROTÉGÉ)`|`self._x`|Convention| +|Attribut public|`x` ou `x (PUBLIC)`|`self.x`|Accès libre| +|Constructeur|`PROCÉDURE Constructeur()`|`def __init__(self):`|Spécifique| +|Destructeur|`PROCÉDURE Destructeur()`|`def __del__(self):`|Rarement utile en Python| +|Méthode virtuelle|`PROCÉDURE VIRTUELLE ...`|Méthode définie mais appelée dans une classe dérivée|| +|Méthode abstraite|`PROCÉDURE ABSTRAITE ...`|`@abstractmethod` (via `abc` en Python)|Pas d’implémentation ici| + +--- + +### Exemple WLangage : + +```wlanguage +CLASSE MaClasse + x est un entier (PROTÉGÉ) + + PROCÉDURE Constructeur() + x = 5 + + PROCÉDURE getX() : entier + RENVOYER(x) +FIN +``` + +### Équivalent Python : + +```python +class MaClasse: + def __init__(self): + self._x = 5 + + def get_x(self) -> int: + return self._x +``` + +--- diff --git a/webdev/structure_projet_robo_mat.md b/webdev/structure_projet_robo_mat.md new file mode 100644 index 0000000..e929864 --- /dev/null +++ b/webdev/structure_projet_robo_mat.md @@ -0,0 +1,23 @@ +# 🗂️ Structure du projet WebDev : ROBO_MAT + +> Voici une version Markdown de la structure du dossier principal pour documenter ton projet dans Obsidian. + +``` +C:\MES PROJETS\ROBO_MAT +├── robo_mat.wdp <- Fichier principal du projet +├── robo_mat.env, .wws <- Fichiers de configuration +├── PAGE_TEST.wwh <- Page test (interface) +├── 210 Material Design\ <- Thèmes, icônes, SVG, WPC, WAMB +├── Exe\ <- Fichiers générés +├── LLM\ <- Contient les classes WDC liées aux LLM (Ollama, Mistral, etc.) +├── robo_mat.cpl\FERNAND\ <- Cache utilisateur local (.wbc, .wrc, etc.) +├── ROBO_MAT_WEB\ <- Génération Web : CSS, JS, ressources graphiques +``` + +> 🔍 Fichiers de code à explorer en priorité : +- `.wwh` → Pages Web +- `.wdc` → Classes (peuvent contenir du code WLangage) +- `.wdg`, `.wpg`, `.wpr`, `.wdm` (si présents) +- Dossier `FERNAND\00000000\` → fichiers compilés mais nommés selon les objets sources + +[[00_Template_Analyse_ROBO_MAT]] \ No newline at end of file