La interfaz está localizada; las descripciones y documentos de las Skills se traducen automáticamente con IA a su idioma. El código, los comandos, rutas y términos técnicos se mantienen en el original, y prevalece el documento del autor.
Explorar Skills
Desarrollo · SKILL.md

custom-skills

custom-skills

Guides PandasAI custom function skills, @pai.skill decorators, SkillType validation, global registry management, and skill-related troubleshooting.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentación de la Skill

GitHub

name: custom-skills description: "Guides PandasAI custom function skills, @pai.skill decorators, SkillType validation, global registry management, and skill-related troubleshooting." disable-model-invocation: true metadata: disco-role: operating license: NOASSERTION

Custom Skills

Use this sub-skill when a user wants PandasAI to make custom Python functions available to generated analysis code through @pai.skill() or the pandasai.ee.skills registry.

PandasAI custom skills are runtime functions for PandasAI-generated code. They are not DisCo Agent Skills and are not SKILL.md directories.

Fast route

  1. Define a normal Python function with type hints and a useful docstring.
  2. Decorate it with @pai.skill() or @pai.skill("custom_name").
  3. Configure the LLM and run PandasAI chat as usual.
  4. If testing registry behavior, clear SkillsManager between tests to avoid duplicate-name leakage.
  5. If the task is about using those functions during chat, route back to ../conversational-analysis/SKILL.md after registration is correct.
import pandasai as pai

@pai.skill()
def format_currency(amount: float) -> str:
    """Format a numeric amount as US dollars."""
    return f"${amount:,.2f}"

Read next

Boundaries

Enterprise note

PandasAI documentation marks custom skills as an Enterprise feature for production use. For local experimentation and tests, the decorator and registry exist in the package. For production deployments, warn the user to confirm their PandasAI license/plan.

Safe validation

python sub-skills/custom-skills/scripts/skill_registry_smoke.py

The helper registers a small skill, verifies duplicate-name protection, verifies no-docstring failure behavior, and prints JSON. It does not need a real LLM or provider key.

Common gotchas

  • A function must have a docstring unless SkillType(..., description=...) is used directly.
  • Duplicate skill names in the global registry raise ValueError.
  • Decorated functions are replaced by SkillType objects, but remain callable.
  • Registry state is global; clear it in tests before registering predictable names.
  • Lambdas need an explicit name and description when wrapped directly.
Skills guardadas