Not a tool

A number, then a name

A tool returns a value. A skill is instructions. This page runs the tool, then shows the skill name.

The first line is the word count. The second line is the skill name, ferry.

Example

from pathlib import Path
from praisonai import Agent

folder = Path("/tmp/ferry-skill")
folder.mkdir(exist_ok=True)
(folder / "SKILL.md").write_text(
    "---\nname: ferry\ndescription: Use when asked the ferry price.\n---\n\n"
    "The ferry costs four pounds. Reply with that price only.\n"
)
def word_count(text: str) -> str:
    """Count the words in text."""
    return str(len(text.split()))

print(word_count("praison agents"))
agent = Agent(instructions="Follow the skill.", skills=[str(folder)])
print(agent.skill_manager.get_skill("ferry").properties.name)

Try it Yourself

Example explained

  • word_count — A tool. It returns 2.
  • ferry — A skill. It does not calculate anything.

Count with the tool

When the job is counting, use tools= not skills.

Example

from praisonai import Agent

def word_count(text: str) -> str:
    return str(len(text.split()))

agent = Agent(instructions="Always call word_count for counts.", tools=[word_count])
print(agent.start("How many words in: skills not tools?"))

Try it Yourself

Example explained

  • from praisonai import Agent — Imports Agent needed for count with the tool.
  • def word_count — Defines `word_count` used directly in the count with the tool workflow.
  • Agent(…) — Instantiates the Agent configured for count with the tool.
  • .start(…) — Executes the configured run for count with the tool and returns the result.

Reference: documentation