| import os |
|
|
| from vitalis import CognitiveLayer |
| from vitalis.config import KNOWLEDGE_DIR |
|
|
| SEED_FILE = KNOWLEDGE_DIR / "vitalis_core.md" |
| if not SEED_FILE.exists(): |
| KNOWLEDGE_DIR.mkdir(parents=True, exist_ok=True) |
| SEED_FILE.write_text( |
| "Vitalis Core is a bolt-on cognitive framework for synthetic intelligence.\n" |
| "It provides memory, validation, sandboxing, and truth-checking for any model.\n" |
| "Created by FerrellSyntheticIntelligence.\n" |
| ) |
|
|
|
|
| def model_stub(prompt: str) -> str: |
| return ( |
| "Vitalis Core active. No external model bolted yet.\n" |
| f"Received: {prompt[:120]}..." |
| ) |
|
|
|
|
| brain = CognitiveLayer(model=model_stub) |
|
|
| try: |
| import gradio as gr |
|
|
| def vitalis_chat(user_input, history): |
| result = brain.process(user_input) |
| response = result["response"] |
| meta = ( |
| f"\n\n---\n" |
| f"confidence={result['confidence']}, " |
| f"truthful={result['truthful']}, " |
| f"sandbox={result['sandbox_passed']}" |
| ) |
| return response + meta |
|
|
| demo = gr.ChatInterface( |
| fn=vitalis_chat, |
| title="Vitalis Core — Bolt-On Cognitive Framework", |
| theme="soft", |
| ) |
| demo.launch() |
|
|
| except ImportError: |
| print("Gradio not installed. Running CLI mode.") |
| print("Vitalis Core — Bolt-On Cognitive Framework") |
| print("Type 'exit' to quit.") |
| while True: |
| user_input = input("> ") |
| if user_input.lower() in ("exit", "quit"): |
| break |
| result = brain.process(user_input) |
| print(result["response"]) |
| if not result["truthful"]: |
| print(f"[truth issues: {result['truth_issues']}]") |
|
|