技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
conversational-analysis【数据与研究】Guides PandasAI natural-language DataFrame chat, Agent workflows, LLM configuration, response objects, generated-code repair, and legacy wrapper migration.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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.
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.
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})
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.
Inspect response.value, response.type, and response.last_code_executed
before deciding that a PandasAI run succeeded.
If code is untrusted or the app is public-facing, route to
../sandbox-and-security/SKILL.md.
references/api-reference.md for verified
signatures, config fields, response classes, and legacy wrapper notes.references/workflows.md for copyable chat,
multi-dataframe, follow-up, FakeLLM, and migration recipes.references/response-formats.md for result
dictionary rules and response object handling.references/troubleshooting.md when .chat()
fails, generated code is rejected, or response parsing errors appear.scripts/offline_chat_smoke.py for a
deterministic no-credential smoke test.| Situation | Use |
|---|---|
| One dataframe and no need to keep a separate explicit agent | df.chat("question") |
| Several dataframes in one question | pai.chat("question", df1, df2, ...) |
| Multi-turn conversation with explicit memory and options | agent = Agent([...], memory_size=10); agent.chat(...); agent.follow_up(...) |
| Need deterministic local validation | FakeLLM plus bundled offline_chat_smoke.py |
User asks about SmartDataframe or SmartDatalake | Explain deprecation and migrate to pai.DataFrame, pai.chat, or Agent |
pai.create, pai.load, SQL views, transformations,
and CSV/Excel dataset modeling to
../semantic-layer/SKILL.md.@pai.skill() and global custom function registration to
../custom-skills/SKILL.md.../sandbox-and-security/SKILL.md.pai command-line interface to
../cli-and-project-ops/SKILL.md.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.
.chat() fails without a configured LLM, except when using FakeLLM or a
supplied config object for tests.execute_sql_query and assign a valid result
dictionary. Free-form pandas code without the query function is rejected by
the package's validator..save(...) in
automation.