Redmind commited on
Commit
a6e3784
·
verified ·
1 Parent(s): 24014e0

Update chat.py

Browse files
Files changed (1) hide show
  1. chat.py +5 -4
chat.py CHANGED
@@ -161,7 +161,7 @@ class ChatHandler:
161
  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.
162
  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.
163
  Do not show everything in the same column. (For example, if the user requested from 2020 to 2024, then display the output table with the columns [Month, Material value in 2020, Material value in 2020, Material value in 2021, Material value in 2022, Material value in 2023, Material value in 2024]) so that the records will be displayed for all the months from Jaunary to December across the years.
164
- Always display the table in the response at the end in the Final answer. Display the table whereever it is required. If there is any error while executing the user question, kindly display the error message as 'As you know I am still learning at this moment I am not able to respond to your question.\nThank you for your patience!'""",
165
  },
166
  ]
167
 
@@ -269,11 +269,11 @@ def create_visualization_csv(visual_query):
269
  #import matplotlib
270
  #matplotlib.use('TkAgg') # Replace with 'QtAgg' or 'MacOSX' if on macOS
271
 
272
- visual_query = visual_query + """ create chart with suitable x and y axis as user requested.
273
- use proper axis scale and mention axis values properly.
274
  Do not miss any values.
275
  Mention only month name in date axis and not the numbers or the date.
276
- Do not place legend in the middle of the chart. Place the legend in such a way that the plotted chart is not hidden.
 
277
  Return the image path only after plotting all the values."""
278
 
279
 
@@ -304,6 +304,7 @@ def convert_column_types(df):
304
  return df
305
 
306
  def unstructured_text_to_df(text):
 
307
  import openai
308
  import pandas as pd
309
  import os
 
161
  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.
162
  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.
163
  Do not show everything in the same column. (For example, if the user requested from 2020 to 2024, then display the output table with the columns [Month, Material value in 2020, Material value in 2020, Material value in 2021, Material value in 2022, Material value in 2023, Material value in 2024]) so that the records will be displayed for all the months from Jaunary to December across the years.
164
+ If there is any error while executing the user question, kindly display the error message as 'As you know I am still learning at this moment I am not able to respond to your question.\nThank you for your patience!'""",
165
  },
166
  ]
167
 
 
269
  #import matplotlib
270
  #matplotlib.use('TkAgg') # Replace with 'QtAgg' or 'MacOSX' if on macOS
271
 
272
+ visual_query = visual_query + """ use proper axis scale and mention axis values properly.
 
273
  Do not miss any values.
274
  Mention only month name in date axis and not the numbers or the date.
275
+ Do not place legend in the middle of the chart.
276
+ Place the legend in such a way that the plotted chart is not hidden.
277
  Return the image path only after plotting all the values."""
278
 
279
 
 
304
  return df
305
 
306
  def unstructured_text_to_df(text):
307
+
308
  import openai
309
  import pandas as pd
310
  import os