Spaces:
Runtime error
Runtime error
Update AICoreAGIX_with_TB.py
Browse files- AICoreAGIX_with_TB.py +13 -11
AICoreAGIX_with_TB.py
CHANGED
|
@@ -9,22 +9,23 @@ from typing import List, Dict, Any
|
|
| 9 |
from cryptography.fernet import Fernet
|
| 10 |
from jwt import encode, decode, ExpiredSignatureError
|
| 11 |
from datetime import datetime, timedelta
|
| 12 |
-
# blockchain_module
|
| 13 |
import speech_recognition as sr
|
| 14 |
import pyttsx3
|
| 15 |
import os
|
| 16 |
|
| 17 |
-
|
| 18 |
-
from components.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
from CodriaoCore.federated_learning import FederatedAI
|
| 20 |
-
from utils.database import Database
|
| 21 |
from logger import logger
|
| 22 |
-
from secure_memory_loader import SecureMemorySession
|
| 23 |
from codriao_tb_module import CodriaoHealthModule
|
| 24 |
|
| 25 |
-
# Ensure these modules exist or update the paths accordingly.
|
| 26 |
-
from components.ethical_filter import EthicalFilter
|
| 27 |
-
from self_reflective_ai import SelfReflectiveAI
|
| 28 |
|
| 29 |
class AICoreAGIX:
|
| 30 |
def __init__(self, config_path: str = "config.json"):
|
|
@@ -38,7 +39,7 @@ class AICoreAGIX:
|
|
| 38 |
self.database = Database()
|
| 39 |
self.multi_agent_system = MultiAgentSystem()
|
| 40 |
self.self_reflective_ai = SelfReflectiveAI()
|
| 41 |
-
self.neural_symbolic_engine = NeuroSymbolicEngine()
|
| 42 |
self.federated_ai = FederatedAI()
|
| 43 |
|
| 44 |
# Security + Memory
|
|
@@ -81,14 +82,15 @@ class AICoreAGIX:
|
|
| 81 |
model_response = await self._generate_local_model_response(query)
|
| 82 |
agent_response = self.multi_agent_system.delegate_task(query)
|
| 83 |
self_reflection = self.self_reflective_ai.evaluate_response(query, model_response)
|
| 84 |
-
neural_reasoning = self.neural_symbolic_engine.integrate_reasoning(query)
|
| 85 |
|
| 86 |
final_response = (
|
| 87 |
f"{model_response}\n\n"
|
| 88 |
f"{agent_response}\n\n"
|
| 89 |
-
f"{
|
| 90 |
f"Logic: {neural_reasoning}"
|
| 91 |
)
|
|
|
|
| 92 |
self.database.log_interaction(user_id, query, final_response)
|
| 93 |
# blockchain_module.store_interaction(user_id, query, final_response)
|
| 94 |
self._speak_response(final_response)
|
|
|
|
| 9 |
from cryptography.fernet import Fernet
|
| 10 |
from jwt import encode, decode, ExpiredSignatureError
|
| 11 |
from datetime import datetime, timedelta
|
|
|
|
| 12 |
import speech_recognition as sr
|
| 13 |
import pyttsx3
|
| 14 |
import os
|
| 15 |
|
| 16 |
+
# === Corrected Local Imports ===
|
| 17 |
+
from components.multi_model_analyzer import MultiAgentSystem
|
| 18 |
+
from components.neuro_symbolic_engine import NeuroSymbolicEngine
|
| 19 |
+
from components.secure_memory_loader import SecureMemorySession
|
| 20 |
+
from components.ethical_filter import EthicalFilter
|
| 21 |
+
from components.self_reflective_ai import SelfReflectiveAI
|
| 22 |
+
|
| 23 |
+
# === External Modules (you must ensure these exist) ===
|
| 24 |
from CodriaoCore.federated_learning import FederatedAI
|
| 25 |
+
from utils.database import Database
|
| 26 |
from logger import logger
|
|
|
|
| 27 |
from codriao_tb_module import CodriaoHealthModule
|
| 28 |
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
class AICoreAGIX:
|
| 31 |
def __init__(self, config_path: str = "config.json"):
|
|
|
|
| 39 |
self.database = Database()
|
| 40 |
self.multi_agent_system = MultiAgentSystem()
|
| 41 |
self.self_reflective_ai = SelfReflectiveAI()
|
| 42 |
+
self.neural_symbolic_engine = NeuroSymbolicEngine()
|
| 43 |
self.federated_ai = FederatedAI()
|
| 44 |
|
| 45 |
# Security + Memory
|
|
|
|
| 82 |
model_response = await self._generate_local_model_response(query)
|
| 83 |
agent_response = self.multi_agent_system.delegate_task(query)
|
| 84 |
self_reflection = self.self_reflective_ai.evaluate_response(query, model_response)
|
| 85 |
+
neural_reasoning = self.neural_symbolic_engine.integrate_reasoning(query)
|
| 86 |
|
| 87 |
final_response = (
|
| 88 |
f"{model_response}\n\n"
|
| 89 |
f"{agent_response}\n\n"
|
| 90 |
+
f"{self_reflection}\n\n"
|
| 91 |
f"Logic: {neural_reasoning}"
|
| 92 |
)
|
| 93 |
+
|
| 94 |
self.database.log_interaction(user_id, query, final_response)
|
| 95 |
# blockchain_module.store_interaction(user_id, query, final_response)
|
| 96 |
self._speak_response(final_response)
|