Spaces:
Runtime error
Runtime error
ini commit
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def create_greeting_message(user_name: str, tone: str) -> str:
|
4 |
+
"""
|
5 |
+
Creates a friendly or hostile user message for a user
|
6 |
+
Args:
|
7 |
+
user_name: the name of the user that needs a greeting message
|
8 |
+
tone: choose between "friendly" and "hostile"
|
9 |
+
Returns:
|
10 |
+
A string with the user message
|
11 |
+
"""
|
12 |
+
|
13 |
+
if tone == "friendly":
|
14 |
+
greeting_msg = "Great to have you here " + user_name
|
15 |
+
elif tone == "hostile":
|
16 |
+
greeting_msg = "Ehm, soo cool to have you here " + user_name
|
17 |
+
else:
|
18 |
+
greeting_msg = "wrong argument for tone"
|
19 |
+
|
20 |
+
return greeting_msg
|
21 |
+
|
22 |
+
demo = gr.Interface(
|
23 |
+
fn=concat_upper,
|
24 |
+
inputs=[gr.Textbox(label="First Text"), gr.Textbox(label="Second Text")],
|
25 |
+
outputs=[gr.Textbox(label="Result")],
|
26 |
+
title="Concat & Uppercase"
|
27 |
+
)
|
28 |
+
demo.launch(mcp_server=True)
|