Spaces:
Build error
Build error
Update app.py
Browse files7 unmodified lines891011121314151617181920212223242526272829303132333435363738397 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef pull_rates(english_fred_id: str)-> str: #it's import to specify the return type#Keep this format for the description / args / args description but feel free to modify the tool"""A tool that fetches the latest interest or treasury rate from FRED.Args:english_fred_id: a string representing a valid insterst rate code to pull from the FRED website"""# Dictionary mapping user-friendly tenors to their FRED IDs.yield_curve_ids = {"SOFR": "SOFR","1 Month": "DGS1MO","3 Month": "DGS3MO","6 Month": "DGS6MO","1 Year": "DGS1","2 Year": "DGS2","3 Year": "DGS3","5 Year": "DGS5","7 Year": "DGS7","10 Year": "DGS10","20 Year": "DGS20","30 Year": "DGS30"}fred_id = yield_curve_ids[english_fred_id]# Build the URL for the CSV on the FRED websitefred_api_url = f"https://fred.stlouisfed.org/graph/fredgraph.csv?id={fred_id}"try:import pandas as pd# Create timezone object7 unmodified lines8910111213141516171819202122232425262728293031323334353637387 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef pull_rates(fred_id: str)-> str: #it's import to specify the return type#Keep this format for the description / args / args description but feel free to modify the tool"""A tool that fetches the latest interest or treasury rate from FRED.Args:fred_id: a string representing a valid insterst rate code to pull from the FRED website"""# Dictionary mapping user-friendly tenors to their FRED IDs.yield_curve_ids = {'SOFR': 'SOFR','DGS1MO': '1 Month','DGS3MO': '3 Month','DGS6MO': '6 Month','DGS1': '1 Year','DGS2': '2 Year','DGS3': '3 Year','DGS5': '5 Year','DGS7': '7 Year','DGS10': '10 Year','DGS20': '20 Year','DGS30': '30 Year'}english_fred_id = yield_curve_ids[fred_id]# Build the URL for the CSV on the FRED websitefred_api_url = f"https://fred.stlouisfed.org/graph/fredgraph.csv?id={fred_id}"try:import pandas as pd# Create timezone object
app.py+16-17