Spaces:
Sleeping
Sleeping
Nolan Zandi commited on
Commit ·
8b3aed5
1
Parent(s): 794f088
adjustments to linking system
Browse filesFiles changed (2)
1 unmodified line23456724 unmodified lines323334353637381 unmodified linefrom quickchart import QuickChartimport pandas as pdfrom utils import TEMP_DIRdef chart_generation_func(queries: List[str], session_hash):print("CHART GENERATION")24 unmodified linesdf = pd.DataFrame(data)csv_path = f'{dir_path}/data.csv'df.to_csv(csv_path)download_path = f'gradio_api/file/temp/{session_hash}/data.csv'html_table = df.to_html() + f'<p>Download as a <a target="_blank" href="{download_path}">CSV file</a></p>'print(html_table)1 unmodified line234567891011121324 unmodified lines383940414243441 unmodified linefrom quickchart import QuickChartimport pandas as pdfrom utils import TEMP_DIRimport osfrom dotenv import load_dotenvload_dotenv()root_url = os.getenv("ROOT_URL")def chart_generation_func(queries: List[str], session_hash):print("CHART GENERATION")24 unmodified linesdf = pd.DataFrame(data)csv_path = f'{dir_path}/data.csv'df.to_csv(csv_path)download_path = f'{root_url}/gradio_api/file/temp/{session_hash}/data.csv'html_table = df.to_html() + f'<p>Download as a <a target="_blank" href="{download_path}">CSV file</a></p>'print(html_table)
64 unmodified lines656667686970717264 unmodified lines"description": f"""This an table generation tool useful to format data as a table from queried data from our SQL table called'data_source with the following Columns: {columns}. Returns an html string generated from the pandas library and pandas.to_html()function which will be displayed inline in our chat window. There will also be a link to download the CSV included in the HTML string.Do not change or edit this link in any way. Do not edit the HTML returned by the function in any way.Do not edit the string returned from the table_generation_func function in any way and display it fully to the user in the chat window.""","parameters": {"type": "object","properties": {64 unmodified lines656667686970717264 unmodified lines"description": f"""This an table generation tool useful to format data as a table from queried data from our SQL table called'data_source with the following Columns: {columns}. Returns an html string generated from the pandas library and pandas.to_html()function which will be displayed inline in our chat window. There will also be a link to download the CSV included in the HTML string.This link should open in a new window. Do not edit the string returned by the function in any way when displaying to the user, as the user needsall of the information returned by the function in it's exact state.""","parameters": {"type": "object","properties": {
functions/chart_functions.py+7-1
tools.py+2-2