L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Données et recherche · SKILL.md

conversational-analysis

conversational-analysis

Guides PandasAI natural-language DataFrame chat, Agent workflows, LLM configuration, response objects, generated-code repair, and legacy wrapper migration.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: conversational-analysis description: "Guides PandasAI natural-language DataFrame chat, Agent workflows, LLM configuration, response objects, generated-code repair, and legacy wrapper migration." disable-model-invocation: true metadata: disco-role: operating license: NOASSERTION

Conversational Analysis

Use this sub-skill when the user wants to ask natural-language questions of tabular data through PandasAI, configure the LLM behind .chat(), inspect typed responses, debug generated code, or migrate from legacy SmartDataframe/ SmartDatalake usage.

Fast route

  1. If the user only has a pandas dataframe or a CSV/Excel file, create a PandasAI DataFrame or route dataset creation to the semantic-layer sub-skill.

  2. Configure a real LLM before .chat() unless this is an offline smoke:

    import pandasai as pai
    from pandasai_litellm.litellm import LiteLLM
    
    llm = LiteLLM(model="gpt-4.1-mini", api_key="...")
    pai.config.set({"llm": llm, "save_logs": True, "verbose": False, "max_retries": 3})
    
  3. Use df.chat(...) for a single dataframe, pai.chat(...) for multiple DataFrames in a fresh global conversation, or Agent(...).follow_up(...) for explicit multi-turn state.

  4. Inspect response.value, response.type, and response.last_code_executed before deciding that a PandasAI run succeeded.

  5. If code is untrusted or the app is public-facing, route to ../sandbox-and-security/SKILL.md.

Read next

Core choices

SituationUse
One dataframe and no need to keep a separate explicit agentdf.chat("question")
Several dataframes in one questionpai.chat("question", df1, df2, ...)
Multi-turn conversation with explicit memory and optionsagent = Agent([...], memory_size=10); agent.chat(...); agent.follow_up(...)
Need deterministic local validationFakeLLM plus bundled offline_chat_smoke.py
User asks about SmartDataframe or SmartDatalakeExplain deprecation and migrate to pai.DataFrame, pai.chat, or Agent

Boundaries

Safe validation

Run this from any environment where PandasAI is installed:

python sub-skills/conversational-analysis/scripts/offline_chat_smoke.py

The script uses FakeLLM, a tiny in-memory dataframe, and generated code that calls execute_sql_query. It should not need network, provider credentials, or large data.

Common gotchas

  • .chat() fails without a configured LLM, except when using FakeLLM or a supplied config object for tests.
  • Generated code must call execute_sql_query and assign a valid result dictionary. Free-form pandas code without the query function is rejected by the package's validator.
  • Table names in generated SQL must match the registered dataframe schema name. Hyphenated dataset paths are transformed to underscore table names.
  • Printing a chart response can open an image viewer; use .save(...) in automation.
Skills enregistrées