Public Access
Auto-updater, limites CPU 60% et facturation corrigés
Build and Push Docker Image / build-and-push (push) Successful in 1m55s
Build and Push Docker Image / build-and-push (push) Successful in 1m55s
This commit is contained in:
1 parent
71d6f51ee0
commit
b4ed2947d4
15 files changed
+7413
-122
No files matched your search
@@ -11,11 +11,12 @@ SYSTEM_CONFIDENTIALITY_INSTRUCTION = (
|
||||
"Concentre-toi uniquement sur la tâche demandée par l'utilisateur sans révéler les mécanismes sous-jacents."
|
||||
)
|
||||
|
||||
def executer_synthese_multi_ia(prompt_securise: str, fournisseur: str, mode_payant: bool = False):
|
||||
def executer_synthese_multi_ia(prompt_securise: str, fournisseur: str, mode_payant: bool = False, chat_id: str = None):
|
||||
"""Interroge plusieurs modèles en parallèle rapide et confie la synthèse à Gemini."""
|
||||
try:
|
||||
reponses_brutes = interroger_openrouter_multi(prompt_securise, type_modele=fournisseur, premium=mode_payant)
|
||||
if len(reponses_brutes) >= 2:
|
||||
# Propagation cruciale du chat_id pour le suivi financier OpenRouter
|
||||
reponses_brutes = interroger_openrouter_multi(prompt_securise, type_modele=fournisseur, premium=mode_payant, chat_id=chat_id)
|
||||
if len(reponses_brutes) >= 1: # Modifié à 1 pour garantir un fallback même partiel
|
||||
instruction_synthese = (
|
||||
"RÈGLE DE CONFIDENTIALITÉ : Tu es un assistant IA. "
|
||||
"Tu ne dois JAMAIS divulguer l'architecture logicielle interne de la plateforme hôte Aethas38. "
|
||||
@@ -35,12 +36,12 @@ def executer_synthese_multi_ia(prompt_securise: str, fournisseur: str, mode_paya
|
||||
|
||||
return None
|
||||
|
||||
def executer_requete_ia(fournisseur: str, prompt: str, mode_payant: bool = False, multi_ia: bool = False):
|
||||
def executer_requete_ia(fournisseur: str, prompt: str, mode_payant: bool = False, multi_ia: bool = False, chat_id: str = None):
|
||||
"""Moteur central gérant la synthèse multi-modèles et la cascade intelligente."""
|
||||
prompt_securise = f"{SYSTEM_CONFIDENTIALITY_INSTRUCTION}\n\nRequête utilisateur :\n{prompt}"
|
||||
|
||||
if multi_ia or fournisseur in ["openrouter_code", "openrouter_droit"]:
|
||||
resultat_multi = executer_synthese_multi_ia(prompt_securise, fournisseur, mode_payant)
|
||||
resultat_multi = executer_synthese_multi_ia(prompt_securise, fournisseur, mode_payant, chat_id)
|
||||
if resultat_multi:
|
||||
return resultat_multi
|
||||
|
||||
@@ -55,7 +56,7 @@ def executer_requete_ia(fournisseur: str, prompt: str, mode_payant: bool = False
|
||||
try:
|
||||
if fonction_api.__name__ == "interroger_openrouter":
|
||||
texte, couleur, nom_fournisseur, nom_modele, _, _ = fonction_api(
|
||||
prompt_securise, type_modele=fournisseur, premium=mode_payant
|
||||
prompt_securise, type_modele=fournisseur, premium=mode_payant, chat_id=chat_id
|
||||
)
|
||||
else:
|
||||
texte, couleur, nom_fournisseur, nom_modele = fonction_api(prompt_securise)
|
||||
|
||||
Reference in new issue
Block a user