One-line SDK features
Enable web search, planning, reflection, and caching with True
PraisonAI follows a progressive configuration ladder: enable capabilities with one boolean like caching=True, planning=True, reflection=True, or web=True, and graduate to typed Config classes only when you need custom tuning.
Start with caching=True and output='silent' here; dedicated lessons ahead walk through PlanningConfig, ReflectionConfig, and WebConfig one at a time.
Example
from praisonai import Agent
agent = Agent(
instructions='Give 3 short bullet study tips in under 35 words.',
caching=True,
output='silent',
)
print(agent.start('Give 3 tips to learn Python faster.'))Example explained
- caching=True — Enables built-in response caching in one line to speed up repeated prompts.
- output='silent' — Returns the clean reply string without terminal trace boxes.
Define clean tools with @tool
You can decorate any Python function with @tool from praisonai to give it a clear schema and attach it to any Agent, or enable web=True for built-in web search.
Expected output: the agent calls celsius_to_fahrenheit(25) and prints 77.0.
Example
from praisonai import Agent, tool
@tool
def celsius_to_fahrenheit(celsius: float) -> float:
"""Convert degrees Celsius to Fahrenheit."""
return (celsius * 9 / 5) + 32
agent = Agent(
instructions='Use the tool for temperature math.',
tools=[celsius_to_fahrenheit],
)
print(agent.start('Convert 25 C to Fahrenheit'))Example explained
- @tool — Registers a Python function with automatic parameter schema validation.
- tools=[celsius_to_fahrenheit] — Gives the agent access to your decorated tool.
Reference: documentation