Spaces:
Runtime error
Runtime error
Ari
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -70,27 +70,27 @@ llm = OpenAI(temperature=0, openai_api_key=openai_api_key, max_tokens = 180)
|
|
70 |
sql_generation_chain = LLMChain(llm=llm, prompt=sql_prompt)
|
71 |
|
72 |
# Insights Generation Chain
|
73 |
-
insights_template =
|
74 |
-
You are an expert data scientist. Based on the user's question and the SQL query result provided below, generate a concise
|
75 |
|
76 |
User's Question: {question}
|
77 |
|
78 |
SQL Query Result:
|
79 |
{result}
|
80 |
|
81 |
-
Analysis
|
82 |
"""
|
83 |
insights_prompt = PromptTemplate(template=insights_template, input_variables=['question', 'result'])
|
84 |
insights_chain = LLMChain(llm=llm, prompt=insights_prompt)
|
85 |
|
86 |
# General Insights and Recommendations Chain
|
87 |
general_insights_template = """
|
88 |
-
You are an expert data scientist. Based on the entire dataset provided below, generate a
|
89 |
|
90 |
Dataset Summary:
|
91 |
{dataset_summary}
|
92 |
|
93 |
-
Analysis and Recommendations:
|
94 |
"""
|
95 |
general_insights_prompt = PromptTemplate(template=general_insights_template, input_variables=['dataset_summary'])
|
96 |
general_insights_chain = LLMChain(llm=llm, prompt=general_insights_prompt)
|
|
|
70 |
sql_generation_chain = LLMChain(llm=llm, prompt=sql_prompt)
|
71 |
|
72 |
# Insights Generation Chain
|
73 |
+
insights_template = """
|
74 |
+
You are an expert data scientist. Based on the user's question and the SQL query result provided below, generate a concise analysis that includes key data insights and actionable recommendations. Limit the response to a maximum of 150 words.
|
75 |
|
76 |
User's Question: {question}
|
77 |
|
78 |
SQL Query Result:
|
79 |
{result}
|
80 |
|
81 |
+
Concise Analysis (max 200 words):
|
82 |
"""
|
83 |
insights_prompt = PromptTemplate(template=insights_template, input_variables=['question', 'result'])
|
84 |
insights_chain = LLMChain(llm=llm, prompt=insights_prompt)
|
85 |
|
86 |
# General Insights and Recommendations Chain
|
87 |
general_insights_template = """
|
88 |
+
You are an expert data scientist. Based on the entire dataset provided below, generate a concise analysis with key insights and recommendations. Limit the response to 150 words.
|
89 |
|
90 |
Dataset Summary:
|
91 |
{dataset_summary}
|
92 |
|
93 |
+
Concise Analysis and Recommendations (max 150 words):
|
94 |
"""
|
95 |
general_insights_prompt = PromptTemplate(template=general_insights_template, input_variables=['dataset_summary'])
|
96 |
general_insights_chain = LLMChain(llm=llm, prompt=general_insights_prompt)
|