File size: 776 Bytes
2b09641
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

# Define your ElevenLabs agent URL
agent_url = "https://elevenlabs.io/app/talk-to?agent_id=EERV7uoyRL7PKvGFYuX7"

# Function to return a clickable HTML link
def get_call_link():
    return f"""
    <p style="font-size:18px;">Click the button below to talk to the AI Agent:</p>
    <a href="{agent_url}" target="_blank">
        <button style="padding:10px 20px; font-size:18px; background-color:#007bff; color:white; border:none; border-radius:5px;">
            Start Call
        </button>
    </a>"""

with gr.Blocks() as app:
    gr.Markdown("## 🤖 Talk to AI Agent")
    call_btn = gr.Button("Show Call Link")
    html_output = gr.HTML()
    call_btn.click(fn=get_call_link, outputs=html_output)

app.launch(server_name="0.0.0.0", server_port=7860)