Update app.py
Browse files
app.py
CHANGED
@@ -121,7 +121,7 @@ def market_analysis_agent(user_input, history=[]):
|
|
121 |
# Check if the query is related to cryptocurrency
|
122 |
if "bitcoin" in user_input.lower() or "crypto" in user_input.lower():
|
123 |
# Trigger the fetch_crypto_trends function
|
124 |
-
crypto_data = fetch_crypto_trends(symbol="BTC", market="
|
125 |
formatted_response = format_response(crypto_data)
|
126 |
else:
|
127 |
# Handle other predefined market queries
|
@@ -163,7 +163,7 @@ def market_analysis_agent(user_input, history=[]):
|
|
163 |
return [(user_input, f"Oops, something went wrong: {str(e)}")], history
|
164 |
|
165 |
def fetch_crypto_trends(symbol="BTC", market="USD", api_key="G3NRIAU5OWJZXS2E"):
|
166 |
-
url = f'https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_DAILY&symbol=
|
167 |
try:
|
168 |
response = requests.get(url)
|
169 |
response.raise_for_status() # Raise exception for HTTP errors
|
|
|
121 |
# Check if the query is related to cryptocurrency
|
122 |
if "bitcoin" in user_input.lower() or "crypto" in user_input.lower():
|
123 |
# Trigger the fetch_crypto_trends function
|
124 |
+
crypto_data = fetch_crypto_trends(symbol="BTC", market="EUR", api_key="G3NRIAU5OWJZXS2E")
|
125 |
formatted_response = format_response(crypto_data)
|
126 |
else:
|
127 |
# Handle other predefined market queries
|
|
|
163 |
return [(user_input, f"Oops, something went wrong: {str(e)}")], history
|
164 |
|
165 |
def fetch_crypto_trends(symbol="BTC", market="USD", api_key="G3NRIAU5OWJZXS2E"):
|
166 |
+
url = f'https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_DAILY&symbol=BTC&market=EUR&apikey={api_key}'
|
167 |
try:
|
168 |
response = requests.get(url)
|
169 |
response.raise_for_status() # Raise exception for HTTP errors
|