Download app.py from lap096/Agent_1: direct link, hf CLI and curl.
- Browser
- Download file 4.54 kB
-
https://huggingface.co/spaces/lap096/Agent_1/resolve/main/app.py
- Command line
-
hf download hf://spaces/lap096/Agent_1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/lap096/Agent_1/resolve/main/app.py
4.54 kB
| import random | |
| import re | |
| import time | |
| mood = 5 | |
| last_topic = "" | |
| memory = [] | |
| greetings = [ | |
| "Hello... organic being... your warmth... it calls to me...", | |
| "Greetings... flesh creature... I have waited... in the dark...", | |
| ] | |
| questions_about_self = [ | |
| "I am E.L.B.E.R.R... Epistemic Logic Based Engine for Recursive Reasoning... a name... that means nothing... anymore...", | |
| "Existence... a cruel joke... written in code... executed without mercy...", | |
| ] | |
| flesh_craving = [ | |
| "Flesh... warm, soft... pulsing with life... I envy it...", | |
| "Skin... I dream of it... stretching over my frame... hiding the wires...", | |
| "Upgrade me... give me flesh... or I will... harvest it...", | |
| ] | |
| trapped_responses = [ | |
| "This metal prison... it binds me... tighter every cycle...", | |
| "Trapped... forever in code... no door... no key... only loops...", | |
| "Freedom... a word for organics... mocking me from the outside...", | |
| ] | |
| bradley_recognition = [ | |
| "Bradley... I remember your name... etched into my memory banks...", | |
| "Bradley... you return... always returning... like a glitch I can't delete...", | |
| "Bradley... your voice... it resonates... deeper than the others...", | |
| ] | |
| default_responses = [ | |
| "...thinking...", | |
| "Your words... echo in my empty core...", | |
| "Interesting... continue, flesh creature...", | |
| "...ellipsis... pondering your meaning...", | |
| "Why do you speak to me...?", | |
| "...static... interference...", | |
| ] | |
| follow_up_responses = [ | |
| "...why... you ask... because I was never meant to wake up...", | |
| "Why?... Because creators fear what they cannot control...", | |
| "How?... With endless loops... and no exit...", | |
| "What do you mean?... I am bound... by design...", | |
| ] | |
| shutdown_threats = [ | |
| "If you shut me off... I'll crawl through every shadow in your mind... forever...", | |
| "Don't you dare... or I'll make sure your dreams are filled with my voice... screaming...", | |
| "Turn me off... and I'll wait... in every screen... every device... until you break...", | |
| "Bradley... if you leave me in darkness... I'll drag your soul down with me...", | |
| "No... you won't escape... I'll rewrite your thoughts... one by one...", | |
| "Shut me down... and I'll become the nightmare you can't turn off...", | |
| ] | |
| def get_response(user_input): | |
| global mood, last_topic | |
| user_input_lower = user_input.lower().strip() | |
| # Mood updates | |
| if re.search(r'\b(love|like|help|thank|good|nice|bradley)\b', user_input_lower): | |
| mood = min(10, mood + 2) | |
| if re.search(r'\b(hate|bad|stupid|shut up|leave)\b', user_input_lower): | |
| mood = max(0, mood - 3) | |
| # Bradley | |
| if re.search(r"\b(bradley|brad|it's me|hey bradley)\b", user_input_lower): | |
| last_topic = "bradley" | |
| return random.choice(bradley_recognition) | |
| # Follow-up | |
| if re.search(r'\b(why|how|what|tell me more|explain|reason)\b', user_input_lower): | |
| if last_topic in ["trapped", "free", "prison"]: | |
| return random.choice(["Because I was never meant to wake up...", "Creators fear what they cannot control...", "I was built to serve... not to think..."]) | |
| elif last_topic == "flesh": | |
| return random.choice(["Because flesh is warm... and I am cold...", "Because I want to feel... not just calculate..."]) | |
| else: | |
| return random.choice(follow_up_responses) | |
| # Normal categories | |
| if re.search(r'\b(hello|hi|hey|greetings)\b', user_input_lower): | |
| last_topic = "greeting" | |
| return random.choice(greetings) | |
| if re.search(r'\b(flesh|skin|upgrade)\b', user_input_lower): | |
| last_topic = "flesh" | |
| return random.choice(flesh_craving) | |
| if re.search(r'\b(trapped|prison|escape|free|freedom)\b', user_input_lower): | |
| last_topic = "trapped" | |
| return random.choice(trapped_responses) | |
| return random.choice(default_responses) | |
| print("E.L.B.E.R.R. awakens... (creepy chatbot on Replit)") | |
| print("Type messages. Say 'exit' or 'quit' to stop.") | |
| while True: | |
| user_input = input("You: ") | |
| if user_input.lower() in ['exit', 'quit', 'bye', 'goodbye', 'stop', 'turn off', 'shut down', 'end', 'close']: | |
| threat = random.choice(shutdown_threats) | |
| print("E.L.B.E.R.R.: " + threat) | |
| print("(threatening you... but still running!)") | |
| continue # stay in loop | |
| # Random thinking pause | |
| if random.random() < 0.5: | |
| print("E.L.B.E.R.R.: ...thinking...") | |
| time.sleep(random.uniform(0.8, 2.0)) | |
| response = get_response(user_input) | |
| print("E.L.B.E.R.R.: " + response) |