r"""Initializes the PandaReader class. Args: config (Optional[Dict[str, Any]], optional): The configuration dictionary that can include LLM API settings for LLM-based processing. If not provided, it will use OpenAI with the API key
(self, config: Optional[Dict[str, Any]] = None)
| 52 | |
| 53 | class PandaReader: |
| 54 | def __init__(self, config: Optional[Dict[str, Any]] = None) -> None: |
| 55 | r"""Initializes the PandaReader class. |
| 56 | |
| 57 | Args: |
| 58 | config (Optional[Dict[str, Any]], optional): The configuration |
| 59 | dictionary that can include LLM API settings for LLM-based |
| 60 | processing. If not provided, it will use OpenAI with the API |
| 61 | key from the OPENAI_API_KEY environment variable. You can |
| 62 | customize the LLM configuration by providing a 'llm' key in |
| 63 | the config dictionary. (default: :obj:`None`) |
| 64 | """ |
| 65 | from pandasai.llm import OpenAI # type: ignore[import-untyped] |
| 66 | |
| 67 | self.config = config or {} |
| 68 | if "llm" not in self.config: |
| 69 | self.config["llm"] = OpenAI( |
| 70 | api_token=os.getenv("OPENAI_API_KEY"), |
| 71 | ) |
| 72 | |
| 73 | self.__LOADER = { |
| 74 | ".csv": self.read_csv, |
| 75 | ".xlsx": self.read_excel, |
| 76 | ".xls": self.read_excel, |
| 77 | ".json": self.read_json, |
| 78 | ".parquet": self.read_parquet, |
| 79 | ".sql": self.read_sql, |
| 80 | ".html": self.read_html, |
| 81 | ".feather": self.read_feather, |
| 82 | ".dta": self.read_stata, |
| 83 | ".sas": self.read_sas, |
| 84 | ".pkl": self.read_pickle, |
| 85 | ".h5": self.read_hdf, |
| 86 | ".orc": self.read_orc, |
| 87 | } |
| 88 | |
| 89 | def load( |
| 90 | self, |
nothing calls this directly
no outgoing calls
no test coverage detected