class_docstr: Agent class to improve the conversational experience in PandasAI
class_docstr_tok: ["Agent","class","to","improve","the","conversational","experience","in","PandasAI"]
docstr: Call LLM with prompt using error handling to retry based on config
  Args:
      prompt (AbstractPrompt): AbstractPrompt to pass to LLM's
docstr_tok: ["Call","LLM","with","prompt","using","error","handling","to","retry","based","on","config","Args",":","prompt","(","AbstractPrompt",")",":","AbstractPrompt","to","pass","to","LLM","'s"]
code: def _call_llm_with_prompt(self, prompt: AbstractPrompt):
      """
      Call LLM with prompt using error handling to retry based on config
      Args:
          prompt (AbstractPrompt): AbstractPrompt to pass to LLM's
      """
      retry_count = 0
      while retry_count < self._lake.config.max_retries:
          try:
              result: str = self._lake.llm.call(prompt)
              if prompt.validate(result):
                  return result
              else:
                  raise Exception("Response validation failed!")
          except Exception:
              if (
                  not self._lake.use_error_correction_framework
                  or retry_count >= self._lake.config.max_retries - 1
              ):
                  raise
              retry_count += 1
  
imports: import json
  from typing import Union, List, Optional
  from ..helpers.df_info import DataFrameType
  from ..helpers.logger import Logger
  from ..helpers.memory import Memory
  from ..prompts.base import AbstractPrompt
  from ..prompts.clarification_questions_prompt import ClarificationQuestionPrompt
  from ..prompts.explain_prompt import ExplainPrompt
  from ..prompts.rephase_query_prompt import RephraseQueryPrompt
  from ..prompts.check_if_relevant_to_conversation import CheckIfRelevantToConversationPrompt
  from ..schemas.df_config import Config
  from ..skills import Skill
  from ..smart_datalake import SmartDatalake
label_desc: Use image node_id 3 for calling the Agent obj's underlying member method code with example usage: obj._call_llm_with_prompt(prompt) and returns: result