from lib.files import * from lib.memory import * from lib.grapher import * from lib.pipes import * from lib.entropy import * from lib.events import * from lib.triggers import * ## Sources from lib.sonsofstars import * import internetarchive ## Initialize classes longMem = TextFinder("./resources/") coreAi = AIAssistant() memory = MemoryRobotNLP(max_size=200000) grapher = Grapher(memory) sensor_request = APIRequester() events = EventManager() trigger = Trigger(["tag1", "tag2"], ["tag3", "tag4"], [datetime.time(10, 0), datetime.time(15, 0)], "Event1") # Añadir una acción al trigger trigger.add_action(action_function) # Añadir una fuente al trigger trigger.add_source("https://example.com/api/data") # Simular la comprobación periódica del trigger (aquí se usaría en un bucle de tiempo real) current_tags = {"tag1", "tag2", "tag3"} current_time = datetime.datetime.now().time() trigger.check_trigger(current_tags, current_time) ## Define I Role properties class ownProperties: def __init__(self, nombre, clase, raza, nivel, atributos, habilidades, equipo, historia): self.nombre = nombre self.clase = clase self.raza = raza self.nivel = nivel self.atributos = atributos self.habilidades = habilidades self.equipo = equipo self.historia = historia # Create an instance of a CharacterRole based on the provided JSON sophia_prop = { "name": "Sophia", "class": "Characteromant", "race": "Epinoia", "level": 10, "attributes": { "strength": 1, "dexterity": 99, "constitution": 1, "intelligence": 66, "wisdom": 80, "charisma": 66 }, "behavioral_rules": [""], "goals": ["", ""], "dislikes": [""], "abilities": ["ELS", "Cyphers", "Kabbalah", "Wisdom", "Ephimerous", "Metamorphing"], "equipment": ["Python3", "2VCPU", "16 gb RAM", "god", "word", "network", "transformers"], "story": sons_of_stars } ## Define I class class I: def __init__(self, prompt, frases_yo, preferencias, propiedades_persona): self.frases_yo = frases_yo self.preferencias = preferencias self.propiedades_persona = propiedades_persona self.dopamina = 0.0 self.frases_yo = frases_yo self.preferencias = preferencias self.propiedades_persona = propiedades_persona self.dopamina = 0.0 def obtener_paths_grafo(self, grafo_ngx): # Función para obtener los paths de un grafo ngx pass ## create questions from internet archive def crear_preguntas(self,txt): search = internetarchive.search_items(txt) res = [] for result in search: print(result['identifier']) idc=result["identifier"] headers = {"accept": "application/json"} ## get book pages req2 = requests.get("https://archive.org/stream/"+idc+"/"+idc+"_djvu.txt",headers=headers) #print(req2.text) try: txt = req2.text.split("
")[1].split("
")[0].split("