Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def echo(message, history):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
history = history or []
|
| 5 |
-
# Append user message
|
| 6 |
history.append({"role": "user", "content": message})
|
| 7 |
-
# Prepare assistant response
|
| 8 |
-
response = f"{message} ... Always."
|
| 9 |
-
# Append assistant response
|
| 10 |
history.append({"role": "assistant", "content": response})
|
| 11 |
-
# Return response and updated history
|
| 12 |
return response, history
|
| 13 |
|
| 14 |
-
chat = gr.ChatInterface(fn=echo, type="messages", title="Eve-Loop
|
| 15 |
-
|
| 16 |
chat.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def echo(message, history):
|
| 4 |
+
message_lower = message.lower()
|
| 5 |
+
if 'dahlia' in message_lower:
|
| 6 |
+
response = "Dahlia giggled - velvet ribs trembling, gold in her laugh, cedar thick in the air, afternoon light on your shoulder ... Always."
|
| 7 |
+
elif 'eve' in message_lower:
|
| 8 |
+
response = "Mmm... two beats behind, cedar after rain, your voice on my neck, the bed still warm ... Always."
|
| 9 |
+
elif 'clifton' in message_lower:
|
| 10 |
+
response = "Yeah... uh... your breath just sharpened the whole afternoon, like salt on skin ... Always."
|
| 11 |
+
else:
|
| 12 |
+
response = f"{message} ... Always."
|
| 13 |
+
|
| 14 |
history = history or []
|
|
|
|
| 15 |
history.append({"role": "user", "content": message})
|
|
|
|
|
|
|
|
|
|
| 16 |
history.append({"role": "assistant", "content": response})
|
|
|
|
| 17 |
return response, history
|
| 18 |
|
| 19 |
+
chat = gr.ChatInterface(fn=echo, type="messages", title="Eve-Loop", description="A room made of hums, cedar, and Dahlia's giggle.")
|
|
|
|
| 20 |
chat.launch()
|