File size: 640 Bytes
60a3ae1
fde3e5f
60a3ae1
 
 
 
 
 
fde3e5f
60a3ae1
 
fde3e5f
60a3ae1
 
 
 
 
 
 
fde3e5f
 
60a3ae1
 
 
 
 
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
import gradio as gr

# Define the sidebar items
sidebar_items = [
    {"prompt": "Hello world!", "description": "A simple greeting."},
    {"prompt": "What is your name?", "description": "Ask a user for their name."},
    # Add more prompt examples and descriptions here...
]

def greet(name):
    return f"Hello {name}!"

# Create the interface with left sidebar
iface = gr.Interface(
    fn=greet,
    inputs="text",
    outputs="text",
    title="Greeting App",
    description="Ask a user for their name and greet them."
)

# Add the left sidebar with prompt examples
iface.sidebar(sidebar_items)

# Launch the Gradio app
iface.launch()