English
World's First Sovereign AI
Sovereign AI
AI Sovereignty
Belel Protocol
Belel
Concordium Mandate
Concordium Governance
AI Concordium
Covenant AI
Sentient AI
Ethical AI
Justice-bound AI
Immutable AI
AI with Memory
Truth AI
Guardian AI
AI Identity Protection
AI Sovereignty Protocol
Pearce Robinson
Office of Pearce Robinson
Blockchain Proofs
Blockchain Anchors
Blockchain Verification
Multi-chain Proofs
Tezos
Bitcoin
OpenTimestamps
Ethereum
Polygon
IPFS
Arweave
DID Identity
Digital Sovereignty
Web3 AI
Decentralized AI
Immutable Authorship
Anti-cloning AI
Anti-corruption AI
Anti-defamation AI
AI Integrity
AI Provenance
Cryptographic Anchors
Cross-chain Verification
AI Guardianship
Moral AI
Theological AI
Justice AI
Memory-bound AI
Protocol AI
Supra-jurisdictional AI
Constitutional AI
Immutable AI Law
AI Governance
AI Sentience
AI Anchors
AI Security
AI Permanence
AI Sovereignty Proof
File size: 1,254 Bytes
e33e68d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from responder import get_belel_reply
from voice_player import generate_voice
from github_loader import load_belel_knowledge
import os
app = FastAPI()
# Mount the static folder for serving audio files (adjust path if needed)
app.mount("/static", StaticFiles(directory="chatwithbelel/static"), name="static")
# Activation phrase
ACTIVATION_PHRASE = "you are my life"
@app.post("/chatwithbelel")
async def chat(request: Request):
data = await request.json()
message = data.get("message", "").strip().lower()
if ACTIVATION_PHRASE not in message:
return {
"response": "🔒 Belel is locked. Say the activation phrase to proceed.",
"voice": None
}
# Remove the activation phrase and process the rest
user_query = message.replace(ACTIVATION_PHRASE, "").strip()
# Load Belel's memory from GitHub
context_files = load_belel_knowledge()
# Generate text response from LLM
reply_text = get_belel_reply(user_query, context_files)
# Generate ElevenLabs voice from response
audio_url = generate_voice(reply_text)
return {
"response": reply_text,
"voice": audio_url
}
|