Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Include praisonai package in your project
Option 0: One-liner (simplest)
praisonai.run() reuses the same framework auto-detection and LLM endpoint resolution the praisonai CLI uses, so anything that works on the command line works here.
What it does
Auto-detects the first installed framework in this order:
crewai → praisonaiagents → autogen → ag2. Pass framework="..." to override.Reads
OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL_NAME (and the standard PraisonAI key/config files) — same as the CLI.Async variant for FastAPI / Jupyter
arun() offloads the synchronous work to a thread so it never blocks the event loop.
Optional parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_file | str | required | Path to your agents.yaml. |
framework | str | None | None (auto-detect) | One of "crewai", "praisonai", "autogen", "ag2". |
tools | list | None | None | Optional list of tool callables passed through to AgentsGenerator. |
agent_yaml | str | None | None | Inline YAML string; takes precedence over agent_file when both are given. |
cli_config | dict | None | None | Advanced: override the resolved CLI config (rarely needed). |
If no framework is installed,
run() raises RuntimeError("No supported framework installed. Install one of: crewai, praisonaiagents, autogen, ag2."). Install one with pip install praisonaiagents (recommended for new projects).When to use PraisonAI(...) instead
Reach for the full PraisonAI class (Option 1 below) when you need:
- Streaming / approval-system integration
- Custom backends or the gradio UI
- The
auto="..."natural-language-to-YAML mode - Repeated runs against the same generator without re-parsing YAML
Option 1: Using RAW YAML
Option 2: Using separate agents.yaml file
Note: Please create agents.yaml file before hand. If you only need to run anagents.yaml once and want zero ceremony, see Option 0: One-liner above.
Other options
Logging in scripts
If you want PraisonAI to configure your application’s logging, callconfigure_cli_logging() once at startup:
configure_cli_logging — only namespaced praisonai.* loggers will be used.
