powolnik aider (openrouter/anthropic/claude-sonnet-4) commited on
Commit
bd25cd9
·
1 Parent(s): 3ec9a29

feat: implement Gradio user greeting interface

Browse files

Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <[email protected]>

Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -1 +1,20 @@
1
- # using gradio for a simple web interface, implement a function to greet the user AI!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet_user(name):
4
+ """Function to greet the user with their name"""
5
+ if name.strip():
6
+ return f"Hello, {name}! Nice to meet you!"
7
+ else:
8
+ return "Hello! Please enter your name to get a personalized greeting."
9
+
10
+ # Create the Gradio interface
11
+ interface = gr.Interface(
12
+ fn=greet_user,
13
+ inputs=gr.Textbox(label="Enter your name", placeholder="Type your name here..."),
14
+ outputs=gr.Textbox(label="Greeting"),
15
+ title="AI Greeter",
16
+ description="Enter your name and I'll give you a friendly greeting!"
17
+ )
18
+
19
+ if __name__ == "__main__":
20
+ interface.launch()