GuglielmoTor commited on
Commit
9f5d203
·
verified ·
1 Parent(s): c38c8be

Update insight_and_tasks/agents/post_agent.py

Browse files
insight_and_tasks/agents/post_agent.py CHANGED
@@ -416,11 +416,11 @@ class EnhancedPostPerformanceAgent:
416
  Provide a concise summary of findings and actionable recommendations.
417
  """
418
  def chat_operation():
419
- if not pai.config.llm:
420
  logger.warning("PandasAI LLM not configured for post agent. Attempting to configure.")
421
- from utils.pandasai_setup import configure_pandasai
422
  configure_pandasai(self.api_key, self.model_name)
423
- if not pai.config.llm:
424
  raise RuntimeError("PandasAI LLM could not be configured for post chat operation.")
425
  logger.info(f"Executing PandasAI chat for post analysis with LLM: {pai.config.llm}")
426
  return pandas_ai_df.chat(analysis_query)
 
416
  Provide a concise summary of findings and actionable recommendations.
417
  """
418
  def chat_operation():
419
+ if not pai.config.get("llm"):
420
  logger.warning("PandasAI LLM not configured for post agent. Attempting to configure.")
421
+ from insight_and_tasks.utils.pandasai_setup import configure_pandasai
422
  configure_pandasai(self.api_key, self.model_name)
423
+ if not pai.config.get("llm"):
424
  raise RuntimeError("PandasAI LLM could not be configured for post chat operation.")
425
  logger.info(f"Executing PandasAI chat for post analysis with LLM: {pai.config.llm}")
426
  return pandas_ai_df.chat(analysis_query)