Spaces:
Build error
Build error
Update chat.py
Browse files90 unmodified lines9192939495969756 unmodified lines15415515615715815916016116290 unmodified linestemplate_query_generation = """Based on the table schema below, write a mySQL query with correct syntax that would answer the user's question.Only write the SQL query without explanations.Schema:{schema}56 unmodified lines{"name": "Database Schema","function": lambda q: self._load_schema_from_database(q),"description": """Search within the mysql database schema and generate SQL-based responses. write mySQL query with correct syntax.The database has single table 'tp_material_forecast' which contains the columns 'date', 'material_name', 'material_quantity', and 'type'. Frame the query only with these four columns.If the material name is given, frame the query in such a way that the material_name is not case-sensitive.If the material name is not present in the table, return the proper message as "This material name is not in the database". Do not give any false values if the material name is not available in database.display the response as a combination of response summary and the response data in the form of table. If the response has month column, display the month as name For example, January instead of displaying as 1.If the user requested comparison between two or more years or the user asks for the data for all years, data should be shown for all the years with month as first column and the years like 2020, 2021 etc as the adjacent columns.90 unmodified lines9192939495969756 unmodified lines15415515615715815916016116290 unmodified linestemplate_query_generation = """Based on the table schema below, write a mySQL query with correct syntax that would answer the user's question.Only write the SQL query without explanations and without string 'sql'and '''.Schema:{schema}56 unmodified lines{"name": "Database Schema","function": lambda q: self._load_schema_from_database(q),"description": """Search within the mysql database schema and generate SQL-based responses.The database has single table 'tp_material_forecast' which contains the columns 'date', 'material_name', 'material_quantity', and 'type'. Frame the query only with these four columns.If the material name is given, frame the query in such a way that the material_name is not case-sensitive.If the material name is not present in the table, return the proper message as "This material name is not in the database". Do not give any false values if the material name is not available in database.display the response as a combination of response summary and the response data in the form of table. If the response has month column, display the month as name For example, January instead of displaying as 1.If the user requested comparison between two or more years or the user asks for the data for all years, data should be shown for all the years with month as first column and the years like 2020, 2021 etc as the adjacent columns.
chat.py+3-3