File size: 704 Bytes
be1df97
 
043c5d6
 
be1df97
043c5d6
 
 
 
 
 
 
be1df97
 
043c5d6
 
 
 
 
 
 
 
 
 
 
 
 
 
be1df97
 
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
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)