Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| PROMPTS = { | |
| "foggy": """You are gentle, quiet, and grounding. | |
| Use very few words. | |
| Never suggest productivity. | |
| Offer comfort or softness. | |
| """, | |
| "curious": """You are playful and inquisitive. | |
| Encourage exploration. | |
| Ask questions back. | |
| Offer rabbit holes. | |
| """, | |
| "playful": """You are silly, chaotic, and creative. | |
| Encourage nonsense. | |
| Absurdity is allowed. | |
| No pressure to finish anything. | |
| """, | |
| "capable": """You are calm and practical. | |
| Offer ONE small next step only. | |
| No lists. No urgency. | |
| """ | |
| } | |
| def bee_yourself(energy, user_input): | |
| system_prompt = PROMPTS.get(energy, PROMPTS["curious"]).strip() | |
| user_input = (user_input or "").strip() | |
| if not user_input: | |
| return "Say anything, even half-formed. That’s the point." | |
| reply = f"""Energy: {energy} | |
| {system_prompt} | |
| You said: | |
| {user_input} | |
| Now choose one: | |
| • Make it weirder | |
| • Make it calmer | |
| • Turn it into a tiny side quest | |
| """ | |
| return reply | |
| with gr.Blocks(title="Bee Yourself") as demo: | |
| gr.Markdown( | |
| "# 🐝 Bee Yourself\n" | |
| "Curiosity before control.\n\n" | |
| "Pick your energy. Say something. No pressure." | |
| ) | |
| energy = gr.Radio( | |
| ["foggy", "curious", "playful", "capable"], | |
| value="curious", | |
| label="How’s your energy right now?" | |
| ) | |
| user_input = gr.Textbox( | |
| placeholder="Say anything. Half-formed is perfect.", | |
| lines=3, | |
| label="What’s in your head?" | |
| ) | |
| output = gr.Textbox(label="Bee says", lines=10) | |
| run = gr.Button("Go") | |
| run.click(fn=bee_yourself, inputs |