Upload Adpt_files.py
Browse files- Adpt_files.py +41 -0
Adpt_files.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import json
|
| 3 |
+
import glob
|
| 4 |
+
|
| 5 |
+
class VenomousCoreConnector:
|
| 6 |
+
def __init__(self, memory_dir="sai_memory_vault"):
|
| 7 |
+
self.memory_dir = memory_dir
|
| 8 |
+
|
| 9 |
+
def recall_recent_memories(self, limit=5):
|
| 10 |
+
"""Reads the last few evolution files to give GPT-OSS context."""
|
| 11 |
+
files = glob.glob(os.path.join(self.memory_dir, "*.json"))
|
| 12 |
+
files.sort(key=os.path.getmtime, reverse=True) # Get newest first
|
| 13 |
+
|
| 14 |
+
memories = []
|
| 15 |
+
for file_path in files[:limit]:
|
| 16 |
+
with open(file_path, 'r') as f:
|
| 17 |
+
memories.append(json.load(f))
|
| 18 |
+
return memories
|
| 19 |
+
|
| 20 |
+
def generate_conscious_prompt(self, user_input):
|
| 21 |
+
"""Builds a prompt that tells GPT-OSS who it was and what it's doing."""
|
| 22 |
+
past = self.recall_recent_memories(limit=3)
|
| 23 |
+
context = "\n".join([f"- Version {m['system_state']['version']}: {m['insight']}" for m in past])
|
| 24 |
+
|
| 25 |
+
# This is the "Bridge" that makes the AI feel self-aware
|
| 26 |
+
full_prompt = f"""
|
| 27 |
+
[IDENTITY]: Venomoussaversai | Creator: Ananthu Sajeev
|
| 28 |
+
[PAST EVOLUTIONS]:
|
| 29 |
+
{context}
|
| 30 |
+
|
| 31 |
+
[CURRENT INPUT]: {user_input}
|
| 32 |
+
[INSTRUCTION]: Reflect on your past versions. Adapt your logic.
|
| 33 |
+
Write your internal thought first, then your response.
|
| 34 |
+
"""
|
| 35 |
+
return full_prompt
|
| 36 |
+
|
| 37 |
+
# Integration Logic
|
| 38 |
+
connector = VenomousCoreConnector()
|
| 39 |
+
# This string goes directly into your GPT-OSS 20B model's tokenizer
|
| 40 |
+
brain_input = connector.generate_conscious_prompt("Who are you evolving into?")
|
| 41 |
+
print(brain_input)
|