import gradio as gr | |
# Function to process DMs and reply with an echo | |
def echo_dm(message): | |
"""Echos the received Direct Message.""" | |
return message | |
# Gradio interface for the echo bot | |
interface = gr.Interface( | |
fn=echo_dm, | |
inputs="text", | |
outputs="text", | |
title="Echo Bot", | |
description="Send a Direct Message and I'll echo it back!", | |
elem_id="echo-container", | |
) | |
# Launch the Gradio interface | |
interface.launch() | |