Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import pytz
|
|
| 4 |
import yfinance as yf
|
| 5 |
import os
|
| 6 |
from Gradio_UI import GradioUI
|
| 7 |
-
import gradio as gr
|
| 8 |
|
| 9 |
# Fetch the API key from the environment variable (if needed)
|
| 10 |
API_KEY = os.getenv("KEY")
|
|
@@ -60,25 +59,19 @@ agent = CodeAgent(
|
|
| 60 |
verbosity_level=1
|
| 61 |
)
|
| 62 |
|
| 63 |
-
# Add
|
| 64 |
-
|
| 65 |
-
###
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
| 73 |
"""
|
| 74 |
|
| 75 |
-
#
|
| 76 |
-
|
| 77 |
-
with gr.Blocks() as demo:
|
| 78 |
-
gr.Markdown("# Currency and Time Agent")
|
| 79 |
-
gr.Markdown(examples)
|
| 80 |
-
GradioUI(agent).launch() # Use launch() instead of render()
|
| 81 |
-
demo.launch()
|
| 82 |
-
|
| 83 |
-
# Launch the app
|
| 84 |
-
launch_with_examples(agent)
|
|
|
|
| 4 |
import yfinance as yf
|
| 5 |
import os
|
| 6 |
from Gradio_UI import GradioUI
|
|
|
|
| 7 |
|
| 8 |
# Fetch the API key from the environment variable (if needed)
|
| 9 |
API_KEY = os.getenv("KEY")
|
|
|
|
| 59 |
verbosity_level=1
|
| 60 |
)
|
| 61 |
|
| 62 |
+
# Add example usage instructions to the Gradio UI description
|
| 63 |
+
description = """
|
| 64 |
+
### Currency and Time Agent
|
| 65 |
+
This app allows you to:
|
| 66 |
+
1. Get the current exchange rate for a currency pair (e.g., USD to JPY).
|
| 67 |
+
2. Get the current time in a specific timezone (e.g., America/New_York).
|
| 68 |
|
| 69 |
+
#### Example Queries:
|
| 70 |
+
- "What is the current exchange rate for USD to JPY?"
|
| 71 |
+
- "Get the EUR to GBP rate."
|
| 72 |
+
- "What is the current time in America/New_York?"
|
| 73 |
+
- "Get the time in Asia/Tokyo."
|
| 74 |
"""
|
| 75 |
|
| 76 |
+
# Launch the Gradio UI
|
| 77 |
+
GradioUI(agent, description=description).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|