Spaces:
No application file
No application file
| import gradio as gr | |
| import subprocess | |
| import requests | |
| import os | |
| # Start Clawdbot gateway in background | |
| subprocess.Popen([ | |
| "clawdbot", | |
| "gateway", | |
| "--port", "7860", | |
| "--vault-path", "/app/vault" | |
| ]) | |
| def ask_clawdbot(question): | |
| # Call your local Clawdbot API | |
| try: | |
| response = requests.post("http://localhost:7860/ask", json={"query": question}) | |
| return response.json().get("answer", "No answer") | |
| except Exception as e: | |
| return f"Error: {e}" | |
| iface = gr.Interface( | |
| fn=ask_clawdbot, | |
| inputs="text", | |
| outputs="text", | |
| title="Clawdbot Demo", | |
| description="Ask questions to your notes!" | |
| ) | |
| iface.launch(server_name="0.0.0.0", server_port=7860) | |