Spaces:
Running
Running
Update insight_and_tasks/agents/follower_agent.py
Browse files
insight_and_tasks/agents/follower_agent.py
CHANGED
@@ -366,7 +366,7 @@ class EnhancedFollowerAnalysisAgent:
|
|
366 |
# Check if LLM is configured using the proper config.get() method
|
367 |
config = pai.config.get()
|
368 |
logger.info(f"pai_config: {config}, Type of config: {type(config)}")
|
369 |
-
if not config.
|
370 |
logger.warning("PandasAI LLM not configured. Attempting to configure now.")
|
371 |
# This assumes configure_pandasai is available and sets the LLM config
|
372 |
from insight_and_tasks.utils.pandasai_setup import configure_pandasai
|
@@ -374,10 +374,10 @@ class EnhancedFollowerAnalysisAgent:
|
|
374 |
|
375 |
# Re-check configuration after setup attempt
|
376 |
config = pai.config.get()
|
377 |
-
if not config.
|
378 |
raise RuntimeError("PandasAI LLM could not be configured for chat operation.")
|
379 |
|
380 |
-
logger.info(f"Executing PandasAI chat for follower analysis with LLM: {config.
|
381 |
return pandas_ai_df.chat(analysis_query)
|
382 |
|
383 |
analysis_result_raw = self.retry_mechanism.retry_with_backoff(
|
|
|
366 |
# Check if LLM is configured using the proper config.get() method
|
367 |
config = pai.config.get()
|
368 |
logger.info(f"pai_config: {config}, Type of config: {type(config)}")
|
369 |
+
if not config.llm:
|
370 |
logger.warning("PandasAI LLM not configured. Attempting to configure now.")
|
371 |
# This assumes configure_pandasai is available and sets the LLM config
|
372 |
from insight_and_tasks.utils.pandasai_setup import configure_pandasai
|
|
|
374 |
|
375 |
# Re-check configuration after setup attempt
|
376 |
config = pai.config.get()
|
377 |
+
if not config.llm:
|
378 |
raise RuntimeError("PandasAI LLM could not be configured for chat operation.")
|
379 |
|
380 |
+
logger.info(f"Executing PandasAI chat for follower analysis with LLM: {config.llm}")
|
381 |
return pandas_ai_df.chat(analysis_query)
|
382 |
|
383 |
analysis_result_raw = self.retry_mechanism.retry_with_backoff(
|