Эх сурвалжийг харах

version 2 automatic scraping

Nadine Elleuch 1 жил өмнө
parent
commit
65b7905819

BIN
agent_ai/__pycache__/chunking.cpython-312.pyc


BIN
agent_ai/__pycache__/embedding_index.cpython-312.pyc


BIN
agent_ai/__pycache__/scraping.cpython-312.pyc


+ 9 - 3
agent_ai/chunking.py

@@ -10,17 +10,20 @@ model = SentenceTransformer('all-MiniLM-L6-v2')
 
 
 MIN_WORDS_PER_CHUNK = 10
 MIN_WORDS_PER_CHUNK = 10
 
 
-def semantic_chunking(sentences, similarity_threshold=0.10, max_words_per_chunk=150):
+def semantic_chunking(sentences, similarity_threshold=0.8, max_words_per_chunk=200):
+    #initialisation des listes
     chunks = []
     chunks = []
     current_chunk = []
     current_chunk = []
     current_embeddings = []
     current_embeddings = []
 
 
+    # encoder toutes les phrases en vecteurs avec le modèle SentenceTransformer
     sentence_embeddings = model.encode(sentences)
     sentence_embeddings = model.encode(sentences)
 
 
+    # parcourir chaque phrase et son embedding associé
     for i, (sentence, embedding) in enumerate(zip(sentences, sentence_embeddings)):
     for i, (sentence, embedding) in enumerate(zip(sentences, sentence_embeddings)):
-        sentence = sentence.strip()
+        sentence = sentence.strip() 
         if not sentence:
         if not sentence:
-            continue
+            continue  # ignorer les phrases vides
 
 
         word_count = len(sentence.split())
         word_count = len(sentence.split())
 
 
@@ -31,10 +34,12 @@ def semantic_chunking(sentences, similarity_threshold=0.10, max_words_per_chunk=
             current_embeddings.append(embedding)
             current_embeddings.append(embedding)
             continue
             continue
 
 
+        # Si le chunk actuel est vide, on l'initialise avec la phrase actuelle
         if not current_embeddings:
         if not current_embeddings:
             current_chunk.append(sentence)
             current_chunk.append(sentence)
             current_embeddings.append(embedding)
             current_embeddings.append(embedding)
         else:
         else:
+            # calculer la similarité entre la phrase courante et le chunk en cours (moyenne des embeddings)
             mean_embedding = np.mean(current_embeddings, axis=0)
             mean_embedding = np.mean(current_embeddings, axis=0)
             sim = cosine_similarity([embedding], [mean_embedding])[0][0]
             sim = cosine_similarity([embedding], [mean_embedding])[0][0]
 
 
@@ -49,6 +54,7 @@ def semantic_chunking(sentences, similarity_threshold=0.10, max_words_per_chunk=
                 current_embeddings = [embedding]
                 current_embeddings = [embedding]
 
 
     if current_chunk:
     if current_chunk:
+         # Sinon on ferme le chunk en cours
         chunk_text = " ".join(current_chunk)
         chunk_text = " ".join(current_chunk)
         if len(chunk_text.split()) >= MIN_WORDS_PER_CHUNK:
         if len(chunk_text.split()) >= MIN_WORDS_PER_CHUNK:
             chunks.append(chunk_text)
             chunks.append(chunk_text)

+ 2 - 2
agent_ai/embedding_index.py

@@ -11,6 +11,7 @@ La fonction search_faiss cherche les vecteurs les plus proches d’un vecteur do
 
 
 import numpy as np
 import numpy as np
 import faiss
 import faiss
+import json
 
 
 """
 """
 Construire un index FAISS à partir d'une matrice d'embeddings pour pouvoir faire des recherches rapides par similarité
 Construire un index FAISS à partir d'une matrice d'embeddings pour pouvoir faire des recherches rapides par similarité
@@ -39,5 +40,4 @@ def search_faiss(index, query_embeddings, top_k=10):
 
 
     faiss.normalize_L2(query_embeddings)
     faiss.normalize_L2(query_embeddings)
     distances, indices = index.search(query_embeddings, top_k)
     distances, indices = index.search(query_embeddings, top_k)
-    return distances, indices  # Ne pas extraire [0] si batch
-
+    return distances, indices  

+ 187 - 27
agent_ai/scraping.py

@@ -1,36 +1,196 @@
-"""
-scraping.py
+from bs4 import BeautifulSoup
+from agent_ai.auth import session
+from urllib.parse import urljoin, urlparse
+import time
+import hashlib
+import json
+import random
+from concurrent.futures import ThreadPoolExecutor, as_completed
+import os
 
 
-Récupération du contenu de plusieurs pages web en accédant à leur mode édition
+BASE_URL = "https://wiki.intersel.fr/"
+VISITED = set()
 
 
-"""
+USER_AGENTS = [
+    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
+]
 
 
-from bs4 import BeautifulSoup
-from agent_ai.auth import session
+def random_headers():
+    return {
+        "User-Agent": random.choice(USER_AGENTS)
+    }
+
+def hash_text(text):
+    return hashlib.md5(text.encode("utf-8")).hexdigest()
+
+def fetch_single_page(url, old_hashes):
+    try:
+        headers = random_headers()
+        edit_url = url + "&do=edit" if "?" in url else url + "?do=edit"
+        response = session.get(edit_url, headers=headers, timeout=10)
+
+        if response.status_code != 200:
+            return url, None, None
+
+        # 🔥 Forcer l'encodage UTF-8 pour éviter les caractères bizarres
+        response.encoding = 'utf-8'
+
+        if "text/html" not in response.headers.get("Content-Type", ""):
+            return url, None, None
+
+        soup = BeautifulSoup(response.text, "html.parser")
+        textarea = soup.find("textarea", {"name": "wikitext"})
+
+        if textarea:
+            raw_text = textarea.get_text(separator="\n").strip()
+            current_hash = hash_text(raw_text)
+
+            if old_hashes.get(url) != current_hash:
+                print(f"🆕 Modifiée : {url}")
+                return url, raw_text, current_hash
+            else:
+                print(f"✅ Inchangée : {url}")
+        else:
+            print(f"⚠️ Pas de <textarea> pour {url}")
+    except Exception as e:
+        print(f"❌ Erreur pour {url}: {e}")
+
+    # 💡 Petite pause aléatoire
+    time.sleep(random.uniform(0.5, 2))
+    return url, None, None
+
+
+def fetch_single_page(url, old_hashes):
+    try:
+        headers = random_headers()
+        edit_url = url + "&do=edit" if "?" in url else url + "?do=edit"
+        response = session.get(edit_url, headers=headers, timeout=10)
+
+        if response.status_code != 200:
+            return url, None, None
+
+        response.encoding = 'utf-8'
+
+        if "text/html" not in response.headers.get("Content-Type", ""):
+            return url, None, None
+
+        soup = BeautifulSoup(response.text, "html.parser")
+        textarea = soup.find("textarea", {"name": "wikitext"})
+
+        if textarea:
+            raw_text = textarea.get_text(separator="\n").strip()
+            current_hash = hash_text(raw_text)
+
+            if old_hashes.get(url) != current_hash:
+                print(f"🆕 Modifiée : {url}")
+                return url, raw_text, current_hash
+            else:
+                print(f"✅ Inchangée : {url}")
+        else:
+            print(f"⚠️ Pas de <textarea> pour {url}")
+    except Exception as e:
+        print(f"❌ Erreur pour {url}: {e}")
 
 
-"""
-Récupère le contenu de plusieurs pages web en accédant à leur mode édition
-"""
-def fetch_all_pages_content(urls):
+    time.sleep(random.uniform(0.5, 2))
+    return url, None, None
+
+def fetch_all_pages_content(urls, old_hashes):
     url_texts = {}
     url_texts = {}
-    for url in urls:
+    new_hashes = {}
+
+    with ThreadPoolExecutor(max_workers=5) as executor:
+        futures = [executor.submit(fetch_single_page, url, old_hashes) for url in urls]
+
+        for future in as_completed(futures):
+            url, text, current_hash = future.result()
+            if text:
+                url_texts[url] = text
+                new_hashes[url] = current_hash
+            elif current_hash:
+                new_hashes[url] = current_hash
+
+    return url_texts, new_hashes
+
+def is_valid_wiki_url(url):
+    parsed = urlparse(url)
+    return (
+        parsed.netloc == "wiki.intersel.fr"
+        and "do=" not in parsed.query
+        and not url.endswith((".jpg", ".png", ".pdf", ".docx", ".xlsx"))
+        and "#" not in url
+    )
+
+def crawl_wiki(start_url, existing_urls, max_pages=500):
+    visited = set(existing_urls)
+    to_visit = [start_url]
+
+    while to_visit and len(visited) < max_pages:
+        current_url = to_visit.pop(0)
+        if current_url in visited:
+            continue
+
+        print(f"🔎 Visiting: {current_url}")
+        visited.add(current_url)
+
         try:
         try:
-            # modifier l'url pour accéder à la version édition de la page 
-            edit_url = url + "&do=edit" if "?" in url else url + "?do=edit"
-            response = session.get(edit_url)
-            if response.status_code == 200:
-                soup = BeautifulSoup(response.text, "html.parser")
-                # Trouver la balise <textarea name="wikitext">
-                textarea = soup.find("textarea", {"name": "wikitext"})
-                if textarea:
-                    raw_text = textarea.text  # Extraire le contenu texte brut
-                    url_texts[url] = raw_text  # Enregistrer dans le dictionnaire
-                else:
-                    print(f"⚠️ Pas de balise <textarea> trouvée pour {edit_url}.")
-            else:
-                print(f"⚠️ Erreur d'accès à {edit_url} : code {response.status_code}")
+            headers = random_headers()
+            response = session.get(current_url, headers=headers, timeout=10)
+            if response.status_code != 200:
+                continue
+
+            soup = BeautifulSoup(response.text, "html.parser")
+
+            for link in soup.find_all("a", href=True):
+                absolute_url = urljoin(current_url, link["href"])
+                if is_valid_wiki_url(absolute_url) and absolute_url not in visited and absolute_url not in to_visit:
+                    to_visit.append(absolute_url)
+
+            time.sleep(random.uniform(1, 2))
         except Exception as e:
         except Exception as e:
-            print(f"❌ Exception pour {url}: {e}")
-    return url_texts
+            print(f"❌ Error with {current_url}: {e}")
+
+    return list(visited)
+
+def scrape_pages():
+    start_url = "https://wiki.intersel.fr/"
+    urls_path = os.path.join("data", "urls.json")
+
+    try:
+        with open("page_hashes.json", "r", encoding="utf-8") as f:
+            old_hashes = json.load(f)
+    except FileNotFoundError:
+        old_hashes = {}
+
+    try:
+        with open(urls_path, "r", encoding="utf-8") as f:
+            urls = json.load(f)
+        print("✅ URLs chargées depuis urls.json")
+    except FileNotFoundError:
+        print("🚀 Crawling initial du wiki")
+        urls = []
+
+    # Lancer un nouveau crawl en partant de l’URL de départ, tout en conservant les anciennes URLs
+    crawled_urls = crawl_wiki(start_url, urls, max_pages=500)
+    all_urls = sorted(set(urls + crawled_urls))
+
+    print(f"🌐 Total URLs à vérifier : {len(all_urls)}")
+
+    pages, new_hashes = fetch_all_pages_content(all_urls, old_hashes)
+
+    raw_pages = [{"url": url, "text": text} for url, text in pages.items()]
+    with open("raw_pages.json", "w", encoding="utf-8") as f:
+        json.dump(raw_pages, f, ensure_ascii=False, indent=2)
+
+    with open("page_hashes.json", "w", encoding="utf-8") as f:
+        json.dump(new_hashes, f, ensure_ascii=False, indent=2)
+
+    # Enregistrer toutes les URLs dans data/urls.json
+    with open(urls_path, "w", encoding="utf-8") as f:
+        json.dump(all_urls, f, ensure_ascii=False, indent=2)
 
 
+    print("📄 Pages modifiées sauvegardées")
+    print("📄 Contenu brut mis à jour enregistré dans 'raw_pages.json'")
+    print("🔗 URLs enregistrées dans 'data/urls.json'")
+    print("🔐 Hashes des pages enregistrés dans 'page_hashes.json'")
 
 
+    return raw_pages

+ 98 - 175
app.py

@@ -1,32 +1,61 @@
-from flask import Flask, request, jsonify, send_from_directory, Response
-import nltk
-import numpy as np
-import json
-import os
+from flask import Flask, request, jsonify, send_from_directory
+from apscheduler.schedulers.background import BackgroundScheduler
 from sentence_transformers import CrossEncoder, SentenceTransformer
 from sentence_transformers import CrossEncoder, SentenceTransformer
 from langchain_ollama import OllamaLLM
 from langchain_ollama import OllamaLLM
-from agent_ai.auth import login_to_wiki
-from agent_ai.scraping import fetch_all_pages_content
-from agent_ai.chunking import semantic_chunking, model
-from agent_ai.embedding_index import build_faiss_index, search_faiss
 from agent_ai.qa_chain import get_qa_chain
 from agent_ai.qa_chain import get_qa_chain
-from tabulate import tabulate
+from processing import full_update_pipeline, load_index_from_disk
+from agent_ai.auth import login_to_wiki
+import faiss 
+import json
+import numpy as np
 import textwrap
 import textwrap
+from sklearn.metrics.pairwise import cosine_similarity
+from tabulate import tabulate
+import os
+import threading
+import getpass
 
 
 app = Flask(__name__)
 app = Flask(__name__)
 
 
-nltk.download('punkt')
-
-# Global state
 state = {
 state = {
-    "model": model,
-    "cross_encoder": CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2'),
     "index": None,
     "index": None,
     "all_chunks": [],
     "all_chunks": [],
     "chunk_urls": [],
     "chunk_urls": [],
-    "qa_chain": get_qa_chain()
+    "all_embeddings": None,
+    "embedding_model": SentenceTransformer('all-MiniLM-L6-v2'),
+    "cross_encoder": CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2"),
+    "is_updating": False
 }
 }
 
 
+llm = OllamaLLM(model="llama3", temperature=0.3, top_p=0.9, max_tokens=200)
+
+def load_or_update_index():
+    print("🚀 App starting up...")
+    index, texts, urls = load_index_from_disk()
+    if index:
+        state["index"] = index
+        state["all_chunks"] = texts
+        state["chunk_urls"] = urls
+        print("✅ Index loaded from disk.")
+    else:
+        print("❌ No index found. Launching full update in background...")
+        threading.Thread(target=run_full_update, daemon=True).start()
+
+def run_full_update():
+    state["is_updating"] = True
+    try:
+        index, texts, urls = full_update_pipeline()
+        if index:
+            state["index"] = index
+            state["all_chunks"] = texts
+            state["chunk_urls"] = urls
+            state["all_embeddings"] = state["embedding_model"].encode(texts)
+            print("✅ Background update finished.")
+    except Exception as e:
+        print(f"❌ Failed to update index: {e}")
+    finally:
+        state["is_updating"] = False
+
 @app.route('/index.html')
 @app.route('/index.html')
 def index():
 def index():
     return send_from_directory(os.getcwd(), 'index.html')
     return send_from_directory(os.getcwd(), 'index.html')
@@ -45,183 +74,54 @@ def login():
 
 
     return jsonify({"message": "Login successful"})
     return jsonify({"message": "Login successful"})
 
 
-@app.route("/fetch_pages", methods=["POST"])
-def fetch_pages():
-    urls = [
-        "https://wiki.intersel.fr/doku.php?id=intersel:presentation_equipe",
-        "https://wiki.intersel.fr/doku.php?id=intersel:presentation",
-        "https://wiki.intersel.fr/doku.php?id=intersel:guides:entretiens:stagiaires",
-        "https://wiki.intersel.fr/doku.php?id=projets:samsic:anticipia:start",
-        "https://wiki.intersel.fr/doku.php?id=intersel:php",
-        "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:admin_manual:start",
-        "https://wiki.intersel.fr/doku.php?id=intersel:resume_annuaire",
-        "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_phplist:start",
-        "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:integration_metronic:start",
-        "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:dev_manual:start"
-    ]
-    pages = fetch_all_pages_content(urls)
-    raw_pages = [{"url": url, "text": text.strip()} for url, text in pages.items()]
-    
-    with open("raw_pages_pretty.json", "w", encoding="utf-8") as f:
-        json.dump(raw_pages, f, ensure_ascii=False, indent=2)
-    
-    print("📄 Contenu brut des pages enregistré dans 'raw_pages_pretty.json'")
-    return jsonify(raw_pages)
-
-
-state = {
-    "chunk_urls": [],
-    "model": SentenceTransformer("all-MiniLM-L6-v2"), 
-    "cross_encoder": CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")  
-}
-
+@app.route("/qa_chain", methods=["POST"])
+def qa_chain_route():
+    if state["index"] is None or not state["all_chunks"]:
+        if state["is_updating"]:
+            return jsonify({"error": "Le système est encore en train d’indexer les documents. Réessayez dans quelques instants."}), 503
+        else:
+            return jsonify({"error": "L’index est vide. Veuillez attendre la mise à jour ou réinitialiser le système."}), 500
 
 
-@app.route("/chunk_all", methods=["POST"]) 
-def chunk_all():
     data = request.get_json()
     data = request.get_json()
-    text = data.get("text", "")
-    url = data.get("url", "url inconnue")
-
-    if not text.strip():
-        return jsonify({"error": "Texte vide"}), 400
-
-    sentences = nltk.sent_tokenize(text, language='french')
-    chunks = semantic_chunking(sentences, similarity_threshold=0.10, max_words_per_chunk=1000)
-    # chunks = chunk_text_generic(text, max_words=500)
-
-    chunk_data = []
-    response_chunks = []
-
-    for i, chunk in enumerate(chunks, start=1):
-        clean_chunk = chunk.strip()
-        word_count = len(clean_chunk.split())
-
-        chunk_data.append({
-            "chunk_id": i,
-            "text": clean_chunk,
-            "url": url,
-            "word_count": word_count
-        })
-        response_chunks.append(clean_chunk)
-
-        # Sécuriser l'état global
-        if "chunk_urls" not in state:
-            state["chunk_urls"] = []
-        state["chunk_urls"].append(url)
-
-    # Enregistrement JSON
-    with open("chunks_pretty.json", "a", encoding="utf-8") as f:
-        for chunk in chunk_data:
-            f.write(json.dumps(chunk, ensure_ascii=False) + ",\n")
-
-    print(f"✅ {len(chunk_data)} chunks enregistrés pour {url}")
-    return jsonify({"chunks": response_chunks})
-
-@app.route("/build_index", methods=["POST"])
-def build_index():
-    data = request.json
-    texts = data.get("texts")
-    urls = data.get("urls")
-
-    if not texts or not isinstance(texts, list):
-        return jsonify({"error": "A list of texts is required"}), 400
-
-    embeddings = state["model"].encode(texts, convert_to_tensor=False)
-    embeddings = np.array(embeddings).astype('float32')
-
-    index = build_faiss_index(embeddings)
-    state["index"] = index
-    state["all_chunks"] = texts
-
-    # Important: also assign the urls to the global state here
-    if urls and isinstance(urls, list) and len(urls) == len(texts):
-        state["chunk_urls"] = urls
-    
-
-    print("✅ Index FAISS construit avec succès")
-    return jsonify({"message": f"Index built with {len(texts)} vectors"})
-
-@app.route("/search_index", methods=["POST"])
-def search_index():
-    data = request.json
-    question = data.get("question")
-
-    if not question:
-        return jsonify({"error": "Question is required"}), 400
-
-    if state["index"] is None:
-        return jsonify({"error": "Index not built yet"}), 400
-
-    question_embedding = state["model"].encode([question], convert_to_tensor=False)
-    question_embedding = np.array(question_embedding).astype('float32')
-
-    if question_embedding.ndim == 1:
-        question_embedding = np.expand_dims(question_embedding, axis=0)
-
-    distances, indices = search_faiss(state["index"], question_embedding, top_k=20)
+    question = data.get("question", "")
 
 
-    faiss_chunks = [state["all_chunks"][i] for i in indices[0]]
+    # 1. Encode la question
+    query_embedding = state["embedding_model"].encode([question])[0]
 
 
-    # Re-rank with CrossEncoder
-    cross_encoder = state["cross_encoder"]
-    cross_scores = cross_encoder.predict([(question, chunk) for chunk in faiss_chunks])
-    reranked = sorted(zip(faiss_chunks, indices[0], cross_scores), key=lambda x: x[2], reverse=True)
+    # 2. Encode les chunks si non encodés
+    if state["all_embeddings"] is None:
+        state["all_embeddings"] = state["embedding_model"].encode(state["all_chunks"])
 
 
-    top_chunks = [chunk for chunk, _, _ in reranked]
-    indices[0] = [idx for _, idx, _ in reranked]
+    # 3. Similarité cosinus
+    similarities = cosine_similarity([query_embedding], state["all_embeddings"])[0]
+    top_indices = np.argsort(similarities)[::-1][:100]
 
 
-    state["last_indices"] = indices[0]
+    # 4. Rerank avec CrossEncoder
+    rerank_data = [(question, state["all_chunks"][i]) for i in top_indices]
+    rerank_scores = state["cross_encoder"].predict(rerank_data)
+    reranked = sorted(zip([state["all_chunks"][i] for i in top_indices], top_indices, rerank_scores),
+                      key=lambda x: x[2], reverse=True)
 
 
-    # Display ranked results in a table
+    # 5. Affichage en terminal
     table = []
     table = []
-    results = []
-
+    top_chunks = []
     for rank, (chunk, idx, score) in enumerate(reranked, start=1):
     for rank, (chunk, idx, score) in enumerate(reranked, start=1):
         url = state["chunk_urls"][idx] if idx < len(state["chunk_urls"]) else "URL inconnue"
         url = state["chunk_urls"][idx] if idx < len(state["chunk_urls"]) else "URL inconnue"
-
-        # Wrap chunk and URL text to keep it readable in the terminal
         wrapped_chunk = "\n".join(textwrap.wrap(chunk.strip(), width=80))[:500] + "..."
         wrapped_chunk = "\n".join(textwrap.wrap(chunk.strip(), width=80))[:500] + "..."
         wrapped_url = "\n".join(textwrap.wrap(url, width=80))
         wrapped_url = "\n".join(textwrap.wrap(url, width=80))
-
         table.append([rank, round(score, 4), wrapped_chunk, wrapped_url])
         table.append([rank, round(score, 4), wrapped_chunk, wrapped_url])
-        results.append({"text": chunk, "score": float(score), "url": url})
+        top_chunks.append(chunk)
 
 
     print("\n================== RÉSULTATS CLASSÉS PAR PERTINENCE ==================")
     print("\n================== RÉSULTATS CLASSÉS PAR PERTINENCE ==================")
     print(tabulate(table, headers=["Rank", "Score", "Chunk", "URL"], tablefmt="fancy_grid"))
     print(tabulate(table, headers=["Rank", "Score", "Chunk", "URL"], tablefmt="fancy_grid"))
     print("=======================================================================\n")
     print("=======================================================================\n")
 
 
-
-    top_context = " ".join(top_chunks)
-
-    return jsonify({"results": results, "context": top_context})
-
-llm = OllamaLLM(
-    model="llama3",
-    temperature=0.3,
-    top_p=0.9,
-    max_tokens=200
-)
-
-@app.route("/qa_chain", methods=["POST"])
-def qa_chain_route():
-    data = request.get_json()
-    question = data.get("question", "")
-
-    top_chunks = [
-        # Pour chaque indice 'i' dans la liste 'last_indices' (indices des meilleurs chunks)
-        f"[Source: {state['chunk_urls'][i] if i < len(state['chunk_urls']) else 'URL inconnue'}]\n{state['all_chunks'][i]}" # On récupère l'URL correspondante à cet indice si elle existe, sinon on met 'URL inconnue' Puis on ajoute le texte complet du chunk correspondant
-        for i in state.get("last_indices", [])
-        if i < len(state["all_chunks"]) # On s'assure que l'indice est valide pour éviter les erreurs d'index hors limites
-    ]
     top_context = "\n\n".join(top_chunks)
     top_context = "\n\n".join(top_chunks)
-
-    # Limit context length to avoid overload
-    max_context_length = 5000
-    if len(top_context) > max_context_length:
-        top_context = top_context[:max_context_length]
+    if len(top_context) > 20000:
+        top_context = top_context[:20000]
 
 
     prompt = (
     prompt = (
-        "Fournis une réponse factuelle et précise en te basant uniquement sur des informations vérifiables. "
+        "Fournis une réponse factuelle et précise en français en te basant uniquement sur le contexte fourni. "
         "Si tu n'es pas certain de la réponse ou si les données sont ambiguës, indique clairement que l'information n'est pas disponible ou nécessite une vérification. "
         "Si tu n'es pas certain de la réponse ou si les données sont ambiguës, indique clairement que l'information n'est pas disponible ou nécessite une vérification. "
         "Ne fais aucune supposition ou inférence qui pourrait être incorrecte, et précise les sources utilisées lorsque possible.\n\n"
         "Ne fais aucune supposition ou inférence qui pourrait être incorrecte, et précise les sources utilisées lorsque possible.\n\n"
         f"{top_context}\n\n"
         f"{top_context}\n\n"
@@ -234,7 +134,30 @@ def qa_chain_route():
     print(f"CONTEXTE :\n{top_context}\nQUESTION :\n{question}\nRÉPONSE :\n{result}")
     print(f"CONTEXTE :\n{top_context}\nQUESTION :\n{question}\nRÉPONSE :\n{result}")
     print("============================================================\n")
     print("============================================================\n")
 
 
-    return jsonify({"answer": result})
-
+    source_urls = [state["chunk_urls"][idx] for _, idx, _ in reranked[:5]]
+    response = {
+        "answer": result,
+        "sources": list(set(source_urls))
+    }
+    return jsonify(response)
+
+# Scheduler
+scheduler = BackgroundScheduler()
+scheduler.add_job(run_full_update, 'interval', minutes=30)
+print("🔁 Scheduler activé pour mises à jour toutes les 30 min")
+def prompt_for_login():
+    print("🔐 Please log in to the Wiki before starting the app.")
+    while True:
+        username = input("Username: ")
+        password = getpass.getpass("Password: ")
+        if login_to_wiki(username, password):
+            print("Login successful, starting the app...")
+            break
+        else:
+            print("Login failed, please try again.\n")
+  
 if __name__ == "__main__":
 if __name__ == "__main__":
-    app.run(debug=True)
+    prompt_for_login()
+    load_or_update_index()
+    scheduler.start()
+    app.run(debug=True, use_reloader=False)

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 9 - 0
data/All_chunks.json


BIN
data/faiss_index.index


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 0
data/raw_pages.json


+ 502 - 0
data/urls.json

@@ -0,0 +1,502 @@
+[
+  "https://wiki.intersel.fr/",
+  "https://wiki.intersel.fr/doku.php?id=archives:infos_intersel:archive_des_infos",
+  "https://wiki.intersel.fr/doku.php?id=clients:2025:202506",
+  "https://wiki.intersel.fr/doku.php?id=clients:maintenance",
+  "https://wiki.intersel.fr/doku.php?id=clients:start",
+  "https://wiki.intersel.fr/doku.php?id=dossiers_thematiques:https_et_ssl",
+  "https://wiki.intersel.fr/doku.php?id=dossiers_thematiques:poste_pc:reparation_pc",
+  "https://wiki.intersel.fr/doku.php?id=dossiers_thematiques:produit:e-marketing:dossier_luxe",
+  "https://wiki.intersel.fr/doku.php?id=dossiers_thematiques:reseaux_sociaux",
+  "https://wiki.intersel.fr/doku.php?id=globalsupervisors:howto:openmodxmanager",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:accountable",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:acl",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:adresse_ip",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:adu",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:agent",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:ant",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:archiving",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:a:az",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b:back_office",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b:backup",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b:bert",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b:bien",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b:brm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:b:but",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cab",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cd",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:ceb",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:change",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:change_management",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:chapeaux_de_bono",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:charm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:ci",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:ci_cd",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:client_leger",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:client_lourd",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cloud",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cluster",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cmdb",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cmis",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cmmi",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cmp",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cms",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cobit",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:confidential_information",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:consulted",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:conteneur",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:conteneurisation",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:copywriter",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:copywriting",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:corrective_action",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:crm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cross-site_scripting_xss",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:cso",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:c:css",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:db",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:demand_management",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:developpeur_web",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:dfs",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:dkim",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:dmarc",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:dns",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:docker",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:document",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:d:downtime",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e:edi",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e:elevation_des_privileges",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e:emotion",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e:etl",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e:evolution_cms",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:e:extranet",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:f",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:f:fai",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:f:fbl",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:f:fqdn",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:f:front_office",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:f:frontend",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:g",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:g:gti",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:g:gtm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:g:gtr",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:h",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:h:hebergement",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:h:hostname",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:h:hr",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:h:html",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:h:hw",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:ihm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:information_system",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:information_system_security",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:informed",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:injection_sql",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:ip",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:is",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:isp",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:it",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:itil",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:i:itscm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:j",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:j:json",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:k",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:k:kpi",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:k:kubelet",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:k:kubernetes",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:l",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:l:intelligence_artificielle",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:l:lamp",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:l:lcid",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:l:lessor",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:m",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:m:machine_virtuelle",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:m:maintenance",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:m:map",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:m:modx",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:m:moteur_de_conteneurs",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:n",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:n:nat",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:n:nlp",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:n:no_code",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:n:node",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:n:nsd",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:o",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:o:objectif",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:o:okr",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:o:ola",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:o:one_page",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:o:orchestration_de_conteneurs",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:php",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:pl",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:plan",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:plan_de_taggage",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:pm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:pmo",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:pod",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:pra",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:preventive_action",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:procedure",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:process",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:produit",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:proposition_de_valeur",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:p:proxy",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:q",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:q:qms",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:q:quality_plan",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:raci",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:rca",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:rce",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:resources",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:responsible",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:rest",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:r:rfc",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:scd",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:scm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:sdp",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:secret_information",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:sem",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:serveur",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:service",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:service_transition",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:si",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:siem",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:sim",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:sip",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:skms",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:sla",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:slm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:slp",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:smart",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:soa",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:soar",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:spm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:ssl",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:storage",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:s:sw",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:start",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:t",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:t:tbd",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:t:tma",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:t:tmc",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:t:tms",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:t:top_secret_information",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:tags",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u:uat",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u:ueba",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u:uml",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u:uptime",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u:utm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:u:ux",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:v",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:v:vm",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:v:vpn",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:w",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:w:waf",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:w:web_services",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:x",
+  "https://wiki.intersel.fr/doku.php?id=glossaire:x:xss",
+  "https://wiki.intersel.fr/doku.php?id=intersel:aides:aide_commande_mysql:generation_historisation_sql",
+  "https://wiki.intersel.fr/doku.php?id=intersel:aides:aide_integration_fckeditor",
+  "https://wiki.intersel.fr/doku.php?id=intersel:aides:aide_roundcube",
+  "https://wiki.intersel.fr/doku.php?id=intersel:aides:sites_internet_utiles",
+  "https://wiki.intersel.fr/doku.php?id=intersel:aides:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:aides:tutorials:git:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:divers:exemples_courriers:firewall",
+  "https://wiki.intersel.fr/doku.php?id=intersel:divers:exemples_courriers:modifications_dns",
+  "https://wiki.intersel.fr/doku.php?id=intersel:divers:exemples_courriers:voeux",
+  "https://wiki.intersel.fr/doku.php?id=intersel:frontend_des_applications_de_suivi_et_de_gestion_des_projet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:entretiens:stagiaires",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:configurations_serveur_mail",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:cycle_de_developpement",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:finitions_hebergement",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:git:gogs:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:html5:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:internet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:l_espace_projet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:l_identification_documentaire_des_projets",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:la_conception_logicielle",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:la_conception_technique_d_une_newsletter",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:la_correction_d_une_anomalie",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:le_referencement_d_un_site_web",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:le_suivi_des_anomalies_sur_les_projets",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:le_versionnement_des_projets",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:les_finitions_d_un_site_web",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:les_logiciels",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:les_logiciels:phpmyadmin",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:complement_information",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:compterendu-reunion",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:conceptionlogicielle",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:configuration_emails",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:creation_email",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:creation_hebergement",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:demande_documents_startssl",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:document_standard",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:envoi_proposition",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:hebergement",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:homepage_projet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:pagemodele:specificationlogiciel",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:specifications_logicielles",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:guide_de_developpement_intersel:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:guides:liste_des_guides_d_aide",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:accessibilite:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:cdc:cahier_des_charges_v_aa",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:cdc:cdc_pour_la_realisation_d_un_logo",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:cdc:cdc_pour_la_realisation_d_un_site_web_e-commerce",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:cdc:cdc_pour_la_realisation_d_une_application_logicielle",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:cgv_simplifiees",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:cgv_site_web",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:description_infogerance_standard",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:gestion_demandes_client:gestion_de_la_relation_client",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:la_gestion_des_demandes_client",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:accord_confidentialite",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:accord_confidentialite_fournisseur",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:accord_confidentialite_gb",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:bureaucracy_forms:annee_clients",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:bureaucracy_forms:projet_clients",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:bureaucracy_forms:prospects_project",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:google_comment",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:lettre_de_mise_en_demeure",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:lettre_de_relance_avec_ar",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:lettre_de_relance_simple",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:lettre_desistement_cheque",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:modele_footer_mail",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:modele_proposition",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:modele_proposition_english",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:modele_proposition_hebergement",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:phishing_attaques",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:reserves_proposition",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:modeles_des_documents:support",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:ordre_mission",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:procedures:gestion_developpements:modx:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:procedures:gestion_livraisons_projet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:procedures:gestion_sauvegarde_projet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:qualite:exigences_fonctionnelles",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:entete_fichier_fonction",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:javadoc",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_codage_css",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_codage_html",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_codage_javascript",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_codage_modx",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_codage_php",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_nomination_modx",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:regles_de_codage:regles_nommage_fichier",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:reunionsdelancement:identite_graphique",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:le_referentiel_qualite:workflow_livraison_git",
+  "https://wiki.intersel.fr/doku.php?id=intersel:marketing:modx:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:marketing:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:php",
+  "https://wiki.intersel.fr/doku.php?id=intersel:presentation",
+  "https://wiki.intersel.fr/doku.php?id=intersel:presentation_equipe",
+  "https://wiki.intersel.fr/doku.php?id=intersel:projets_internes:psi:sbl:aa:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:projets_internes:sas:conception_ab",
+  "https://wiki.intersel.fr/doku.php?id=intersel:projets_internes:site_intersel",
+  "https://wiki.intersel.fr/doku.php?id=intersel:projets_internes:slc_suivi_livrables_client:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:resume_annuaire",
+  "https://wiki.intersel.fr/doku.php?id=intersel:resume_clients",
+  "https://wiki.intersel.fr/doku.php?id=intersel:resume_viadeo",
+  "https://wiki.intersel.fr/doku.php?id=intersel:reunions_internes",
+  "https://wiki.intersel.fr/doku.php?id=intersel:rh:formulaires",
+  "https://wiki.intersel.fr/doku.php?id=intersel:rh:guide_pour_les_nouveaux_arrivants",
+  "https://wiki.intersel.fr/doku.php?id=intersel:securite:securite_site_internet",
+  "https://wiki.intersel.fr/doku.php?id=intersel:start",
+  "https://wiki.intersel.fr/doku.php?id=intersel:technique",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:animation_lettres:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:automation:preparation:lwstarter:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:automation:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:cold_calling:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:conception:import-de-ressources-csv",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:conception:import-export-de-ressources",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:conception_mx4:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:admin_manual:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:dev_manual:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:manuel-utilisateur-tres-simple:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:user_manual:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:user_manual:video:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:documentations:user_manual_expert:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:imx_demo:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:marketing:accroches:annuaire:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:marketing:accroches:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:nouveau_menu_panel",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:plan-type-contenu-imx",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projects:template_slider_avec_swiper1",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:amelioration_vitesse_generation_lw:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:blapy:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:commerce:specs",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:evol_babel_202501",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:imx_otp:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:integration_metronic:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:panier:specs",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:panier:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:solefy:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:supergen:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projets:webtimepilot:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:projetsimx",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:developpement:livinweb:vente:cahier_des_charges:start",
+  "https://wiki.intersel.fr/doku.php?id=produit:e-marketing",
+  "https://wiki.intersel.fr/doku.php?id=projets:creer_projets",
+  "https://wiki.intersel.fr/doku.php?id=projets:projets_intersel_a_produire",
+  "https://wiki.intersel.fr/doku.php?id=projets:samsic",
+  "https://wiki.intersel.fr/doku.php?id=projets:samsic:anticipia:start",
+  "https://wiki.intersel.fr/doku.php?id=projets:samsic:start",
+  "https://wiki.intersel.fr/doku.php?id=projets:samsic:url_site_de_developpement",
+  "https://wiki.intersel.fr/doku.php?id=projets:samsic:url_site_de_validation",
+  "https://wiki.intersel.fr/doku.php?id=projets:zzz-projets_archives:aascarburants:recuperation_d_informations_sur_site_externe",
+  "https://wiki.intersel.fr/doku.php?id=projets:zzz-projets_archives:openskies:start",
+  "https://wiki.intersel.fr/doku.php?id=prospects:start",
+  "https://wiki.intersel.fr/doku.php?id=securite:virus:virus_et_nettoyage_pc",
+  "https://wiki.intersel.fr/doku.php?id=stages:didactitiel_entreprise",
+  "https://wiki.intersel.fr/doku.php?id=stages:gestion_intersel",
+  "https://wiki.intersel.fr/doku.php?id=stages:hebergement",
+  "https://wiki.intersel.fr/doku.php?id=stages:livinweb:start",
+  "https://wiki.intersel.fr/doku.php?id=stages:mobile:start",
+  "https://wiki.intersel.fr/doku.php?id=stages:modules_applicatifs_internet",
+  "https://wiki.intersel.fr/doku.php?id=stages:modules_prestashop",
+  "https://wiki.intersel.fr/doku.php?id=stages:prise_en_compte_du_module_wrap_par_odt_dans_dokuwiki",
+  "https://wiki.intersel.fr/doku.php?id=stages:qualite",
+  "https://wiki.intersel.fr/doku.php?id=stages:spmp:spmp_intersel",
+  "https://wiki.intersel.fr/doku.php?id=stages:spmp:start",
+  "https://wiki.intersel.fr/doku.php?id=start",
+  "https://wiki.intersel.fr/doku.php?id=supervisors:experts:resources_browser",
+  "https://wiki.intersel.fr/doku.php?id=technique:codes_source_utiles",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:codes_source_utiles:shell:scripts_migration_versions",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_limesurvey:manuel_utilisateur_limesurvey",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_limesurvey:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:affectation_header_content_type",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:apimodx",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:arborescence",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:auditor",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:displaymessagealert",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:ditto",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:ditto_probleme_cache",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:docmanager",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:documentpublisher",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:editarea",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:evolution_cms",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:fichiers_style_css",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:fileupload",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:formations:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:generation_de_fichiers_incorrecte",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:gestion_de_documents",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:insertion_editeur",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:integration_modx_dokuwiki",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:linkedin",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:loginlogout",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:bug_ie",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:droits_acces",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:preparemovieplayer.snippet",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:snippet:wayfinder",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:snippets_a_installer",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:templates_de_base",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:upgrade:modx_1_0_5_vers_1_0_12",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_evolution:upgrade:modx_1_x_vers_1_4.x",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_probleme_cache",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_revolution",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_revolution:architecture_modx_revo",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:modx_revolution:intersel:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:molecule",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:moteur_de_recherche",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:page_navigation",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:phx",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:picture_editor",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:probleme_appel_snippet",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:probleme_editeur_riche",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:probleme_eventlog",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:probleme_filtrage_modx",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:probleme_htaccess",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:probleme_utf8_ansi",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:quickedit",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:sitemap",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:snippet_probleme_cache",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:template_reference:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:tinymce",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_modx:weblogin",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_phplist:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_prestashop:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:developpement:developpement_wordpress:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:aides_hebergement",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:archinet:archinet-mutu1",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:archinet:archinet-mutu2",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:archinet:archinet-mutu3",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:archinet:archinet-mutu4",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:archinet:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:architecture_intersel_2014:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:backups:scripts:intersel_dump",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:dedies:10.10.30.2",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:dedies:10.10.30.4",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:dedies:91.121.147.29:intersel:serveur_dedie_linux:proxmox",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ikoula:mutu-iko-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ikoula:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:jobsc-ovh-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:mutu-ovh-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:mutu-ovh-2.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:nas-ovh-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:oc-ovh-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:rl-ovh-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:ovh:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:scaleway:mutu-scw-1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:scaleway:mutu-scw-2.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:scaleway:mutu-scw-3.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:scaleway:mutu-scw-o1.intersel.net",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:scaleway:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:hebergement:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:aide_commandes_linux",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:apt-get_ou_aptitude",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:architecture_ha_lb",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:fichiers_linux",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:fichiers_linux:htaccess",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:nagios",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:serveur_dedie_linux",
+  "https://wiki.intersel.fr/doku.php?id=technique:linux:start:aides_hebergement:copie_vm_mutu:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:matomo:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:mysql:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:postgresql:start",
+  "https://wiki.intersel.fr/doku.php?id=technique:start",
+  "https://wiki.intersel.fr/lib/exe/detail.php?id=technique%3Alinux%3Aaide_commandes_linux&media=technique:linux:scaleway-puttygen-01.webp",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:breadcrumb-navxt.3.3.0.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:codestyling-localization.1.93.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:evermore.2.3.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:fiche_transfert_sql_molecules.xls",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:bc_nom_de_domaine_3_emails.doc",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:client-projet-affaire-bon-livraison-01-aa.dot",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:doc-01-aa.doc",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:modele_lettre_ab.odt",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:note_de_frais.xls",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:odt:2018-01-modele_document_pour_odt-propal_wiki.odt",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:odt:modele_document_pour_odt-propal_wiki_v2.odt",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:odt:modele_document_pour_odt-wiki.odt",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:procedures:backup_system.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:regles_de_codage:upieventsdispatcher.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:le_referentiel_qualite:webcard_-_bon_de_commande.doc",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:modx_classes.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:modxapi.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:openskies_modx.class.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:phplist-form-integration.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:search-replace-db-master.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:stream-video-player.1.0.5.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:wp-postratings.1.50.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:wp-postviews.1.50.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:www.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=intersel:zdmultilang.1.2.4.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=technique:developpement:codes_source_utiles:mediaplayer-5.3-licensed.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=technique:developpement:developpement_modx:20110512-install_modx-dokuwiki.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=technique:developpement:developpement_modx:20110803-install_modx-dokuwiki.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=technique:developpement:developpement_modx:main.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=technique:developpement:developpement_modx:modx_doku.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?media=technique:developpement:developpement_modx:preparemovieplayer.snippet.zip",
+  "https://wiki.intersel.fr/lib/exe/fetch.php?tok=6bdf80&media=http%3A%2F%2Fwww.arnebrachhold.de%2Fprojects%2Fwordpress-plugins%2Fgoogle-xml-sitemaps-generator%2F"
+]

+ 71 - 137
index.html

@@ -1,150 +1,84 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="fr">
 <html lang="fr">
 <head>
 <head>
-<meta charset="UTF-8" />
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<title>Agent AI </title>
-<style>
-  body { font-family: Arial, sans-serif; max-width: 600px; margin: auto; padding: 20px; }
-  textarea, input, button { width: 100%; margin-bottom: 10px; padding: 8px; box-sizing: border-box; }
-  button { cursor: pointer; }
-  .response { background: #f0f0f0; padding: 10px; white-space: pre-wrap; border: 1px solid #ccc; min-height: 150px; }
-  label { font-weight: bold; }
-</style>
-</head>
-<body>
-
-<h1>Agent AI </h1>
-
-<label for="username">Nom d'utilisateur :</label>
-<input type="text" id="username" placeholder="Entrez votre nom d'utilisateur" />
-
-<label for="password">Mot de passe :</label>
-<input type="password" id="password" placeholder="Entrez votre mot de passe" />
-
-<label for="userQuestion">Ta question :</label>
-<textarea id="userQuestion" rows="4" placeholder="Écris ta question ici..."></textarea>
-
-<button onclick="runFullChain()">Envoyer</button>
-
-<h2>Réponse :</h2>
-<div id="finalResponse" class="response" style="white-space: normal;"></div>
-
-<script>
-async function runFullChain() {
-  const username = document.getElementById('username').value.trim();
-  const password = document.getElementById('password').value.trim();
-  const question = document.getElementById('userQuestion').value.trim();
-
-  if (!username || !password) {
-    alert('Merci d\'entrer votre nom d\'utilisateur et mot de passe.');
-    return;
-  }
-  if (!question) {
-    alert('Merci d\'écrire une question.');
-    return;
-  }
-
-  const finalResponseElem = document.getElementById('finalResponse');
-  finalResponseElem.textContent = 'Chargement...';
-
-  try {
-    // 1. Login
-    const resLogin = await fetch('/login', {
-      method: 'POST',
-      headers: {'Content-Type': 'application/json'},
-      body: JSON.stringify({username, password})
-    });
-    if (!resLogin.ok) {
-      const err = await resLogin.json();
-      finalResponseElem.textContent = 'Erreur login: ' + (err.error || resLogin.statusText);
-      return;
+  <meta charset="UTF-8" />
+  <title>QA Agent Wiki</title>
+  <style>
+    body {
+      font-family: Arial, sans-serif;
+      margin: 40px;
+      max-width: 800px;
     }
     }
-
-    // 2. Fetch pages
-    const resPages = await fetch('/fetch_pages', { method: 'POST' });
-    if (!resPages.ok) {
-      finalResponseElem.textContent = 'Erreur récupération pages.';
-      return;
+    h1 {
+      color: #333;
     }
     }
-    const pages = await resPages.json();
-
-    // 3. Chunk
-    let chunks = [];
-    for (const page of pages) {
-      const url = page.url || "url inconnue";
-      const fullText = page.text || "";
-
-      const resChunk = await fetch('/chunk_all', {
-        method: 'POST',
-        headers: { 'Content-Type': 'application/json' },
-        body: JSON.stringify({ text: fullText, url: url })
-      });
-
-      if (!resChunk.ok) {
-        console.error(`Erreur découpage texte pour ${url}`);
-        continue;
-      }
-
-      const chunkData = await resChunk.json();
-      chunks.push(...chunkData.chunks);
+    input, textarea, button {
+      width: 100%;
+      padding: 10px;
+      margin-top: 10px;
+      margin-bottom: 20px;
+      border: 1px solid #ccc;
+      border-radius: 5px;
     }
     }
-
-    // Extraire les URLs des pages pour la requête build_index
-    const urls = pages.map(p => p.url || "url inconnue");
-
-    // 4. Build index
-    const resIndex = await fetch('/build_index', {
-      method: 'POST',
-      headers: {'Content-Type': 'application/json'},
-      body: JSON.stringify({ texts: chunks, urls: urls })  // <-- urls défini ici
-    });
-    if (!resIndex.ok) {
-      finalResponseElem.textContent = 'Erreur création index.';
-      return;
+    button {
+      background-color: #007bff;
+      color: white;
+      font-weight: bold;
+      cursor: pointer;
     }
     }
-
-    // 5. Search index for relevant context
-    const resSearch = await fetch('/search_index', {
-      method: 'POST',
-      headers: {'Content-Type': 'application/json'},
-      body: JSON.stringify({ question: question })
-    });
-    if (!resSearch.ok) {
-      finalResponseElem.textContent = 'Erreur recherche dans index.';
-      return;
+    button:hover {
+      background-color: #0056b3;
     }
     }
-    const searchResults = await resSearch.json();
-
-    // Construire contexte à partir des meilleurs chunks
-    let context = '';
-    for (const r of searchResults.results) {
-      context += `Extrait provenant de : ${r.url}\n${r.text}\n\n`;
+    .response {
+      background: #f1f1f1;
+      padding: 15px;
+      border-radius: 5px;
+      white-space: pre-wrap;
     }
     }
+  </style>
+</head>
+<body>
+  <h1>🔍 Posez une question à l’IA</h1>
+
+  <!-- Affiché directement (plus de display: none) -->
+  <div id="qa-section">
+    <h3>Votre question</h3>
+    <textarea id="question" rows="4" placeholder="Posez votre question ici..."></textarea>
+    <button onclick="askQuestion()">Envoyer</button>
+    <h3>Réponse de l'IA</h3>
+    <div class="response" id="answer"></div>
+  </div>
+
+  <script>
+    async function askQuestion() {
+      const question = document.getElementById("question").value.trim();
+      const answerBox = document.getElementById("answer");
+
+      if (!question) {
+        answerBox.innerText = "❗ Veuillez entrer une question.";
+        return;
+      }
 
 
-    // 6. QA chain
-    const resQA = await fetch('/qa_chain', {
-      method: 'POST',
-      headers: {'Content-Type': 'application/json'},
-      body: JSON.stringify({ context: context, question: question })
-    });
-    if (!resQA.ok) {
-      finalResponseElem.textContent = 'Erreur lors de la réponse.';
-      return;
+      answerBox.innerText = "⏳ Recherche de la réponse...";
+      try {
+        const res = await fetch("/qa_chain", {
+          method: "POST",
+          headers: {
+            "Content-Type": "application/json"
+          },
+          body: JSON.stringify({ question })
+        });
+
+        if (!res.ok) {
+          throw new Error("Erreur du serveur");
+        }
+
+        const data = await res.json();
+        answerBox.innerText = data.answer || "❌ Aucune réponse trouvée.";
+      } catch (error) {
+        answerBox.innerText = "❌ Erreur : " + error.message;
+      }
     }
     }
-    const qaResult = await resQA.json();
-
-    const rawAnswer = qaResult.answer || 'Aucune réponse obtenue.';
-    const htmlAnswer = marked.parse(rawAnswer);
-    finalResponseElem.innerHTML = htmlAnswer;
-  } catch (e) {
-    finalResponseElem.textContent = 'Erreur interne: ' + e.message;
-  }
-}
-
-</script>
-<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
-
-
+  </script>
 </body>
 </body>
 </html>
 </html>

+ 1 - 0
page_hashes.json

@@ -0,0 +1 @@
+{}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно