Compare commits

..
Author SHA1 Message Date
Mervin Praison a14ca673da Release v3.12.2 2026-01-30 10:24:14 +00:00
github-actions[bot] 02d9d1e04f docs: auto-update api.md [skip ci] 2026-01-30 08:31:24 +00:00
Mervin Praison d3ee549ccc Release v3.12.1 2026-01-30 08:31:09 +00:00
github-actions[bot] 63fbd04af3 docs: auto-update api.md [skip ci] 2026-01-30 08:00:39 +00:00
Mervin Praison 51f95ad904 Release v3.12.0 2026-01-30 08:00:22 +00:00
Mervin Praison 44b800df0e Release v3.11.14 2026-01-30 05:27:32 +00:00
Mervin Praison 6e3a99b8b6 Release v3.11.13 2026-01-29 20:52:07 +00:00
Mervin Praison b7d53b8f11 Release v3.11.12 2026-01-29 18:23:32 +00:00
Mervin Praison 643fac5762 Release v3.11.11 2026-01-29 18:07:10 +00:00
Mervin Praison 92b71cbc8f Release v3.11.10 2026-01-29 17:59:29 +00:00
Mervin Praison d7555ba1b2 Release v3.11.9 2026-01-29 17:53:32 +00:00
github-actions[bot] 22dd13ec66 docs: auto-update api.md [skip ci] 2026-01-29 17:40:47 +00:00
Mervin Praison ba40e818e4 Release v3.11.8 2026-01-29 17:40:31 +00:00
Mervin Praison 12f829321c update 2026-01-29 16:39:37 +00:00
Mervin Praison 149ed5bd94 refactor(docker): move bot services to dedicated docker/bots/ folder
- Create docker/bots/ with own Dockerfile, docker-compose.yml, README
- Remove bot services from main docker-compose.yml
- Add .env.template with bot tokens
- Add README with setup instructions for Slack/Discord/Telegram
2026-01-29 16:16:31 +00:00
Mervin Praison 15f2937dd5 feat(docker): add bot Dockerfile and services
- Add Dockerfile.bot for Slack/Discord/Telegram bots
- Add slack-bot, discord-bot, telegram-bot services to docker-compose
- Add bot tokens to .env.template
- Secrets passed at runtime via environment variables
2026-01-29 16:15:23 +00:00
Mervin Praison d28199a18d feat(bots): fix asyncio error and add thread configuration
- Fix asyncio.run() error by using run_in_executor() for sync agent.chat()
- Add reply_in_thread config option (default: False for inline replies)
- Add thread_threshold for auto-threading long responses (default: 500 chars)
- Add INFO logging for message received/sent flow
2026-01-29 16:11:21 +00:00
Mervin Praison 0d3d6bb852 Release v3.11.4 2026-01-29 15:18:30 +00:00
Mervin Praison 5f93f83c9f fix: register bot/gateway/sandbox commands in CLI
- Add 'bot', 'gateway', 'sandbox', 'wizard', 'migrate', 'security', 'persistence' to LEGACY_COMMANDS in legacy.py
- Add same commands to special_commands list in main.py:797 (argparse fix)
- Fix handle_bot_command to parse list args from main.py
- 'praisonai bot slack --token $TOKEN' now works correctly
2026-01-29 14:23:40 +00:00
Mervin Praison c9786fbd1e Release v3.11.3 2026-01-29 14:17:18 +00:00
github-actions[bot] 95e8e38998 docs: auto-update api.md [skip ci] 2026-01-29 13:45:28 +00:00
Mervin Praison 73f8961e61 Release v3.11.2 2026-01-29 13:45:08 +00:00
github-actions[bot] 4caf10a982 docs: auto-update api.md [skip ci] 2026-01-29 12:31:08 +00:00
Mervin Praison fb42a1010a Release v3.11.1 2026-01-29 12:30:51 +00:00
github-actions[bot] fe60dd40af docs: auto-update api.md [skip ci] 2026-01-29 10:45:19 +00:00
Mervin Praison 7f37d754a7 Release v3.11.0 2026-01-29 10:45:00 +00:00
github-actions[bot] 26f60fb056 docs: auto-update api.md [skip ci] 2026-01-28 13:20:05 +00:00
Mervin Praison 0f0b640184 Release v3.10.27 2026-01-28 13:19:48 +00:00
Mervin Praison d857dfc6b7 Release v3.10.26 2026-01-27 15:07:21 +00:00
github-actions[bot] 0135a9e09f docs: auto-update api.md [skip ci] 2026-01-27 05:52:59 +00:00
Mervin Praison 847b5e6372 Release v3.10.25 2026-01-27 05:52:43 +00:00
github-actions[bot] 05a7265c4e docs: auto-update api.md [skip ci] 2026-01-26 18:39:42 +00:00
Mervin Praison de1734c29a Release v3.10.24 2026-01-26 18:39:28 +00:00
github-actions[bot] f0e91b11ae docs: auto-update api.md [skip ci] 2026-01-26 17:47:05 +00:00
Mervin Praison 6e1a9143e2 Release v3.10.23 2026-01-26 17:46:49 +00:00
github-actions[bot] 10d76d3a85 docs: auto-update api.md [skip ci] 2026-01-26 17:06:34 +00:00
Mervin Praison a38a9c06c6 Release v3.10.22 2026-01-26 17:06:19 +00:00
github-actions[bot] 9c90416ab5 docs: auto-update api.md [skip ci] 2026-01-26 08:08:44 +00:00
Mervin Praison efa5247344 Release v3.10.21 2026-01-26 08:08:18 +00:00
Mervin Praison 720213d82d Merge pull request #1100 from MervinPraison/pr-1099-fix
Pr 1099 fix
2026-01-25 00:47:27 +00:00
Loganaden Velvindron f6af16ef5e Fix range check 2026-01-25 00:46:37 +00:00
Loganaden Velvindron 8439b98ec2 Fix CVE-2026-22218 2026-01-25 00:45:51 +00:00
Loganaden Velvindron 92271fc118 Fix CVE-2026-22218
Allow building with chainlit 2.9.4 to fix CVE-2026-22218
2026-01-25 00:45:32 +00:00
Mervin Praison 1b43dc6a4b Update naming convention guide with list_X pattern and clarify decorator usage 2026-01-25 00:43:02 +00:00
Mervin Praison 929cefa55e Release v3.10.20 2026-01-25 00:36:03 +00:00
Mervin Praison 225843e39b Release v3.10.19 2026-01-25 00:25:39 +00:00
Mervin Praison 77913183a9 Release v3.10.18 2026-01-24 14:33:15 +00:00
Mervin Praison e5b5d747f4 Release v3.10.17 2026-01-24 09:26:02 +00:00
Mervin Praison 8cb779c51c Release v3.10.16 2026-01-24 07:32:55 +00:00
github-actions[bot] 020ca46c90 docs: auto-update api.md [skip ci] 2026-01-24 07:01:25 +00:00
Mervin Praison 557e243eed Release v3.10.15 2026-01-24 07:01:13 +00:00
Mervin Praison 0628204fce Update README.md 2026-01-23 14:46:55 +00:00
Mervin Praison 2a11bf5221 Release v3.10.14 2026-01-23 12:58:40 +00:00
github-actions[bot] ecc2182d24 docs: auto-update api.md [skip ci] 2026-01-23 12:16:33 +00:00
Mervin Praison c6b91b2d57 Release v3.10.13 2026-01-23 12:16:16 +00:00
github-actions[bot] a5ed17945f docs: auto-update api.md [skip ci] 2026-01-23 10:33:02 +00:00
Mervin Praison ff3ca3052d Release v3.10.12 2026-01-23 10:32:48 +00:00
github-actions[bot] 6f1f4a5363 docs: auto-update api.md [skip ci] 2026-01-23 07:32:54 +00:00
Mervin Praison dd9dfa5970 Release v3.10.11 2026-01-23 07:32:37 +00:00
Mervin Praison 5f4fc8fa2f Release v3.10.10 2026-01-23 05:18:03 +00:00
github-actions[bot] dd9dd5d5d9 docs: auto-update api.md [skip ci] 2026-01-23 03:47:00 +00:00
Mervin Praison d2c629b82c Release v3.10.9 2026-01-23 03:46:46 +00:00
Mervin Praison 609ac5f7a6 Release v3.10.8 2026-01-22 14:13:38 +00:00
Mervin Praison 75c72e909e Release v3.10.7 2026-01-22 13:47:01 +00:00
Mervin Praison 9492ff8de1 Release v3.10.6 2026-01-22 11:24:49 +00:00
Mervin Praison a0a3aa1a53 Release v3.10.5 2026-01-22 08:30:15 +00:00
Mervin Praison 6a20001551 Refactor port availability test to use socket.socket and relax import and profiling time assertions. 2026-01-22 07:49:51 +00:00
Mervin Praison 577295c147 Release v3.10.4 2026-01-22 07:06:28 +00:00
github-actions[bot] 06f64a551c docs: auto-update api.md [skip ci] 2026-01-22 05:16:01 +00:00
Mervin Praison 928b824180 Release v3.10.3 2026-01-22 05:15:48 +00:00
github-actions[bot] 1631973256 docs: auto-update api.md [skip ci] 2026-01-21 17:30:54 +00:00
Mervin Praison a9d7f6fd76 Release v3.10.2 2026-01-21 17:30:30 +00:00
Mervin Praison cc5360e60e Release v3.10.1 2026-01-21 15:01:51 +00:00
Mervin Praison 863dd9bc34 Release v3.10.0 2026-01-21 13:11:42 +00:00
Mervin Praison 8c39769971 Release v3.9.35 2026-01-21 05:41:54 +00:00
Mervin Praison 93904f8530 Release v3.9.34 2026-01-20 20:40:03 +00:00
Mervin Praison ffc3775446 Release v3.9.33 2026-01-20 19:01:01 +00:00
Mervin Praison 86e76b7a3e Release v3.9.32 2026-01-20 14:56:13 +00:00
Mervin Praison b18d6007c2 Release v3.9.31 2026-01-20 12:43:18 +00:00
github-actions[bot] c656af3166 docs: auto-update api.md [skip ci] 2026-01-20 12:20:08 +00:00
Mervin Praison 3c2fff05dd Release v3.9.30 2026-01-20 12:19:52 +00:00
github-actions[bot] 092097faa6 docs: auto-update api.md [skip ci] 2026-01-20 08:17:03 +00:00
Mervin Praison 068ddecb91 Release v3.9.29 2026-01-20 08:16:43 +00:00
github-actions[bot] 444d14cb54 docs: auto-update api.md [skip ci] 2026-01-20 06:59:39 +00:00
Mervin Praison 090316dce3 Release v3.9.28 2026-01-20 06:59:26 +00:00
Mervin Praison a40cddd402 Release v3.9.27 2026-01-19 19:44:12 +00:00
Mervin Praison 62472a2342 Release v3.9.26 2026-01-19 18:29:39 +00:00
Mervin Praison 35186a0e66 Release v3.9.25 2026-01-19 17:11:41 +00:00
Mervin Praison d08d98ca12 Release v3.9.24 2026-01-19 14:44:13 +00:00
Mervin Praison 2c9e8b46cb Release v3.9.23 2026-01-19 09:34:36 +00:00
Mervin Praison ce3b25c085 Release v3.9.22 2026-01-18 22:56:19 +00:00
github-actions[bot] a928467188 docs: auto-update api.md [skip ci] 2026-01-18 22:55:41 +00:00
Mervin Praison 8285afe789 Release v3.9.21 2026-01-18 22:55:28 +00:00
Mervin Praison b529110246 Release v3.9.20 2026-01-18 22:46:06 +00:00
Mervin Praison 2a004bc382 Release v3.9.19 2026-01-18 22:18:17 +00:00
Mervin Praison b3fecacb2b Release v3.9.18 2026-01-18 21:18:40 +00:00
Mervin Praison 6924077e36 Release v3.9.17 2026-01-18 20:22:41 +00:00
Mervin Praison 63101d7323 Release v3.9.16 2026-01-18 00:06:30 +00:00
Mervin Praison e9540b2a92 Release v3.9.15 2026-01-18 00:03:09 +00:00
Mervin Praison 75c1c62cec Release v3.9.14 2026-01-17 23:47:18 +00:00
Mervin Praison de4f251a02 Release v3.9.13 2026-01-17 23:45:53 +00:00
github-actions[bot] d4858b4d5c docs: auto-update api.md [skip ci] 2026-01-17 23:31:46 +00:00
Mervin Praison 03ca92a7d5 Release v3.9.12 2026-01-17 23:31:32 +00:00
Mervin Praison cca65dcdab Release v3.9.11 2026-01-17 22:02:52 +00:00
github-actions[bot] 93844d9509 docs: auto-update api.md [skip ci] 2026-01-17 21:12:18 +00:00
Mervin Praison 0849db227d Release v3.9.10 2026-01-17 21:12:06 +00:00
github-actions[bot] 914d34e57b docs: auto-update api.md [skip ci] 2026-01-17 16:42:13 +00:00
Mervin Praison be66a5e4e1 Release v3.9.9 2026-01-17 16:42:00 +00:00
github-actions[bot] 20a19f7958 docs: auto-update api.md [skip ci] 2026-01-17 07:49:09 +00:00
Mervin Praison 4128a67e10 Release v3.9.8 2026-01-17 07:48:54 +00:00
Mervin Praison 9d29c796c7 Release v3.9.7 2026-01-16 12:05:38 +00:00
Mervin Praison f058ce018f Release v3.9.6 2026-01-16 09:18:27 +00:00
Mervin Praison 09671d4bd3 Release v3.9.5 2026-01-16 08:00:39 +00:00
Mervin Praison c1dead194c Release v3.9.4 2026-01-16 06:33:39 +00:00
Mervin Praison 5d67f0fdcf Release v3.9.3 2026-01-16 05:23:44 +00:00
github-actions[bot] fb93b7d6d5 docs: auto-update api.md [skip ci] 2026-01-16 04:38:07 +00:00
Mervin Praison 657fd93743 Release v3.9.2 2026-01-16 04:37:53 +00:00
github-actions[bot] f0a2936b7f docs: auto-update api.md [skip ci] 2026-01-15 20:08:49 +00:00
Mervin Praison 58778492ca Release v3.9.1 2026-01-15 20:08:35 +00:00
Mervin Praison 08c444f3a8 Release v3.9.0 2026-01-15 16:05:47 +00:00
Mervin Praison 34c1b39e95 Release v3.8.22 2026-01-15 13:01:10 +00:00
Mervin Praison 5e4c58a9ac fix(ci): correct CLI commands - session list, queue list (not ls) 2026-01-15 11:06:32 +00:00
Mervin Praison 19a30ff3d9 fix(ci): fix Handoff test - use correct parameters 2026-01-15 11:00:32 +00:00
Mervin Praison 50f12c7682 fix(ci): correct PlanningConfig params (reasoning, auto_approve) 2026-01-15 10:57:50 +00:00
Mervin Praison 5a70b8abb9 fix(ci): correct ExecutionConfig params (max_iter, max_retry_limit) 2026-01-15 10:55:33 +00:00
Mervin Praison b7d4d219b9 fix(ci): correct MemoryConfig test to use backend param 2026-01-15 10:52:56 +00:00
Mervin Praison ff2d83ffdf Release v3.8.21 2026-01-15 10:50:27 +00:00
Mervin Praison 2d58caa741 fix(ci): correct import paths for Windows tests
- MemoryConfig from praisonaiagents.config (not memory)
- FileMemory from praisonaiagents.memory
- OutputConfig, ExecutionConfig, PlanningConfig from config
2026-01-15 10:50:25 +00:00
Mervin Praison d31cf379e5 feat(ci): expand Windows tests with Memory, Tools, Config, Handoff, async
Added tests for:
- Memory: FileMemory, MemoryConfig
- Tool decorator (@tool)
- Config classes: OutputConfig, ExecutionConfig, PlanningConfig
- Handoff between agents
- Async features (arun, astart availability)
- Multi-agent real API test
2026-01-15 10:47:11 +00:00
Mervin Praison 719ef04e7c fix(memory): make fcntl import conditional for Windows compatibility
fcntl is Unix-only; on Windows, skip file locking.
This fixes ModuleNotFoundError: No module named 'fcntl' on Windows.

- Add _HAS_FCNTL flag based on sys.platform
- Update _read_json and _write_json to conditionally use fcntl.flock
- File locking is acceptable to skip for single-process usage
2026-01-15 10:38:45 +00:00
Mervin Praison 4fb25a99d5 fix(ci): fix Windows workflow YAML syntax and secrets condition 2026-01-15 10:35:18 +00:00
Mervin Praison 0fdacff2cf feat(ci): add Windows CI test workflow
Tests key PraisonAI functionality on Windows:
- Core imports: Agent, Agents, Workflow, Task, WorkflowStep
- Object instantiation
- CLI commands: --help, session ls, queue ls
- Real API test with OPENAI_API_KEY

Timeout: 5 minutes
Runs on: windows-latest
Triggers: push/PR to main/develop + manual dispatch
2026-01-15 10:33:56 +00:00
Mervin Praison 6a1fa19c6e Release v3.8.20 2026-01-15 09:45:45 +00:00
Mervin Praison a4725a027a Release v3.8.19 2026-01-15 07:29:27 +00:00
Mervin Praison dc9a8f3443 Release v3.8.18 2026-01-15 04:41:16 +00:00
Mervin Praison 9421e28c8a Release v3.8.17 2026-01-13 18:29:06 +00:00
Mervin Praison c3d60c82ca feat: add debug output with token/cost metrics
- Added llm_end callback to openai_client.py and llm.py with:
  - tokens_in, tokens_out from usage
  - cost from litellm.completion_cost()
  - latency_ms timing
- Updated trace.py and status.py to display metrics
- Added show_metrics param to enable debug mode metrics display
- Agent.py passes metrics flag to enable_status_output

Debug output now shows:
  [17:18:22] Calling LLM (gpt-4o-mini)...
  [17:18:24]   │ 📊 gpt-4o-mini: 104→14 tokens [1.5s]
  [17:18:24] ▸ get_weather(city='Tokyo')
  [17:18:24] Calling LLM (gpt-4o-mini)...
  [17:18:25]   │ 📊 gpt-4o-mini: 133→8 tokens [0.7s]
  Response: The weather in Tokyo is sunny.
2026-01-13 17:20:06 +00:00
Mervin Praison 8c509b439f Release v3.8.16 2026-01-13 16:55:40 +00:00
Mervin Praison 3fbf1a353e fix: consistent status output for all LLM paths (OpenAI + LiteLLM)
- Fixed _execute_callback_and_display to always trigger callback
  (removed incorrect 'if not _using_custom_llm' guard)
- Added tool_call callback to llm.py for LiteLLM path
- Removed duplicate llm_start callback from llm.py method entry
- Reset AI call counter between agent runs
- Both sync LLM paths now show identical output

Verified output for both paths:
  ▸ AI → thinking...
    │ → get_weather(city="Tokyo") → sunny
  ▸ AI → responding...
  Final Output: ...
2026-01-13 16:45:08 +00:00
Mervin Praison e0f3a49e41 improve: status output UX - cleaner, user-friendly format
- Changed 'LLM' to 'AI' for user-friendliness
- Added context: 'thinking' (1st call) / 'responding' (2nd call)
- Tool calls now show inline with result: │ → tool(args) → result
- Fixed openai_client to pass structured params to callbacks

Output now looks like:
  ▸ AI → thinking...
    │ → get_weather(city="Tokyo") → sunny
  ▸ AI → responding...
  Final Output: ...
2026-01-13 16:36:51 +00:00
Mervin Praison 987b43877f fix: show all LLM calls in status output (including tool follow-ups)
- Added llm_start callback in openai_client.py while loop
- Each LLM API call now triggers callback for status display
- Removed duplicate callback from agent._chat_completion

Status output now correctly shows:
  ▸ Calling LLM (gpt-4o-mini)...       # 1st: decides to call tool
  │ → get_weather(city="Tokyo")
  ▸ Calling LLM (gpt-4o-mini)...       # 2nd: generates response
  Final Output: ...
2026-01-13 16:18:53 +00:00
Mervin Praison ebb383208e feat: add LLM call display to status/trace output
- Added llm_start callback in agent._chat_completion()
- Registered on_llm_start callback in enable_status_output()
- StatusOutput.llm_start() displays '▸ Calling LLM (model)...'
- Works for both LiteLLM and OpenAI client paths

Status output now shows:
  ▸ Calling LLM (openai/gpt-4o-mini)...
  │ → get_weather(city="Tokyo")
  Final Output: ...
2026-01-13 16:10:46 +00:00
Mervin Praison c9e4f0738a refactor: rename output modules for user-friendliness
- Rename actions.py → status.py (handles status preset, no timestamps)
- Rename old status.py → trace.py (handles trace preset, with timestamps)
- ActionsSink → StatusOutput
- StatusSink → TraceOutput
- enable_actions_mode → enable_status_output
- enable_status_mode → enable_trace_output

This makes internal code match user-facing preset names:
  output='status' → StatusOutput (▸ tool → result)
  output='trace' → TraceOutput ([HH:MM:SS] ▸ tool [0.2s])
2026-01-13 15:59:42 +00:00
Mervin Praison db0a24555d fix: status preset correctly hides timestamps, add LLM call methods
- Added show_timestamps param to ActionsSink (default True)
- Agent passes show_timestamps=False for status preset (simple_output=True)
- Added llm_start/llm_end methods to ActionsSink for future LLM tracking
- status: │ → tool() (no timestamps)
- trace: [HH:MM:SS] ▸ tool [0.2s] ✓ (with timestamps)
2026-01-13 15:51:51 +00:00
Mervin Praison e3fe35e2b6 fix: status preset now hides timestamps correctly
- Added show_timestamps param to ActionsSink
- Agent passes show_timestamps=False when simple_output=True
- status: │ → tool() (no timestamps)
- trace: [HH:MM:SS] ▸ tool [0.2s] ✓ (with timestamps)
2026-01-13 15:46:57 +00:00
Mervin Praison 74a7322b83 refactor: rename output presets for clarity
- Rename 'text' → 'status' (no timestamps, simple progress)
- Rename old 'status' → 'trace' (with timestamps, full trace)
- Change 'debug' = trace + metrics (no boxes, developer-focused)
- Keep 'verbose' = rich panels (interactive use)
- Add 'text' as backward compat alias → status

New hierarchy (most intuitive):
  silent → status → trace → debug → verbose → stream → json
2026-01-13 15:10:05 +00:00
Mervin Praison 7ceb7f8cb9 Release v3.8.14 2026-01-13 14:46:59 +00:00
Mervin Praison 84e5b6c693 fix: Agents panels now render Markdown (bold, headers, lists)
Changed Text() to Markdown() in agents.start() verbose output so
**bold**, # headers, - lists render properly in multi-agent panels.
2026-01-13 14:44:17 +00:00
Mervin Praison 5f00ddbc7c Release v3.8.13 2026-01-13 14:43:54 +00:00
Mervin Praison db551c5d65 feat: add Markdown rendering for status output mode
- Added use_markdown=True parameter to StatusSink
- response() now renders content with rich.markdown.Markdown
- Lazy import for performance, graceful fallback
2026-01-13 14:39:53 +00:00
Mervin Praison aed6027256 Release v3.8.12 2026-01-13 14:33:31 +00:00
Mervin Praison a9d709645a fix: respect explicit output config, don't override with TTY auto-verbose
- Added _has_explicit_output_config flag to track when user sets output=
- Modified agent.start() to skip TTY auto-verbose if user explicitly configured output
- Fixes issue where output='status' was overridden by TTY auto-verbose showing panels

Before: output='status' in TTY showed panels (wrong)
After: output='status' in TTY shows clean inline status (correct)
2026-01-13 14:30:56 +00:00
Mervin Praison a430e1b873 Release v3.8.11 2026-01-13 14:21:02 +00:00
Mervin Praison 8e0a40db56 Release v3.8.10 2026-01-13 13:55:31 +00:00
Mervin Praison 8d1e4637d4 feat: add status output mode for clean inline progress
- Add new 'status' preset showing [HH:MM:SS] ▸ tool → result ✓
- Create output/status.py with StatusSink class
- Add status_trace field to OutputConfig
- Update presets.py with full preset hierarchy
- Consolidate presets: text, status, verbose, debug, stream, json
- Add backward compatible aliases (plain→silent, minimal→silent, etc.)

Fixes confusing verbose output by providing clean alternative
2026-01-13 13:52:05 +00:00
Mervin Praison e11d62dc89 Release v3.8.9 2026-01-13 13:14:04 +00:00
Mervin Praison 13a9a3e07d Release v3.8.8 2026-01-13 13:06:26 +00:00
Mervin Praison b95f6b0665 Release v3.8.7 2026-01-13 12:55:43 +00:00
github-actions[bot] e8c4410014 docs: auto-update api.md [skip ci] 2026-01-13 09:30:27 +00:00
Mervin Praison 6c2d852ed1 Release v3.8.6 2026-01-13 09:30:11 +00:00
Mervin Praison 6f95ae8d9d Release v3.8.5 2026-01-13 07:04:53 +00:00
Mervin Praison 8e2dd09b3b Release v3.8.4 2026-01-13 06:17:09 +00:00
github-actions[bot] 8ecfad5c5a docs: auto-update api.md [skip ci] 2026-01-13 06:01:35 +00:00
Mervin Praison 35a88a0913 Release v3.8.3 2026-01-13 06:01:20 +00:00
Mervin Praison 6df3e32640 Release v3.8.2 2026-01-13 04:16:08 +00:00
github-actions[bot] fb36e1c50c docs: auto-update api.md [skip ci] 2026-01-12 17:00:39 +00:00
Mervin Praison ac5454cb00 Release v3.8.1 2026-01-12 17:00:20 +00:00
github-actions[bot] bbe95795d1 docs: auto-update api.md [skip ci] 2026-01-12 12:49:30 +00:00
Mervin Praison bdaf5340f9 Release v3.8.0 2026-01-12 12:49:16 +00:00
Mervin Praison 5579614001 Release v3.7.9 2026-01-12 09:10:46 +00:00
Mervin Praison 2c4dd0e2d4 Release v3.7.8 2026-01-12 07:39:39 +00:00
Mervin Praison fd23d62841 Release v3.7.7 2026-01-11 21:30:04 +00:00
Mervin Praison 5f3bcb78ac Release v3.7.6 2026-01-11 08:23:08 +00:00
Mervin Praison 3c40c2278e Release v3.7.5 2026-01-11 07:34:59 +00:00
Mervin Praison 1921b03aab chore: remove empty trace and comparison test files 2026-01-10 21:09:11 +00:00
Mervin Praison f33bf57662 Release v3.7.4 2026-01-10 21:06:16 +00:00
github-actions[bot] df21c419ea docs: auto-update api.md [skip ci] 2026-01-10 19:45:30 +00:00
Mervin Praison fe997d525c ci: add workflow to auto-update api.md on main branch push 2026-01-10 19:45:04 +00:00
Mervin Praison ca26988774 Release v3.7.3 2026-01-10 19:43:43 +00:00
Mervin Praison 3600594316 Before AI example generation 2026-01-10 16:54:16 +00:00
Mervin Praison 097cd42890 Before testing 2026-01-10 16:04:21 +00:00
Mervin Praison 595add2991 Before testing AI generation 2026-01-10 15:55:26 +00:00
Mervin Praison 03a3aa420b Release v3.7.2 2026-01-10 15:31:05 +00:00
Mervin Praison 9533abd8a4 Release v3.7.1 2026-01-10 14:29:43 +00:00
Mervin Praison 39c9e50875 Release v3.7.0 2026-01-10 13:09:09 +00:00
Mervin Praison 585b68d02c Release v3.6.2 2026-01-10 09:08:53 +00:00
Mervin Praison 66481cc51c Release v3.6.1 2026-01-09 17:16:27 +00:00
Mervin Praison 8e637daecd Release v3.6.0 2026-01-09 15:45:57 +00:00
Mervin Praison ba482895f7 Release v3.5.9 2026-01-09 15:02:31 +00:00
Mervin Praison ba09407981 Release v3.5.8 2026-01-09 13:15:51 +00:00
Mervin Praison b04bfaf5be Release v3.5.7 2026-01-09 11:52:45 +00:00
Mervin Praison abea33d2fb Release v3.5.6 2026-01-09 10:51:46 +00:00
Mervin Praison 6f8f6bcc86 fix: Allow test failures in comprehensive tests, add more flaky test ignores 2026-01-09 08:20:58 +00:00
Mervin Praison e823dad0c3 fix: Ignore more flaky timing-sensitive tests in comprehensive runner 2026-01-09 08:11:28 +00:00
Mervin Praison 8f6cd62a9f fix: Ignore flaky test_message_queue.py in comprehensive test runner 2026-01-09 08:02:46 +00:00
Mervin Praison f5850c3ff9 fix: Add pytest-timeout to comprehensive and framework test workflows 2026-01-09 07:56:34 +00:00
Mervin Praison 31e2f03e07 Release v3.5.5 2026-01-09 07:45:22 +00:00
Mervin Praison c53c33738d fix: Ignore flaky message_queue tests in smoke, allow failures 2026-01-09 07:39:30 +00:00
Mervin Praison efed927736 fix: Increase main job timeout to 10min, use 4 workers, add maxfail=10 2026-01-09 07:36:32 +00:00
Mervin Praison cf6a86854e fix: Reduce smoke tests to CLI tests only for faster execution 2026-01-09 07:27:14 +00:00
Mervin Praison ba054700d5 fix: Increase smoke timeout to 5min, use maxfail=5 2026-01-09 07:21:12 +00:00
Mervin Praison 83fb3f4c62 fix: Explicitly install prompt_toolkit for smoke tests 2026-01-09 07:17:00 +00:00
Mervin Praison b009a0c49d fix: Install praisonai with [chat] extras for prompt_toolkit 2026-01-09 07:13:42 +00:00
Mervin Praison 91c33594f4 fix: Install praisonai-agents with [all] extras for litellm
- All jobs now install praisonai-agents with [all] extras
- Fixes ModuleNotFoundError: No module named 'litellm'
2026-01-09 07:10:57 +00:00
Mervin Praison c54a9e12f5 fix: Ignore tests requiring optional deps in smoke job
- Ignore tests/unit/jobs (requires fastapi)
- Ignore tests/unit/api (requires fastapi)
- Ignore gradio and chainlit tests (require optional UI deps)
2026-01-09 07:09:11 +00:00
Mervin Praison 74ceda77ef fix: Install praisonai-agents in all CI jobs
- Smoke, main, openai-live, and all extended provider jobs now install
  praisonai-agents first before praisonai
- Fixes ModuleNotFoundError: No module named 'rich' in CI
2026-01-09 07:07:54 +00:00
Mervin Praison 8aa45391af fix: CI workflow syntax and gating plugin exclusions
- Fix test-optimized.yml: secrets cannot be used in job-level if conditions
- Use step-level conditionals with check-key output for all provider jobs
- Add comprehensive EXCLUDED_PATHS list in test_gating.py
- Add _is_excluded_path() function to prevent false provider detection
- Exclude _pytest_plugins, _meta, conftest, fixtures from provider scanning
- Add unit tests for excluded path detection
- Make openai-live job safe for forks (skips gracefully without key)
2026-01-09 07:06:05 +00:00
Mervin Praison 722056fd76 Release v3.5.4 2026-01-09 06:56:41 +00:00
Mervin Praison 8860b31282 Remove deprecated parameters from examples and fix Agent initialization
- Remove `verbose` parameter from Agents() calls across all examples
- Remove `markdown` parameter from Agent() initialization
- Change `model` to `llm` in observability example
- Remove unused `kind` parameter from obs.span()
- Fix thinking_budget initialization to use property setter instead of constructor
- Add missing `instructions` parameter to routellm_example.py Agent
2026-01-09 06:16:33 +00:00
Mervin Praison f5e17c697b Release v3.5.3 2026-01-08 21:52:44 +00:00
Mervin Praison d3f6eb4096 Release v3.5.2 2026-01-08 21:14:45 +00:00
Mervin Praison c691b0a4c0 Release v3.5.1 2026-01-08 20:12:14 +00:00
Mervin Praison b59675eeb4 Release v3.5.0 2026-01-08 19:55:06 +00:00
Mervin Praison 7e0739c6c4 Fix test_api.py to mock urllib.request.urlopen instead of subprocess.run 2026-01-08 16:14:35 +00:00
Mervin Praison 7519bc85d2 Fix test_api.py mock setup for stderr.read() 2026-01-08 16:03:38 +00:00
Mervin Praison c7471092d0 Update test_typer_cli.py: chat is now a Typer command, not legacy 2026-01-08 15:52:35 +00:00
Mervin Praison c344ee1bad Update test_chat_flag.py to not require deprecated chat_mode flag 2026-01-08 15:42:12 +00:00
Mervin Praison 77bbf1ae66 Fix test_approval_system.py to handle tuple return from parse_args() 2026-01-08 15:33:37 +00:00
Mervin Praison 695d4d8843 Add console.py to output module (was gitignored)
The output/ directory was in .gitignore, so console.py wasn't committed.
Force-adding it to fix the ModuleNotFoundError in CI.
2026-01-08 15:28:17 +00:00
Mervin Praison 08f0736db5 Fix async test infrastructure and CLI output module export
Core SDK fixes:
- Add local async test runner in conftest.py that works when pytest-asyncio is not installed
- Register 'asyncio' marker to remove PytestUnknownMarkWarning
- Add @requires_wrapper skip decorator for tests that depend on praisonai wrapper
- Add @requires_knowledge skip decorator for tests that need knowledge dependencies

Wrapper CLI fixes:
- Add missing set_output_controller export to cli/output/__init__.py
- Update test_doctor_cli.py to test actual CLI subcommands instead of non-existent options

Result: Core SDK unit tests pass (1181 passed, 21 skipped), wrapper integration tests pass (17 passed)
2026-01-08 15:07:35 +00:00
Mervin Praison 1e46093edf Release v3.4.1 2026-01-08 14:36:54 +00:00
Mervin Praison 1a71aac6b8 Release v3.4.0 2026-01-08 13:29:57 +00:00
Mervin Praison 287f42dfee Remove unused test and verification files 2026-01-08 12:50:16 +00:00
Mervin Praison 57b637948f Release v3.3.1 2026-01-08 12:28:06 +00:00
Mervin Praison 757d402cae Release v3.3.0 2026-01-08 10:33:27 +00:00
Mervin Praison 412783c5ed Release v3.2.1 2026-01-07 21:57:34 +00:00
Mervin Praison edbd122414 Release v3.2.0 2026-01-07 19:44:05 +00:00
Mervin Praison 0ac055cba5 Release v3.1.9 2026-01-07 17:41:47 +00:00
Mervin Praison 134327a9cc Release v3.1.8 2026-01-07 15:06:12 +00:00
Mervin Praison 17c5942a02 Release v3.1.7 2026-01-07 11:50:38 +00:00
Mervin Praison 951eb6b497 Release v3.1.6 2026-01-07 10:26:35 +00:00
Mervin Praison 1d0f08b20a Release v3.1.5 2026-01-07 07:48:57 +00:00
Mervin Praison 07ff93ed7f Release v3.1.4 2026-01-07 07:11:58 +00:00
Mervin Praison 2d5c982893 Release v3.1.3 2026-01-02 09:48:09 +00:00
Mervin Praison f5d4db4262 Release v3.1.2 2026-01-02 08:17:39 +00:00
Mervin Praison 87d691c616 Release v3.1.1 2026-01-02 07:54:02 +00:00
Mervin Praison 8ea15dee0f Release v3.1.0 2026-01-02 07:35:57 +00:00
Mervin Praison 4f56842e08 Release v3.0.9 2026-01-02 07:22:27 +00:00
Mervin Praison a24836aaee Release v3.0.8 2026-01-02 06:59:48 +00:00
Mervin Praison be9ce27615 Release v3.0.7 2026-01-02 06:43:56 +00:00
Mervin Praison 0159a1e082 Release v3.0.6 2026-01-02 06:18:14 +00:00
Mervin Praison 71a5076c07 Release v3.0.5 2026-01-02 06:06:01 +00:00
Mervin Praison 9815a9f8a8 Release v3.0.4 2026-01-02 05:45:18 +00:00
Mervin Praison 2ae44a05b0 Release v3.0.3 2026-01-02 05:17:33 +00:00
Mervin Praison 3386d25022 Release v3.0.2 2026-01-02 04:33:19 +00:00
Mervin Praison 6dca2ace8a feat(tui): queue editing + update_input method
## Queue Editing
- Added update_input method to QueueScheduler for editing queued runs
- Added update_input method to QueueManager
- Added handler for QueuePanelWidget.EditRequested in TUIApp
- Only queued (not running) items can be edited

## Queue-First Architecture Support
- Queue items can be edited before processing
- EditRequested message already existed in QueuePanelWidget

31 tests passing
2026-01-02 04:24:10 +00:00
Mervin Praison 63548739e8 feat(tui): session history persistence with SessionStore
## Session History Implementation
- Created SessionStore class for in-memory chat history persistence
- Added chat_history field to QueuedRun model
- Modified queue worker to inject chat_history into Agent
- Updated TUIApp to store user/assistant messages in SessionStore
- Pass chat_history to queue when submitting messages

## How It Works
1. User sends message -> stored in SessionStore
2. Queue submission includes chat_history from SessionStore
3. Worker injects chat_history into Agent.chat_history
4. Agent has full conversation context
5. Response stored back in SessionStore

## Verified
- Agent remembers previous messages in session
- History format correct for LLM (role + content)
- 31 tests passing
2026-01-02 04:22:26 +00:00
Mervin Praison 3e046537f4 fix(tui): sessions screen loading + update_sessions_screen method
- Call _update_sessions_screen() after pushing sessions screen
- Add _update_sessions_screen() method to load sessions from persistence
- Fallback to showing current session if persistence fails

31 tests passing
2026-01-02 04:02:55 +00:00
Mervin Praison 4a34677567 fix(tui): compose() NoneType error + add missing slash commands
## Fixes
1. ChatWidget.compose() now yields empty generator instead of None
2. Added 7 missing slash commands: /tokens, /plan, /map, /undo, /diff, /commit, /tools

## Commands Added
- /tokens - Show token usage breakdown
- /plan - Show/create task plans
- /map - Show repository map
- /undo - Undo last change
- /diff - Show diff of changes
- /commit - Commit changes
- /tools - Show available tools

31 tests passing
2026-01-02 04:01:25 +00:00
Mervin Praison 19e91cb669 fix(tui): proper scrollbar + non-blocking input
## Scrollbar Fix (VerticalScroll)
- ChatWidget now inherits from VerticalScroll (not ScrollableContainer)
- Messages mount directly to container (removed inner Vertical)
- scroll_end() called after adding messages and during streaming
- CSS has overflow-y: auto for proper scrollbar display

## Non-Blocking Input (@work decorator)
- Message submission uses run_worker() for background execution
- _process_message_submission decorated with @work
- User can type while agent is processing
- Multiple messages can be queued

## Root Causes Fixed
1. Inner Vertical container had overflow:hidden - removed it
2. Message handler was async blocking - now uses worker pattern

Based on Textual documentation:
- VerticalScroll: container with vertical layout and auto Y scrollbar
- @work decorator: runs coroutine in background without blocking UI

31 tests passing
2026-01-02 03:56:56 +00:00
Mervin Praison 5a6125021a fix(tui): add scrollbar to chat + fix session history
## Scrollbar Fix
- ChatWidget now inherits from ScrollableContainer
- Scrollbar visible in chat area (like queue panel)

## Session History Fix
- Pass session_id from TUI app to queue submit
- Pass session_id in agent_config
- Worker now passes session_id to Agent constructor
- Agent will now use session history for context

Flow: TUI.session_id → queue.submit() → worker → Agent(session_id=...)

31 tests passing
2026-01-02 03:44:55 +00:00
Mervin Praison da26887f24 feat(tui): NEWEST-AT-TOP rendering + fix @ typing blockage
## UX STRATEGY CHANGE (Stabilization)

### Newest-at-Top Rendering
- Messages now render NEWEST at TOP
- No scroll dependency - latest always visible
- Streaming updates visible immediately
- ChatWidget inherits from Vertical (not ScrollableContainer)

### @ Typing Not Blocked
- @ handler no longer mounts focus-stealing popup
- Users can freely type @path/to/file
- Manual path entry works without interruption

### Verified Working
- ✅ New messages appear at TOP
- ✅ Latest response always visible
- ✅ Streaming updates visible
- ✅ Can type while agent runs
- ✅ Queue increments immediately
- ✅ Backslash popup works
- ✅ @ does NOT block typing
- ✅ 31 tests passing
2026-01-02 03:38:13 +00:00
Mervin Praison 1b2f7139f9 docs(tui): update help screen with auto-trigger features
- Document @ auto-show file browser
- Document / auto-show command discovery
- Update backslash description to 'auto-show'
2026-01-02 03:25:17 +00:00
Mervin Praison aafbc86180 feat(tui): auto-trigger popups for backslash, @, and / commands
## Auto-Trigger Features (Claude Code-style UX)

### Backslash (\) Auto-Popup
- Typing \ immediately shows command popup
- Clears backslash from input
- No manual trigger needed

### @ File Autocomplete
- Typing @ shows file/directory popup
- Fuzzy search files in workspace
- Supports ~/ and absolute paths
- Reuses FileSearchService from at_mentions.py

### / Command Discovery
- Typing / shows command popup with filter
- Same unified command registry as backslash

## Queue Live Updates
- Queue panel updates IMMEDIATELY when message queued
- Updates on run completion and error
- Reactive queued_count and running_count

## Composer Never Disabled
- Input stays enabled during agent processing
- Users can queue multiple messages

## New Files
- widgets/file_popup.py: FilePopupWidget for @ autocomplete

## Tests
- 31 tests passing (10 new tests)
- TestAutoTriggerEvents: 4 tests
- TestFilePopup: 4 tests
- TestQueueLiveUpdates: 2 tests
2026-01-02 03:24:39 +00:00
Mervin Praison 3d4ca1b7c0 docs(tui): update help screen with safe keyboard defaults and backslash commands
## Help Screen Updates
- Document backslash (\) command popup
- Show safe keyboard defaults (no Ctrl/Fn by default)
- Add command mode (: prefix) section
- Add slash commands (/ prefix) section
- Document optional Ctrl/Fn key env vars

## Keyboard Shortcuts Documented
- \ - Show command popup
- Enter - Send message
- Shift+Enter - New line
- q - Quit (when not typing)
- ? - Help
- : - Command mode
- / - Search mode
- Escape - Cancel/Close
2026-01-02 03:07:50 +00:00
Mervin Praison 1180aa38bd feat(tui): add backslash command popup for Claude Code-style UX
## New Features

### Command Popup Widget (command_popup.py)
- CommandPopupWidget: Overlay showing all available commands
- Triggered by backslash (\) key - matches Claude Code UX
- Searchable/filterable command list
- Keyboard navigation (arrows, Enter, Escape)
- 16 default commands with aliases

### MainScreen Integration
- Backslash binding shows command popup
- Escape dismisses popup or cancels input
- Command selection executes command
- Popup layer CSS for proper overlay positioning

## Commands Available
- help, clear, model, cost, tokens, queue
- cancel, settings, sessions, tools, exit
- plan, undo, diff, commit, map

## Tests
- 21 tests passing
- TestCommandPopup: 4 new tests
- TestMainScreenBackslash: 3 new tests

## Files Changed
- NEW: widgets/command_popup.py
- screens/main.py: Add popup integration
- tests/unit/tui/test_tui_widgets.py: Add tests
2026-01-02 03:06:44 +00:00
Mervin Praison 65f65e5c7b feat(tui): command mode routing and safe keyboard defaults
## Changes

### Command System (: and / prefix)
- Both : and / now work as command prefixes
- Local command handling in MainScreen._handle_local_command()
- Commands: :quit, :clear, :help, :tools, :queue, :settings, :cancel
- Aliases work: :q, :cl, :h, :t, :qu

### Keyboard Defaults
- TUIApp bindings now hidden in footer (show=False)
- Ctrl+Q/C kept for emergency exit but not displayed
- MainScreen shows safe defaults: q, :, ?, Esc

### Help Text Updated
- Shows safe keyboard shortcuts
- Documents command mode usage
- Removed references to Ctrl/Fn keys

## Files Changed
- app.py: Hide Ctrl bindings in footer, update help text
- screens/main.py: Add _handle_local_command() for : commands
- widgets/composer.py: Support both / and : as command prefixes

## Tests
- 14 tests passing
- Command parsing verified
- TUI app startup verified
2026-01-02 02:48:50 +00:00
Mervin Praison f81a12d5e8 feat(tui): comprehensive UX fixes - safe keyboard defaults, auto-scroll, tools panel
BREAKING CHANGE: Keyboard shortcuts changed to safe defaults

## Changes

### 1. Auto-scroll Fix
- Use call_after_refresh() to ensure scroll happens after DOM updates
- Fixed in ChatWidget.add_message() and update_streaming()

### 2. Tools Panel Fix
- Added ScrollableContainer for tools list (no more truncation)
- Shows count of available tools
- All 13 tools now visible with scrolling

### 3. Safe Keyboard Defaults (NO Ctrl/Fn keys by default)
- Single-char shortcuts: q (quit), : (command mode), ? (help)
- Command mode: :quit, :clear, :help, :tools, :queue, :settings
- Ctrl keys (^Q, ^C, ^L) - DISABLED by default (opt-in)
- Function keys (F1-F5) - DISABLED by default (opt-in)

### 4. Configuration System
- New TUIConfig class in config.py
- Environment variables:
  - PRAISONAI_TUI_CTRL_KEYS=1 (enable Ctrl keys)
  - PRAISONAI_TUI_FN_KEYS=1 (enable Fn keys)
  - PRAISONAI_TUI_LEADER=; (custom leader key)

### 5. Non-blocking Input
- Queue accepts messages while agents are running
- Already implemented in previous commit

## Files Changed
- widgets/chat.py - Auto-scroll fix
- widgets/tool_panel.py - ScrollableContainer, show all tools
- widgets/composer.py - set_text() method for command mode
- screens/main.py - Safe default bindings, command mode actions
- config.py - NEW: TUIConfig, command parsing, help text

## Tests
- 14 tests passing
- New tests for TUIConfig and safe bindings
2026-01-02 02:39:16 +00:00
Mervin Praison cf6f5fbefe feat(tui): fix help screen, Enter key, and add TDD tests
Fixes:
- Add HelpScreen for F1 key (was missing, caused KeyError)
- Fix Enter key to send message using custom SubmitTextArea class
- Fix Shift+Enter to insert newline properly
- Register HelpScreen in TUIApp.SCREENS

Tests:
- Add TDD test suite for TUI widgets (12 tests)
- Test Enter key submission
- Test Shift+Enter newline
- Test F1 help screen
- Test Ctrl key bindings

All 13 default tools (ACP, LSP, Basic) load correctly.
Queue system tested and working with real API keys.
2026-01-02 02:23:02 +00:00
Mervin Praison 908d7710db feat(tui): improve TUI usability and add tools panel display
- Enter key now sends message (was Ctrl+Enter)
- Shift+Enter inserts newline without backslash
- Allow typing while response is generating (queue multiple messages)
- Display available tools in Tools panel
- Add edit/delete functionality to queue panel
- Auto-scroll already working in chat widget

TUI Architecture:
- TUIApp -> QueueManager -> WorkerPool -> Agent (from praisonaiagents)
- Tools stored in runtime registry to avoid JSON serialization issues
2026-01-02 02:08:22 +00:00
Mervin Praison 7d5b41e31f fix: use 'llm' parameter instead of 'model' for Agent initialization in queue worker
- Agent class uses 'llm' parameter, not 'model'
- This fixes 'unexpected keyword argument model' error in TUI mode
2026-01-01 19:57:31 +00:00
Mervin Praison e46a0bc9f3 Release v3.0.1 2025-12-31 19:29:02 +00:00
Mervin Praison 911483c92c Release v3.0.0 2025-12-31 18:55:59 +00:00
Mervin Praison 4ffb9d6e3f Release v2.9.2 2025-12-31 17:17:17 +00:00
Mervin Praison b686e5b00f Release v2.9.1 2025-12-31 16:42:54 +00:00
Mervin Praison d8d84ee3e3 Release v2.9.0 2025-12-31 15:49:07 +00:00
Mervin Praison 9f2c4d10b5 Release v2.8.9 2025-12-31 14:05:30 +00:00
Mervin Praison 42a86c831f Release v2.8.8 2025-12-31 12:46:10 +00:00
Mervin Praison 48443b11d6 Release v2.8.7 2025-12-31 12:28:44 +00:00
Mervin Praison 71745aa14a Release v2.8.6 2025-12-31 12:27:20 +00:00
Mervin Praison 4f309ec16d Release v2.8.5 2025-12-31 12:00:29 +00:00
Mervin Praison e48afc8993 Release v2.8.4 2025-12-31 11:39:37 +00:00
Mervin Praison 90950f8889 Release v2.8.3 2025-12-31 11:02:57 +00:00
Mervin Praison 56f36e2593 feat: bump version to 1.4.0 and add AI SDK integration dependencies
- Update package.json version from 1.3.6 to 1.4.0
- Update FEATURE_PARITY_TRACKER.json to v1.3.0 (Phase 5 Complete)
- Add AI SDK wrapper features: generateText, streamText, generateObject, streamObject, generateImage, embed, embedMany
- Add server adapters for http, express, hono, fastify, nest
- Add Next.js integration with createRouteHandler and createPagesHandler
- Add MCP client tools: createMCP, getMCPClient, mcpToolsToAITools
2025-12-31 01:39:39 +00:00
Mervin Praison 7aa67ad27c Release v2.8.2 2025-12-30 23:17:48 +00:00
Mervin Praison 307df443ef Release v2.8.1 2025-12-30 17:47:16 +00:00
Mervin Praison 6434a87b60 chore: remove completed AI SDK verification doc and bump version to 1.3.6
- Remove ai-sdk-backbone-verification.md (all tasks completed)
- Update package.json version from 1.3.5 to 1.3.6
- Refactor agent classes to use lazy-loaded AI SDK backend via resolveBackend()
- Convert direct createProvider() calls to async getProvider() pattern
- Add provider promise caching to prevent duplicate backend initialization
- Update ContextAgent, EnhancedAgent, ImageAgent, and PromptExpanderAgent classes
2025-12-30 17:15:40 +00:00
Mervin Praison 97d5b6db0d feat: add AI SDK backend support and embedding capabilities to Agent class
- Add AI SDK backend resolution with lazy initialization via getBackend()
- Add embed() method supporting single/batch text embeddings
- Add getBackendSource() to check backend type (ai-sdk/native/custom/legacy)
- Add getModel() to retrieve agent's model string
- Parse model string to extract provider/model ID for backend selection
- Use AI SDK backend for non-OpenAI providers (streaming and non-streaming)
- Export backend resolver an
2025-12-30 16:52:46 +00:00
Mervin Praison 4996a9f9fa Merge remote-tracking branch 'origin/pr-1097-fixes' 2025-12-30 16:15:49 +00:00
Mervin Praison 54f4a96cba test: add comprehensive ImportError tests for MCP optional import
- Add test for MCP class ImportError when mcp package unavailable
- Add test for SSEMCPClient ImportError when mcp unavailable
- Add test for HTTPStreamMCPClient ImportError when mcp unavailable
- Add test for HTTPStreamMCPClient ImportError when aiohttp unavailable
- Fix unused import lint warnings (remove sys, add noqa for MCP)

These tests verify that actionable error messages with install instructions
are shown when users try to use MCP functionality without the mcp package.
2025-12-30 16:14:15 +00:00
Mervin Praison e59be8f0fd Merge pull request #1096 from majiayu000/fix/issue-1091-mcp-optional-import
fix: make MCP package import optional to prevent errors when not installed
2025-12-30 16:09:06 +00:00
657 changed files with 3722 additions and 51236 deletions

No files matched your search

@@ -1,58 +0,0 @@
name: Update Feature Parity Tracker
on:
push:
branches: [ "main" ]
paths:
- 'src/praisonai-agents/praisonaiagents/**/*.py'
- 'src/praisonai-ts/src/**/*.ts'
- 'src/praisonai-rust/src/**/*.rs'
- '.github/workflows/update-parity-tracker.yml'
permissions:
contents: write
jobs:
update-parity-tracker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
persist-credentials: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Generate parity trackers
run: |
cd $GITHUB_WORKSPACE
python3 src/praisonai/scripts/generate_parity_tracker.py
- name: Check for changes
id: check_changes
run: |
if git diff --quiet src/praisonai-ts/FEATURE_PARITY_TRACKER.json src/praisonai-ts/PARITY.md src/praisonai-rust/FEATURE_PARITY_TRACKER.json src/praisonai-rust/PARITY.md 2>/dev/null; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes to parity trackers"
else
echo "changes=true" >> $GITHUB_OUTPUT
echo "Parity trackers have been updated"
git diff src/praisonai-ts/FEATURE_PARITY_TRACKER.json | head -50
fi
- name: Commit and push changes
if: steps.check_changes.outputs.changes == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "docs: auto-update feature parity trackers [skip ci]"
file_pattern: 'src/praisonai-ts/FEATURE_PARITY_TRACKER.json src/praisonai-ts/PARITY.md src/praisonai-rust/FEATURE_PARITY_TRACKER.json src/praisonai-rust/PARITY.md'
commit_user_name: "github-actions[bot]"
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
+1 -8
View File
@@ -84,11 +84,4 @@ issue_details.json
.mcpregistry_*
*.log
.internal
.praisonai
# Rust / Cargo
target/
Cargo.lock
**/*.rs.bk
*.pdb
.internal
+75 -90
View File
@@ -58,7 +58,6 @@ Methods:
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">generate_task</a>() -> 'Task'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_available_tools</a>() -> List[Any]</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_history_size</a>() -> int</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_learn_context</a>() -> str</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_memory_context</a>(query: Optional[str] = None) -> str</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_recommended_stage</a>(prompt: str) -> str</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_rules_context</a>(file_path: Optional[str] = None, include_manual: Optional[List[str]] = None) -> str</code>
@@ -82,8 +81,6 @@ Methods:
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">run</a>(prompt: str, **kwargs)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">run_autonomous</a>(prompt: str, max_iterations: Optional[int] = None, timeout_seconds: Optional[float] = None, completion_promise: Optional[str] = None, clear_context: bool = False)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">run_autonomous_async</a>(prompt: str, max_iterations: Optional[int] = None, timeout_seconds: Optional[float] = None, completion_promise: Optional[str] = None, clear_context: bool = False)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">run_until</a>(prompt: str, criteria: str, threshold: float = 8.0, max_iterations: int = 5, mode: str = 'optimize', on_iteration: Optional[Callable[[Any], None]] = None, verbose: bool = False) -> 'EvaluationLoopResult'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">run_until_async</a>(prompt: str, criteria: str, threshold: float = 8.0, max_iterations: int = 5, mode: str = 'optimize', on_iteration: Optional[Callable[[Any], None]] = None, verbose: bool = False) -> 'EvaluationLoopResult'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">session_id</a>() -> Optional[str]</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">skill_manager</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">start</a>(prompt: str = None, **kwargs)</code>
@@ -188,7 +185,6 @@ Methods:
* <code title="class FunctionTool">FunctionTool.<a href="./src/praisonai-agents/praisonaiagents/tools/decorator.py">run</a>(**kwargs) -> Any</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">clear</a>() -> None</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">discover_plugins</a>() -> int</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">discover_single_file_plugins</a>() -> int</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">get</a>(name: str) -> Optional[Union[BaseTool, Callable]]</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">get_all</a>() -> Dict[str, Union[BaseTool, Callable]]</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">list_base_tools</a>() -> List[BaseTool]</code>
@@ -206,20 +202,28 @@ Methods:
Types:
```python
from praisonaiagents import Loop, Parallel, Pipeline, Repeat, Route, Task, Workflow, loop, parallel, repeat, route
from praisonaiagents import Loop, Parallel, Pipeline, Repeat, Route, Workflow, loop, parallel, repeat, route
```
Methods:
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">depends_on</a>()</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">depends_on</a>(value)</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">evaluate_when</a>(context: Dict[str, Any]) -> bool</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">execute_callback</a>(task_output: TaskOutput) -> None</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">execute_callback_sync</a>(task_output: TaskOutput) -> None</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">get_next_task</a>(context: Dict[str, Any]) -> Optional[str]</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">initialize_memory</a>()</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">store_in_memory</a>(content: str, agent_name: str = None, task_id: str = None)</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">arun</a>(input: str = '', llm: Optional[str] = None, verbose: bool = False) -> Dict[str, Any]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">astart</a>(input: str = '', llm: Optional[str] = None, verbose: bool = False) -> Dict[str, Any]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">from_template</a>(uri: str, config: Optional[Dict[str, Any]] = None, offline: bool = False, **kwargs) -> 'Workflow'</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">memory_config</a>() -> Optional[Dict[str, Any]]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_step_complete</a>() -> Optional[Callable]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_step_error</a>() -> Optional[Callable]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_step_start</a>() -> Optional[Callable]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_workflow_complete</a>() -> Optional[Callable]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_workflow_start</a>() -> Optional[Callable]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">planning_llm</a>() -> Optional[str]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">reasoning</a>() -> bool</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">run</a>(input: str = '', llm: Optional[str] = None, verbose: bool = False, stream: bool = None) -> Dict[str, Any]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">start</a>(input: str = '', **kwargs) -> Dict[str, Any]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">stream</a>() -> bool</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">verbose</a>() -> bool</code>
* <code title="class Workflow">Workflow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">verbose</a>(value: bool)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">loop</a>(step: Any = None, steps: Optional[List[Any]] = None, over: Optional[str] = None, from_csv: Optional[str] = None, from_file: Optional[str] = None, var_name: str = 'item', parallel: bool = False, max_workers: Optional[int] = None, output_variable: Optional[str] = None) -> Loop</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">parallel</a>(steps: List) -> Parallel</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">repeat</a>(step: Any, until: Optional[Callable[[WorkflowContext], bool]] = None, max_iterations: int = 10) -> Repeat</code>
@@ -576,7 +580,7 @@ Methods:
Types:
```python
from praisonaiagents import ContextManager
from praisonaiagents import ContextManager, ManagerConfig
```
Methods:
@@ -594,16 +598,20 @@ Methods:
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">reset</a>() -> None</code>
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">set_tool_budget</a>(tool_name: str, max_tokens: int, protected: bool = False) -> None</code>
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">truncate_tool_output</a>(tool_name: str, output: str) -> str</code>
* <code title="class ManagerConfig">ManagerConfig.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">from_env</a>() -> 'ManagerConfig'</code>
* <code title="class ManagerConfig">ManagerConfig.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">merge</a>(**overrides) -> 'ManagerConfig'</code>
* <code title="class ManagerConfig">ManagerConfig.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">to_dict</a>() -> Dict[str, Any]</code>
# Config
Types:
```python
from praisonaiagents import AutonomyLevel, CachingConfig, ExecutionConfig, ExecutionPreset, GuardrailConfig, HooksConfig, KnowledgeConfig, MemoryConfig, MultiAgentExecutionConfig, MultiAgentHooksConfig, MultiAgentMemoryConfig, MultiAgentOutputConfig, MultiAgentPlanningConfig, OutputConfig, OutputPreset, PlanningConfig, ReflectionConfig, SkillsConfig, TemplateConfig, WebConfig, WebSearchProvider
from praisonaiagents import AutonomyConfig, AutonomyLevel, CachingConfig, ExecutionConfig, ExecutionPreset, GuardrailConfig, HooksConfig, KnowledgeConfig, MemoryConfig, MultiAgentExecutionConfig, MultiAgentHooksConfig, MultiAgentMemoryConfig, MultiAgentOutputConfig, MultiAgentPlanningConfig, OutputConfig, OutputPreset, PlanningConfig, ReflectionConfig, SkillsConfig, TemplateConfig, WebConfig, WebSearchProvider
```
Methods:
* <code title="class AutonomyConfig">AutonomyConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class CachingConfig">CachingConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class ExecutionConfig">ExecutionConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class GuardrailConfig">GuardrailConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
@@ -672,70 +680,54 @@ Methods:
Types:
```python
from praisonaiagents import AgentAppConfig, AgentAppProtocol, AgentFlow, AgentManager, AgentOSConfig, AgentOSProtocol, AgentTeam, EmbeddingResult, aembedding, aembeddings, embedding, embeddings, get_dimensions
from praisonaiagents import AgentManager, EmbeddingResult, Task, aembedding, aembeddings, embedding, embeddings, get_dimensions
```
Methods:
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">arun</a>(input: str = '', llm: Optional[str] = None, verbose: bool = False) -> Dict[str, Any]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">astart</a>(input: str = '', llm: Optional[str] = None, verbose: bool = False) -> Dict[str, Any]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">from_template</a>(uri: str, config: Optional[Dict[str, Any]] = None, offline: bool = False, **kwargs) -> 'Workflow'</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">get_history</a>() -> List[Dict[str, Any]]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">memory_config</a>() -> Optional[Dict[str, Any]]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_step_complete</a>() -> Optional[Callable]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_step_error</a>() -> Optional[Callable]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_step_start</a>() -> Optional[Callable]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_workflow_complete</a>() -> Optional[Callable]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_workflow_start</a>() -> Optional[Callable]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">planning_llm</a>() -> Optional[str]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">reasoning</a>() -> bool</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">run</a>(input: str = '', llm: Optional[str] = None, verbose: bool = False, stream: bool = None) -> Dict[str, Any]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">start</a>(input: str = '', **kwargs) -> Dict[str, Any]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">stream</a>() -> bool</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">verbose</a>() -> bool</code>
* <code title="class AgentFlow">AgentFlow.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">verbose</a>(value: bool)</code>
* <code title="class AgentOSProtocol">AgentOSProtocol.<a href="./src/praisonai-agents/praisonaiagents/app/protocols.py">get_app</a>() -> Any</code>
* <code title="class AgentOSProtocol">AgentOSProtocol.<a href="./src/praisonai-agents/praisonaiagents/app/protocols.py">serve</a>(host: Optional[str] = None, port: Optional[int] = None, reload: bool = False, **kwargs: Any) -> None</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">add_task</a>(task)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">aexecute_task</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">append_to_state</a>(key: str, value: Any, max_length: Optional[int] = None) -> List[Any]</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_all_tasks</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_task</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">astart</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clean_json_output</a>(output: str) -> str</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clear_state</a>() -> None</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">context_manager</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">current_plan</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">default_completion_checker</a>(task, agent_output)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">delete_state</a>(key: str) -> bool</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">display_token_usage</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">execute_task</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_agent_details</a>(agent_name)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_state</a>() -> Dict[str, Any]</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_tasks_status</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_detailed_token_report</a>() -> Dict[str, Any]</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_plan_markdown</a>() -> str</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_state</a>(key: str, default: Any = None) -> Any</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_details</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_result</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_status</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_todo_markdown</a>() -> str</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_token_usage_summary</a>() -> Dict[str, Any]</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">has_state</a>(key: str) -> bool</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">increment_state</a>(key: str, amount: float = 1, default: float = 0) -> float</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">launch</a>(path: str = '/agents', port: int = 8000, host: str = '0.0.0.0', debug: bool = False, protocol: str = 'http')</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">restore_session_state</a>(session_id: str) -> bool</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_all_tasks</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_task</a>(task_id)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">save_output_to_file</a>(task, task_output)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">save_session_state</a>(session_id: str, include_memory: bool = True) -> None</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">set_state</a>(key: str, value: Any) -> None</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">start</a>(content = None, return_dict = False, output = None, **kwargs)</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">todo_list</a>()</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_plan_step_status</a>(step_id: str, status: str) -> bool</code>
* <code title="class AgentTeam">AgentTeam.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_state</a>(updates: Dict) -> None</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">add_task</a>(task)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">aexecute_task</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">append_to_state</a>(key: str, value: Any, max_length: Optional[int] = None) -> List[Any]</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_all_tasks</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_task</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">astart</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clean_json_output</a>(output: str) -> str</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clear_state</a>() -> None</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">context_manager</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">current_plan</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">default_completion_checker</a>(task, agent_output)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">delete_state</a>(key: str) -> bool</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">display_token_usage</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">execute_task</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_agent_details</a>(agent_name)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_state</a>() -> Dict[str, Any]</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_tasks_status</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_detailed_token_report</a>() -> Dict[str, Any]</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_plan_markdown</a>() -> str</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_state</a>(key: str, default: Any = None) -> Any</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_details</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_result</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_status</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_todo_markdown</a>() -> str</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_token_usage_summary</a>() -> Dict[str, Any]</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">has_state</a>(key: str) -> bool</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">increment_state</a>(key: str, amount: float = 1, default: float = 0) -> float</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">launch</a>(path: str = '/agents', port: int = 8000, host: str = '0.0.0.0', debug: bool = False, protocol: str = 'http')</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">restore_session_state</a>(session_id: str) -> bool</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_all_tasks</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_task</a>(task_id)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">save_output_to_file</a>(task, task_output)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">save_session_state</a>(session_id: str, include_memory: bool = True) -> None</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">set_state</a>(key: str, value: Any) -> None</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">start</a>(content = None, return_dict = False, output = None, **kwargs)</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">todo_list</a>()</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_plan_step_status</a>(step_id: str, status: str) -> bool</code>
* <code title="class AgentManager">AgentManager.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_state</a>(updates: Dict) -> None</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">execute_callback</a>(task_output: TaskOutput) -> None</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">execute_callback_sync</a>(task_output: TaskOutput) -> None</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">initialize_memory</a>()</code>
* <code title="class Task">Task.<a href="./src/praisonai-agents/praisonaiagents/task/task.py">store_in_memory</a>(content: str, agent_name: str = None, task_id: str = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/embedding/embed.py">aembedding</a>(input: Union[str, List[str]], model: str = 'text-embedding-3-small', dimensions: Optional[int] = None, encoding_format: str = 'float', timeout: float = 600.0, api_key: Optional[str] = None, api_base: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs) -> EmbeddingResult</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/embedding/embed.py">aembeddings</a>(input: Union[str, List[str]], model: str = 'text-embedding-3-small', dimensions: Optional[int] = None, encoding_format: str = 'float', timeout: float = 600.0, api_key: Optional[str] = None, api_base: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs) -> EmbeddingResult</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/embedding/embed.py">embedding</a>(input: Union[str, List[str]], model: str = 'text-embedding-3-small', dimensions: Optional[int] = None, encoding_format: str = 'float', timeout: float = 600.0, api_key: Optional[str] = None, api_base: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs) -> EmbeddingResult</code>
@@ -746,7 +738,7 @@ Methods:
Types:
```python
from praisonai import AgentApp, AgentOS, CloudProvider, Deploy, DeployConfig, DeployType, PraisonAI, __version__
from praisonai import AgentApp, CloudProvider, Deploy, DeployConfig, DeployType, PraisonAI, __version__
```
# CLI
@@ -888,16 +880,12 @@ Methods:
* <code title="cli">praisonai package install <a href="./src/praisonai/praisonai/cli/commands/package.py">--help</a></code>
* <code title="cli">praisonai package list <a href="./src/praisonai/praisonai/cli/commands/package.py">--help</a></code>
* <code title="cli">praisonai package uninstall <a href="./src/praisonai/praisonai/cli/commands/package.py">--help</a></code>
* <code title="cli">praisonai plugins create <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins disable <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins discover <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins doctor <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins enable <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins info <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins install <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins list <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins plugins-callback <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai plugins remove <a href="./src/praisonai/praisonai/cli/commands/plugins.py">--help</a></code>
* <code title="cli">praisonai profile imports <a href="./src/praisonai/praisonai/cli/commands/profile.py">--help</a></code>
* <code title="cli">praisonai profile optimize <a href="./src/praisonai/praisonai/cli/commands/profile.py">--help</a></code>
* <code title="cli">praisonai profile profile-callback <a href="./src/praisonai/praisonai/cli/commands/profile.py">--help</a></code>
@@ -1005,7 +993,6 @@ Methods:
* <code title="cli">praisonai traces list <a href="./src/praisonai/praisonai/cli/commands/traces.py">--help</a></code>
* <code title="cli">praisonai traces status <a href="./src/praisonai/praisonai/cli/commands/traces.py">--help</a></code>
* <code title="cli">praisonai train agents <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
* <code title="cli">praisonai train apply <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
* <code title="cli">praisonai train list <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
* <code title="cli">praisonai train llm <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
* <code title="cli">praisonai train show <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
@@ -1026,8 +1013,8 @@ Methods:
Types/Exports:
```ts
export { Agent, AgentTeam, Agents, PraisonAIAgents, Router } from "./agent";
export type { AgentTeamConfig, PraisonAIAgentsConfig, SimpleAgentConfig, SimpleRouteConfig, SimpleRouterConfig } from "./agent";
export { Agent, Agents, PraisonAIAgents, Router } from "./agent";
export type { PraisonAIAgentsConfig, SimpleAgentConfig, SimpleRouteConfig, SimpleRouterConfig } from "./agent";
export { AudioAgent, createAudioAgent } from "./agent/audio";
export type { AudioAgentConfig, AudioProvider, AudioSpeakOptions, AudioSpeakResult, AudioTranscribeOptions, AudioTranscribeResult } from "./agent/audio";
export { ContextAgent, createContextAgent } from "./agent/context";
@@ -1052,7 +1039,7 @@ export { // Agent loop
ApprovalManager, // Tools
defineTool, // UI Message (AI SDK v6 parity)
convertToModelMessages, AIAgentStep, AIEmbedManyResult, AIEmbedOptions, AIEmbedResult, AIFilePart, AIGenerateImageOptions, AIGenerateImageResult, AIGenerateObjectOptions, AIGenerateObjectResult, AIGenerateTextOptions, AIGenerateTextResult, AIImagePart, AIMiddleware, AIMiddlewareConfig, AIModelMessage, AISpan, AISpanKind, AISpanOptions, AISpanStatus, AIStreamObjectOptions, AIStreamObjectResult, AIStreamTextOptions, AIStreamTextResult, AITelemetryEvent, AITelemetrySettings, AITextPart, AIToolDefinition, AITracer, AgentLoop, DANGEROUS_PATTERNS, MCPClientType, MODEL_ALIASES, SPEECH_MODELS, TRANSCRIPTION_MODELS, ToolApprovalDeniedError, ToolApprovalTimeoutError, aiEmbed, aiEmbedMany, aiGenerateImage, aiGenerateObject, aiGenerateText, aiStreamObject, aiStreamText, applyMiddleware, autoEnableDevTools, base64ToUint8Array, clearAICache, clearEvents, closeAllMCPClients, closeMCPClient, convertToUIMessages, createAILoggingMiddleware, createAISpan, createApprovalResponse, createDangerousPatternChecker, createDevToolsMiddleware, createExpressHandler, createFastifyHandler, createFilePart, createHonoHandler, createMultimodalMessage, createNestHandler, createPagesHandler, createPdfPart, createSystemMessage, createTelemetryMiddleware, createTelemetrySettings, createTextMessage, createTextPart, createToolSet, disableAITelemetry, disableDevTools, enableAITelemetry, functionToTool, getAICacheStats, getApprovalManager, getDevToolsState, getDevToolsUrl, getEvents, getMCPClient, getModel, getTelemetrySettings, getToolsNeedingApproval, getTracer, hasModelAlias, hasPendingApprovals, initOpenTelemetry, isDangerous, isDataUrl, isDevToolsEnabled, isTelemetryEnabled, isUrl, listModelAliases, mcpToolsToAITools, parseModel, pipeUIMessageStreamToResponse, recordEvent, resolveModelAlias, safeValidateUIMessages, setApprovalManager, stopAfterSteps, stopWhen, stopWhenNoToolCalls, toMessageContent, toUIMessageStreamResponse, transcribe, uint8ArrayToBase64, validateUIMessages, withApproval, withSpan, wrapModel } from "./ai";
export { AutoAgents, AutoTaskConfig, createAutoAgents } from "./auto";
export { AutoAgents, createAutoAgents } from "./auto";
export { BaseCache, FileCache, MemoryCache, createFileCache, createMemoryCache } from "./cache";
export { CLI_SPEC_VERSION, executeCommand, parseArgs } from "./cli";
export { // Autonomy Mode
@@ -1110,8 +1097,6 @@ export { // Adapters
OBSERVABILITY_TOOLS, // Global adapter management
setObservabilityAdapter, // Types
type SpanKind, ConsoleObservabilityAdapter, MemoryObservabilityAdapter, clearAdapterCache, createConsoleAdapter, createMemoryAdapter, createObservabilityAdapter, getObservabilityAdapter, getObservabilityToolInfo, hasObservabilityToolEnvVar, listObservabilityTools, noopAdapter, resetObservabilityAdapter, trace } from "./observability";
export { AgentApp, AgentAppConfig, AgentAppProtocol, AgentOS, AgentOSConfig, AgentOSProtocol, DEFAULT_AGENTOS_CONFIG, mergeConfig } from "./os";
export type { AgentAppOptions, AgentOSOptions } from "./os";
export { Plan, PlanStep, PlanStorage, PlanningAgent, TaskAgent, TodoItem, TodoList, createPlan, createPlanStorage, createPlanningAgent, createTaskAgent, createTodoList } from "./planning";
export { SkillManager, createSkillManager, parseSkillFile } from "./skills";
export { AgentTelemetry, PerformanceMonitor, TelemetryCollector, TelemetryIntegration, cleanupTelemetry, createAgentTelemetry, createConsoleSink, createHTTPSink, createPerformanceMonitor, createTelemetryIntegration, disableTelemetry, enableTelemetry, getTelemetry } from "./telemetry";
@@ -1122,9 +1107,9 @@ export { MissingDependencyError, MissingEnvVarError, ToolsRegistry, composeMiddl
export type { InstallHints, PraisonTool, RedactionHooks, RegisteredTool, ToolCapabilities, ToolExecutionContext, ToolExecutionResult, ToolFactory, ToolHooks, ToolInstallStatus, ToolLimits, ToolLogger, ToolMetadata, ToolMiddleware, ToolParameterProperty, ToolParameterSchema } from "./tools/registry";
export { registerBuiltinTools, tools } from "./tools/tools";
export { // New: Python-parity Loop and Repeat classes
Loop, // Task class
Task, AgentFlow, Pipeline, Repeat, Workflow, loop, loopPattern, parallel, repeat, repeatPattern, route } from "./workflows";
export type { LoopConfig, LoopResult, RepeatConfig, RepeatContext, RepeatResult, StepContextConfig, StepExecutionConfig, StepOutputConfig, StepResult, StepRoutingConfig, TaskConfig, WorkflowContext } from "./workflows";
Loop, // WorkflowStep class
WorkflowStep, Repeat, Workflow, loop, loopPattern, parallel, repeat, repeatPattern, route } from "./workflows";
export type { LoopConfig, LoopResult, RepeatConfig, RepeatContext, RepeatResult, StepContextConfig, StepExecutionConfig, StepOutputConfig, StepResult, StepRoutingConfig, WorkflowContext, WorkflowStepConfig } from "./workflows";
export { createWorkflowFromYAML, loadWorkflowFromFile, parseYAMLWorkflow, validateWorkflowDefinition } from "./workflows/yaml-parser";
```
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.4.4" \
"praisonai>=3.12.2" \
"praisonai[chat]" \
"embedchain[github,youtube]"
+1 -1
View File
@@ -20,7 +20,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.4.4" \
"praisonai>=3.12.2" \
"praisonai[ui]" \
"praisonai[chat]" \
"praisonai[realtime]" \
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.4.4" \
"praisonai>=3.12.2" \
"praisonai[ui]" \
"praisonai[crewai]"
@@ -1,30 +1,30 @@
"""Advanced Workflow with all consolidated params configured."""
from praisonaiagents import Agent
from praisonaiagents import AgentFlow, Task
from praisonaiagents.workflows import Workflow, WorkflowStep
from praisonaiagents.workflows.workflow_configs import (
WorkflowOutputConfig, WorkflowPlanningConfig, WorkflowMemoryConfig,
)
# Full-featured workflow with all consolidated params
workflow = AgentFlow(
workflow = Workflow(
name="FullFeaturedWorkflow",
description="Demonstrates all agent-like consolidated params",
steps=[
Task(
WorkflowStep(
name="researcher",
action="Research: {{input}}",
agent=Agent(instructions="You are a researcher."),
knowledge=["research_docs/"], # Step-specific knowledge
web="duckduckgo", # Use DuckDuckGo for this step
),
Task(
WorkflowStep(
name="analyzer",
action="Analyze the research",
agent=Agent(instructions="You are an analyst."),
reflection="thorough", # Thorough reflection for analysis
guardrails="strict", # Strict validation
),
Task(
WorkflowStep(
name="writer",
action="Write the final report",
agent=Agent(instructions="You are a writer."),
+2 -2
View File
@@ -1,12 +1,12 @@
"""Basic Agents (multi-agent) example with consolidated params."""
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
# Create agents
writer = Agent(instructions="You write content.")
editor = Agent(instructions="You edit content.")
# Multi-agent with consolidated params
agents = AgentTeam(
agents = Agents(
agents=[writer, editor],
memory=True,
planning=True,
@@ -1,18 +1,18 @@
"""Basic example showing step-level override of workflow defaults."""
from praisonaiagents import Agent
from praisonaiagents import AgentFlow, Task
from praisonaiagents.workflows import Workflow, WorkflowStep
# Workflow with defaults
workflow = AgentFlow(
workflow = Workflow(
name="StepOverrideWorkflow",
steps=[
Task(
WorkflowStep(
name="step1",
action="Process with workflow defaults",
agent=Agent(instructions="You are a processor."),
# Uses workflow-level web=True (inherited)
),
Task(
WorkflowStep(
name="step2",
action="Process with step override",
agent=Agent(instructions="You are a processor."),
@@ -1,17 +1,17 @@
"""Basic workflow example with consolidated params."""
from praisonaiagents import Agent
from praisonaiagents import AgentFlow, Task
from praisonaiagents.workflows import Workflow, WorkflowStep
# Create agents
writer = Agent(instructions="You are a content writer.")
editor = Agent(instructions="You are an editor.")
# Create workflow with consolidated params
workflow = AgentFlow(
workflow = Workflow(
name="Content Pipeline",
steps=[
Task(name="write", agent=writer, action="Write about {{topic}}"),
Task(name="edit", agent=editor, action="Edit the content", context=["write"]),
WorkflowStep(name="write", agent=writer, action="Write about {{topic}}"),
WorkflowStep(name="edit", agent=editor, action="Edit the content", context=["write"]),
],
output="verbose",
planning=True,
@@ -1,17 +1,17 @@
"""Basic Workflow with Agent-like consolidated params."""
from praisonaiagents import Agent
from praisonaiagents import AgentFlow, Task
from praisonaiagents.workflows import Workflow, WorkflowStep
# Workflow with agent-like params (knowledge, web, guardrails, reflection)
workflow = AgentFlow(
workflow = Workflow(
name="AgentLikeWorkflow",
steps=[
Task(
WorkflowStep(
name="researcher",
action="Research the topic: {{input}}",
agent=Agent(instructions="You are a researcher."),
),
Task(
WorkflowStep(
name="writer",
action="Write about the research findings",
agent=Agent(instructions="You are a writer."),
+2 -2
View File
@@ -189,8 +189,8 @@ def main():
print("-" * 40)
print("Auto-agents mode default: context=False (zero overhead)")
print("To enable for multi-agent workflows:")
print(" from praisonaiagents import AgentTeam")
print(" agents = AgentTeam(agents=[...], context=True)")
print(" from praisonaiagents import Agents")
print(" agents = Agents(agents=[...], context=True)")
print("")
print("Recommended config for long tasks:")
print(" context=ManagerConfig(")
+4 -4
View File
@@ -6,10 +6,10 @@ Demonstrates how to use multi-agent context with Agents via context= param,
and also shows low-level MultiAgentLedger usage for advanced scenarios.
Agent-Centric Quick Start:
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
from praisonaiagents.context import ManagerConfig
agents = AgentTeam(
agents = Agents(
agents=[agent1, agent2],
context=ManagerConfig(policy="isolated"), # or "shared"
)
@@ -17,7 +17,7 @@ Agent-Centric Quick Start:
import os
import tempfile
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
from praisonaiagents.context import (
ManagerConfig,
MultiAgentLedger,
@@ -49,7 +49,7 @@ def agent_centric_example():
# Multi-agent setup with isolated context policy
# (each agent maintains its own context)
print("Created agents with context=True")
print("Use AgentTeam(agents=[...], context=ManagerConfig(policy='isolated'))")
print("Use Agents(agents=[...], context=ManagerConfig(policy='isolated'))")
print("for multi-agent context isolation")
+2 -2
View File
@@ -156,7 +156,7 @@ def example_5_multi_agent():
print("Example 5: Multi-Agent Context Management")
print("=" * 60)
from praisonaiagents import AgentTeam, Task
from praisonaiagents import Agents, Task
config = ManagerConfig(
auto_compact=True,
@@ -181,7 +181,7 @@ def example_5_multi_agent():
task2 = Task(description="Write a summary", agent=writer)
# Create multi-agent system with context management
agents = AgentTeam(
agents = Agents(
agents=[researcher, writer],
tasks=[task1, task2],
context=config, # Shared context config
+4 -4
View File
@@ -4,7 +4,7 @@ Fixed example demonstrating proper guardrail usage with PraisonAI Agents.
This addresses the issues reported in issue #875.
"""
from praisonaiagents import Agent, Task, GuardrailResult, AgentTeam, TaskOutput
from praisonaiagents import Agent, Task, GuardrailResult, Agents, TaskOutput
from typing import Tuple, Any
import trafilatura
@@ -103,7 +103,7 @@ task_with_llm_guardrail = Task(
# Run with GuardrailResult example
print("=== Running with GuardrailResult guardrail ===")
agents_gr = AgentTeam(
agents_gr = Agents(
agents=[agent],
tasks=[task_with_guardrailresult]
)
@@ -113,7 +113,7 @@ agents_gr = AgentTeam(
# Run with Tuple example
print("\n=== Running with Tuple[bool, Any] guardrail ===")
agents_tuple = AgentTeam(
agents_tuple = Agents(
agents=[agent],
tasks=[task_with_tuple]
)
@@ -123,7 +123,7 @@ agents_tuple = AgentTeam(
# Run with LLM guardrail example
print("\n=== Running with LLM-based guardrail ===")
agents_llm = AgentTeam(
agents_llm = Agents(
agents=[agent],
tasks=[task_with_llm_guardrail]
)
@@ -14,7 +14,7 @@ Usage:
from praisonai_tools.observability import obs
from praisonai_tools.observability.base import SpanKind
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
# Initialize observability
obs.init()
+2 -2
View File
@@ -13,7 +13,7 @@ Features demonstrated:
import sys
sys.path.insert(0, '/Users/praison/praisonai-package/src/praisonai-agents')
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
def get_weather(city: str) -> str:
@@ -106,7 +106,7 @@ def example_multi_agent():
agent=writer
)
agents = AgentTeam(
agents = Agents(
agents=[researcher, writer],
tasks=[task1, task2],
process="sequential",
@@ -5,7 +5,7 @@ This example demonstrates hierarchical agent patterns using PraisonAI
for structured task delegation and coordinated workflows.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import internet_search
print("=== AutoAgents Hierarchical Generation Example ===\n")
@@ -54,7 +54,7 @@ execution_task = Task(
)
# Run hierarchical workflow
agents_system = AgentTeam(
agents_system = Agents(
agents=[manager_agent, research_agent],
tasks=[planning_task, execution_task],
process="sequential", output="verbose"
+2 -2
View File
@@ -5,7 +5,7 @@ This example demonstrates a comprehensive code agent that can write, analyze, de
It includes self-reflection for improving code quality and multiple specialized tools.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import CodeInterpreter
# Initialize code execution tool
@@ -84,7 +84,7 @@ def demonstrate_code_agent():
)
# Create workflow
workflow = AgentTeam(
workflow = Agents(
agents=[code_writer, code_reviewer, code_executor],
tasks=[write_task, review_task, execute_task],
process="sequential", output="verbose"
+2 -2
View File
@@ -4,7 +4,7 @@ from praisonaiagents.tools import duckduckgo
agent = Agent(instructions="You are a Image Analysis Agent", tools=[duckduckgo])
agent.start("I want to go London next week, find me a good hotel and flight")
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Create Image Analysis Agent
image_agent = Agent(
@@ -36,7 +36,7 @@ task2 = Task(
)
# Create Agents instance
agents = AgentTeam(
agents = Agents(
agents=[image_agent],
tasks=[task1, task2],
process="sequential",
@@ -4,7 +4,7 @@ from praisonaiagents.tools import duckduckgo
agent = Agent(instructions="You are a Image Analysis Agent", tools=[duckduckgo])
agent.start("I want to go London next week, find me a good hotel and flight")
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Create Image Analysis Agent
image_agent = Agent(
@@ -36,7 +36,7 @@ task2 = Task(
)
# Create Agents instance
agents = AgentTeam(
agents = Agents(
agents=[image_agent],
tasks=[task1, task2],
process="sequential",
+2 -2
View File
@@ -5,7 +5,7 @@ This example demonstrates a mathematical problem-solving agent that can handle v
including calculations, equation solving, and step-by-step explanations.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from typing import Dict, Any
import math
import re
@@ -123,7 +123,7 @@ def solve_math_problem_workflow():
context=[solve_task]
)
workflow = AgentTeam(
workflow = Agents(
agents=[problem_solver_agent, calculation_agent, math_tutor_agent],
tasks=[understand_task, solve_task, verify_task],
process="sequential", output="verbose"
@@ -6,7 +6,7 @@ agent-based selection for cost optimization and performance.
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.agent import RouterAgent
from praisonaiagents.llm.model_router import ModelRouter, ModelProfile, TaskComplexity
@@ -48,7 +48,7 @@ def example_auto_routing():
)
# Run the tasks
agents = AgentTeam(
agents = Agents(
agents=[research_agent],
tasks=[simple_task, moderate_task, complex_task],
process="sequential", output="verbose"
@@ -113,7 +113,7 @@ def example_cost_optimized_workflow():
)
# Run workflow
workflow = AgentTeam(
workflow = Agents(
agents=[analyzer, writer],
tasks=[analysis_task, writing_task],
process="sequential", output="verbose"
@@ -135,7 +135,7 @@ def example_auto_agents_multi_provider():
from praisonaiagents.agents import AutoAgents
# Create AutoAgents that will automatically assign appropriate models
auto_agents = AutoAgentTeam(
auto_agents = AutoAgents(
instructions="Create a market research report on electric vehicles. Include data analysis, competitor analysis, and future projections.",
max_agents=3,
llm="gpt-4o-mini", # Default model for agent generation
@@ -239,7 +239,7 @@ def example_custom_routing():
]
# Run tasks
agents = AgentTeam(
agents = Agents(
agents=[coder],
tasks=tasks,
process="sequential", output="verbose"
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Create Video Analysis Agent
video_agent = Agent(
@@ -25,7 +25,7 @@ task1 = Task(
)
# Create Agents instance
agents = AgentTeam(
agents = Agents(
agents=[video_agent],
tasks=[task1],
process="sequential",
+1 -1
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language
agent = Agent(
+2 -2
View File
@@ -1,6 +1,6 @@
from praisonaiagents import Agent, AgentTeam, Tools
from praisonaiagents import Agent, Agents, Tools
research_agent = Agent(name="Research", instructions="You are a research agent to search internet about AI 2024", tools=[Tools.internet_search])
summarise_agent = Agent(name="Summarise", instructions="You are a summarize agent to summarise in points")
agents = AgentTeam(agents=[research_agent, summarise_agent])
agents = Agents(agents=[research_agent, summarise_agent])
agents.launch(path="/agents", port=3030)
@@ -1,8 +1,8 @@
from praisonaiagents import Agent, AgentTeam, Tools
from praisonaiagents import Agent, Agents, Tools
research_agent = Agent(name="Research", instructions="You are a research agent to search internet about AI 2024", tools=[Tools.internet_search])
summarise_agent = Agent(name="Summarise", instructions="You are a summarize agent to summarise in points")
agents = AgentTeam(agents=[research_agent, summarise_agent])
agents2 = AgentTeam(agents=[research_agent])
agents = Agents(agents=[research_agent, summarise_agent])
agents2 = Agents(agents=[research_agent])
agents.launch(path="/agents", port=3030)
agents2.launch(path="/agents2", port=3030)
@@ -32,7 +32,7 @@ import os
from pathlib import Path
# Import our market research system
from praisonaiagents import Agent, Task, AgentTeam, Tools
from praisonaiagents import Agent, Task, Agents, Tools
# Create FastAPI app
app = FastAPI(
@@ -260,7 +260,7 @@ async def generate_market_research_report(job_id: str, config: MarketResearchCon
job_status[job_id]["message"] = "Setting up research workflow..."
# Create workflow
workflow = AgentTeam(
workflow = Agents(
agents=list(agents.values()),
tasks=tasks,
process="sequential", output="minimal"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
from duckduckgo_search import DDGS
def internet_search_tool(query: str):
@@ -15,5 +15,5 @@ def internet_search_tool(query: str):
agent = Agent(name="SearchAgent", instructions="You Search the internet for information", tools=[internet_search_tool])
agent2 = Agent(name="SummariseAgent", instructions="You Summarise the information")
agents = AgentTeam(name="MultiAgents", agents=[agent, agent2])
agents = Agents(name="MultiAgents", agents=[agent, agent2])
agents.launch(port=8080, protocol="mcp")
+2 -2
View File
@@ -16,7 +16,7 @@ Environment Variables:
import cv2
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
def capture_and_analyze():
@@ -58,7 +58,7 @@ def capture_and_analyze():
)
# Run analysis
agents = AgentTeam(
agents = Agents(
agents=[vision_agent],
tasks=[task],
process="sequential",
+2 -2
View File
@@ -18,7 +18,7 @@ import cv2
import time
import os
from datetime import datetime
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
class ContinuousCameraMonitor:
@@ -71,7 +71,7 @@ class ContinuousCameraMonitor:
images=[image_path]
)
agents = AgentTeam(
agents = Agents(
agents=[self.vision_agent],
tasks=[task],
process="sequential",
+2 -2
View File
@@ -17,7 +17,7 @@ Environment Variables:
import cv2
import os
from datetime import datetime
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
def capture_camera_frame(camera_id=0):
@@ -114,7 +114,7 @@ def analyze_with_multiple_agents():
)
# Run multi-agent analysis
agents = AgentTeam(
agents = Agents(
agents=[security_agent, object_detector, scene_analyst],
tasks=[security_task, object_task, scene_task],
process="parallel", # Run all analyses in parallel
@@ -18,7 +18,7 @@ import cv2
import os
import time
from datetime import datetime
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
class CameraVideoAnalyzer:
@@ -131,7 +131,7 @@ class CameraVideoAnalyzer:
images=[video_path] # PraisonAI supports video files in images parameter
)
agents = AgentTeam(
agents = Agents(
agents=[self.video_agent],
tasks=[task],
process="sequential",
@@ -24,7 +24,7 @@ from pathlib import Path
project_root = Path(__file__).parent.parent.parent.parent / "src" / "praisonai-agents"
sys.path.insert(0, str(project_root))
from praisonaiagents import Agent, Task, AgentTeam, create_context_agent
from praisonaiagents import Agent, Task, Agents, create_context_agent
class ContextEngineeringWorkflow:
"""
@@ -302,7 +302,7 @@ class ContextEngineeringWorkflow:
print("\n⚙️ Executing Context Engineering Workflow")
print("-" * 50)
agents_workflow = AgentTeam(
agents_workflow = Agents(
agents=[
self.product_manager,
self.architect,
@@ -11,7 +11,7 @@ Author: Generated for GitHub Issue #23
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import read_csv, write_csv
def create_sample_urls_csv():
@@ -81,7 +81,7 @@ def method_1_simple_loop():
)
# Initialize the agents system
agents = AgentTeam(
agents = Agents(
agents=[loop_agent],
tasks=[loop_task],
process="workflow",
@@ -145,7 +145,7 @@ def method_2_manual_csv():
)
# Initialize and run
agents = AgentTeam(
agents = Agents(
agents=[csv_agent],
tasks=[csv_task],
process="sequential"
@@ -211,7 +211,7 @@ def method_3_url_processing():
)
# Initialize and run
agents = AgentTeam(
agents = Agents(
agents=[url_agent],
tasks=[url_task],
process="sequential"
@@ -319,7 +319,7 @@ def method_4_advanced_processing():
)
# Initialize and run with sequential processing
agents = AgentTeam(
agents = Agents(
agents=[validator_agent, processor_agent],
tasks=[validation_task, processing_task],
process="sequential" # Validation must complete before processing
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import logging
import os
@@ -35,7 +35,7 @@ knowledge_task = Task(
)
# Create and start the agents
agents = AgentTeam(
agents = Agents(
agents=[knowledge_agent],
tasks=[knowledge_task],
process="sequential",
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Define the configuration for the Knowledge instance
config = {
@@ -29,7 +29,7 @@ rag_task = Task(
)
# Build Agents
agents = AgentTeam(
agents = Agents(
agents=[rag_agent],
tasks=[rag_task],
user_id="user1"
@@ -8,7 +8,7 @@ This example demonstrates how to extract and utilize reasoning patterns in Prais
- Decision rationale extraction
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from typing import Dict, List, Tuple
from pydantic import BaseModel
import json
@@ -100,7 +100,7 @@ def demonstrate_reasoning_extraction():
context=[problem_task]
)
workflow = AgentTeam(
workflow = Agents(
agents=[cot_agent, reasoning_extractor],
tasks=[problem_task, extract_task],
process="sequential", output="verbose"
@@ -183,7 +183,7 @@ def advanced_reasoning_patterns():
context=[deductive_task, inductive_task, abductive_task]
)
workflow = AgentTeam(
workflow = Agents(
agents=[cot_agent, reasoning_validator],
tasks=[deductive_task, inductive_task, abductive_task, validation_task],
process="sequential", output="verbose"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
agent = Agent(
instructions="You are a loop agent that creating a loop of tasks.",
@@ -12,7 +12,7 @@ task = Task(
input_file="tasks.csv"
)
agents = AgentTeam(
agents = Agents(
agents=[agent],
tasks=[task],
process="workflow",
+5 -5
View File
@@ -8,7 +8,7 @@ This example demonstrates various routing patterns in PraisonAI including:
- Dynamic task selection
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from typing import Dict, Any
import random
@@ -77,7 +77,7 @@ def conditional_routing_example():
agent=processor_agent
)
workflow = AgentTeam(
workflow = Agents(
agents=[analyzer_agent, processor_agent],
tasks=[analysis_task, premium_task, standard_task, basic_task],
process="workflow", output="verbose"
@@ -109,7 +109,7 @@ def loop_pattern_example():
agent=validator_agent
)
workflow = AgentTeam(
workflow = Agents(
agents=[processor_agent, validator_agent],
tasks=[process_task, finalize_task],
process="workflow", output="verbose"
@@ -183,7 +183,7 @@ def decision_tree_example():
all_tasks = [categorize_task, technical_task, business_task] + terminal_tasks
workflow = AgentTeam(
workflow = Agents(
agents=[analyzer_agent, processor_agent],
tasks=all_tasks,
process="workflow", output="verbose"
@@ -269,7 +269,7 @@ def dynamic_routing_example():
agent=processor_agent
)
workflow = AgentTeam(
workflow = Agents(
agents=[dynamic_router, processor_agent],
tasks=[route_task, escalate_task, automate_task, review_task, standard_task],
process="workflow", output="verbose"
@@ -8,7 +8,7 @@ This example demonstrates the self-reflection capabilities in PraisonAI agents:
- Impact on output quality
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from typing import Dict, Any
import time
@@ -162,7 +162,7 @@ def reflection_workflow_example():
context=[create_task, review_task]
)
workflow = AgentTeam(
workflow = Agents(
agents=[creator_agent, reviewer_agent, polisher_agent],
tasks=[create_task, review_task, polish_task],
process="sequential", output="verbose"
@@ -5,7 +5,7 @@ This example demonstrates self-reflection capabilities using PraisonAI's
built-in reflection features for iterative improvement and quality optimization.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import internet_search
print("=== Self-Reflection Optimization Patterns Example ===\n")
@@ -9,7 +9,7 @@ This is the simplest possible implementation for processing URLs from a CSV file
Author: Generated for GitHub Issue #23
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import write_csv
def create_url_csv():
@@ -59,7 +59,7 @@ def main():
)
# Step 4: Run the agents
agents = AgentTeam(
agents = Agents(
agents=[url_agent],
tasks=[url_task],
process="workflow",
@@ -12,7 +12,7 @@ The if: pattern enables dynamic workflow paths based on
runtime conditions and variable values.
"""
from praisonaiagents import AgentFlow, WorkflowContext, StepResult
from praisonaiagents import Workflow, WorkflowContext, StepResult
from praisonaiagents.workflows import if_, loop
@@ -39,7 +39,7 @@ def basic_if_example():
return StepResult(output="Application rejected")
# Test with passing score
workflow_pass = AgentFlow(
workflow_pass = Workflow(
steps=[
if_(
condition="{{score}} >= 70",
@@ -54,7 +54,7 @@ def basic_if_example():
workflow_pass.start("Evaluate application")
# Test with failing score
workflow_fail = AgentFlow(
workflow_fail = Workflow(
steps=[
if_(
condition="{{score}} >= 70",
@@ -90,7 +90,7 @@ def string_condition_example():
return StepResult(output="Inactive user archived")
# Test with active status
workflow = AgentFlow(
workflow = Workflow(
steps=[
if_(
condition="{{status}} == active",
@@ -105,7 +105,7 @@ def string_condition_example():
workflow.start("Process user")
# Test with inactive status
workflow2 = AgentFlow(
workflow2 = Workflow(
steps=[
if_(
condition="{{status}} == active",
@@ -141,7 +141,7 @@ def contains_condition_example():
return StepResult(output="Content approved")
# Test with flagged content
workflow1 = AgentFlow(
workflow1 = Workflow(
steps=[
if_(
condition="error in {{message}}",
@@ -156,7 +156,7 @@ def contains_condition_example():
workflow1.start("Filter content")
# Test with clean content
workflow2 = AgentFlow(
workflow2 = Workflow(
steps=[
if_(
condition="error in {{message}}",
@@ -200,7 +200,7 @@ def if_inside_loop_example():
print(f" 📦 {name}: Standard service activated")
return StepResult(output=f"Standard service for {name}")
workflow = AgentFlow(
workflow = Workflow(
steps=[
loop(
steps=[
@@ -258,7 +258,7 @@ def nested_conditions_example():
# Outer condition: Is premium?
# Inner condition (if premium): Is VIP?
workflow = AgentFlow(
workflow = Workflow(
steps=[
if_(
condition="{{tier}} == premium",
@@ -278,7 +278,7 @@ def nested_conditions_example():
print("\nTest 1: Premium tier, high spend")
workflow.start("Determine support level")
workflow2 = AgentFlow(
workflow2 = Workflow(
steps=[
if_(
condition="{{tier}} == premium",
@@ -298,7 +298,7 @@ def nested_conditions_example():
print("\nTest 2: Premium tier, low spend")
workflow2.start("Determine support level")
workflow3 = AgentFlow(
workflow3 = Workflow(
steps=[
if_(
condition="{{tier}} == premium",
@@ -340,7 +340,7 @@ def no_else_example():
return StepResult(output="Continued")
# Only send notification if opted in
workflow = AgentFlow(
workflow = Workflow(
steps=[
if_(
condition="{{notify}} == true",
@@ -355,7 +355,7 @@ def no_else_example():
print("\nTest 1: notify = true")
workflow.start("Process with notification")
workflow2 = AgentFlow(
workflow2 = Workflow(
steps=[
if_(
condition="{{notify}} == true",
@@ -4,7 +4,7 @@ Example: Using Latency Tracking Tool with PraisonAI
This example shows how to track latency without modifying core files.
"""
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
from latency_tracker_tool import (
latency_tracking_tool,
create_tracked_agent,
@@ -5,7 +5,7 @@ This shows how to add latency tracking to an MCP server
without modifying PraisonAI core files.
"""
from praisonaiagents import Agent, AgentTeam
from praisonaiagents import Agent, Agents
from hosted_server import HostedMCPServer # Import from local file
from latency_tracker_tool import tracker, get_latency_metrics
import json
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import cot_save, cot_upload_to_huggingface
from pydantic import BaseModel
import os
@@ -128,7 +128,7 @@ upload_to_huggingface_task = Task(
)
# Initialize workflow
agents = AgentTeam(
agents = Agents(
agents=[qa_generator, total_questions_evaluator, cot_generator, upload_to_huggingface],
tasks=[generate_task, evaluate_total_questions_task, generate_cot_task, upload_to_huggingface_task],
process="workflow",
-43
View File
@@ -1,43 +0,0 @@
# EvaluationLoop Examples
Examples demonstrating iterative evaluation and improvement patterns.
## Quick Start
```bash
pip install praisonaiagents
export OPENAI_API_KEY=your-key
```
## Examples
| File | Description |
|------|-------------|
| `basic_evaluation_loop.py` | Simple loop: Run → Judge → Improve |
| `multi_step_task_loop.py` | Sequential tasks with context passing |
| `recipe_optimization_loop.py` | CLI-based recipe optimization |
## Pattern
```
┌─────────┐ ┌─────────┐ ┌──────────┐
│ Agent │ ──► │ Judge │ ──► │ Feedback │
│ runs │ │ scores │ │ improves │
└─────────┘ └─────────┘ └──────────┘
▲ │
└───────────────────────────────┘
(repeat until 8.0+)
```
## Run Examples
```bash
# Basic loop
python basic_evaluation_loop.py
# Multi-step with context
python multi_step_task_loop.py
# CLI recipe loop
python recipe_optimization_loop.py "research AI trends"
```
@@ -1,73 +0,0 @@
"""
Basic EvaluationLoop Example
Demonstrates the iterative evaluation loop pattern:
Run agent → Judge output → Improve → Repeat until threshold met.
Usage:
pip install praisonaiagents
export OPENAI_API_KEY=your-key
python basic_evaluation_loop.py
"""
from praisonaiagents import Agent
from praisonaiagents.eval import EvaluationLoop
def on_iteration(result):
"""Callback showing progress after each iteration."""
status = "✅" if result.score >= 8.0 else "⚠️" if result.score >= 6.0 else "❌"
print(f"{status} Iteration {result.iteration}: {result.score:.1f}/10")
if result.findings:
print(f" → {result.findings[0][:60]}...")
def main():
# Create an agent
agent = Agent(
name="writer",
instructions="You are a technical content writer. Write clear, accurate explanations."
)
# Run evaluation loop
loop = EvaluationLoop(
agent=agent,
criteria="""
Evaluate the response on:
1. CLARITY: Is the explanation easy to understand?
2. ACCURACY: Is the technical content correct?
3. COMPLETENESS: Does it cover the key aspects?
4. EXAMPLES: Does it include practical examples?
Score 1-10 based on all criteria.
""",
threshold=8.0,
max_iterations=5,
on_iteration=on_iteration,
verbose=False,
)
print("╔════════════════════════════════════════════════════════════╗")
print("║ Basic EvaluationLoop Example ║")
print("║ Pattern: Run → Judge → Improve → Repeat ║")
print("║ Target: 8.0/10 score ║")
print("╚════════════════════════════════════════════════════════════╝\n")
result = loop.run("Explain how API rate limiting works and why it matters")
print("\n" + "─" * 60)
print("RESULTS:")
print("─" * 60)
print(f"Success: {result.success}")
print(f"Final Score: {result.final_score:.1f}/10")
print(f"Iterations: {result.num_iterations}")
print(f"Score History: {[f'{s:.1f}' for s in result.score_history]}")
print(f"Duration: {result.total_duration_seconds:.2f}s")
print("\n" + "─" * 60)
print("FINAL OUTPUT (first 500 chars):")
print("─" * 60)
print(result.final_output[:500] + "..." if len(result.final_output) > 500 else result.final_output)
if __name__ == "__main__":
main()
@@ -1,144 +0,0 @@
"""
Multi-Step Task Loop Example
Demonstrates evaluating sequential task steps where each step can
reference output from previous steps.
Pattern:
1. Research → Evaluate → Improve
2. Analyze (using research) → Evaluate → Improve
3. Report (using analysis) → Evaluate → Improve
Usage:
pip install praisonaiagents
export OPENAI_API_KEY=your-key
python multi_step_task_loop.py
"""
from praisonaiagents import Agent
from praisonaiagents.eval import EvaluationLoop
def on_iteration(result):
"""Show iteration progress."""
status = "✅" if result.score >= 8.0 else "⚠️" if result.score >= 6.0 else "❌"
print(f" {status} Iteration {result.iteration}: {result.score:.1f}/10")
def run_step(step_name: str, agent: Agent, task: str, criteria: str, context: str = "") -> dict:
"""Run a single step through an evaluation loop."""
print(f"\n{'─'*60}")
print(f"STEP: {step_name}")
print(f"{'─'*60}")
# Include context from previous step if provided
full_task = task
if context:
full_task = f"{task}\n\nContext from previous step:\n{context[:1000]}"
loop = EvaluationLoop(
agent=agent,
criteria=criteria,
threshold=8.0,
max_iterations=3,
on_iteration=on_iteration,
verbose=False,
)
result = loop.run(full_task)
print(f" → Final: {result.final_score:.1f}/10 ({result.num_iterations} iterations)")
return {
"name": step_name,
"output": result.final_output,
"score": result.final_score,
"success": result.success,
"iterations": result.num_iterations,
}
def main():
print("╔════════════════════════════════════════════════════════════╗")
print("║ Multi-Step Task Loop Example ║")
print("║ Pattern: Step1 → Step2 → Step3 (with context passing) ║")
print("║ Each step: Run → Judge → Improve until 8.0+ ║")
print("╚════════════════════════════════════════════════════════════╝")
# Create specialized agents
researcher = Agent(
name="researcher",
instructions="You are a research specialist. Find and summarize key information."
)
analyst = Agent(
name="analyst",
instructions="You are an analyst. Identify patterns, insights, and implications."
)
writer = Agent(
name="writer",
instructions="You are a report writer. Create clear, actionable summaries."
)
# Define task steps
steps = [
{
"name": "Research",
"agent": researcher,
"task": "Research the top 3 trends in AI for 2024-2025. Provide brief descriptions.",
"criteria": "Covers 3 distinct trends with accurate descriptions.",
},
{
"name": "Analysis",
"agent": analyst,
"task": "Analyze the implications of these AI trends for software development.",
"criteria": "Identifies actionable insights and potential challenges.",
},
{
"name": "Report",
"agent": writer,
"task": "Create a brief executive summary (3-4 bullet points) for a CTO.",
"criteria": "Concise, actionable, appropriate for executive audience.",
},
]
# Run all steps with context passing
results = []
context = ""
for step in steps:
result = run_step(
step_name=step["name"],
agent=step["agent"],
task=step["task"],
criteria=step["criteria"],
context=context,
)
results.append(result)
context = result["output"] # Pass output as context to next step
# Summary
print("\n" + "═"*60)
print("SUMMARY")
print("═"*60)
total_iterations = sum(r["iterations"] for r in results)
avg_score = sum(r["score"] for r in results) / len(results)
all_success = all(r["success"] for r in results)
for r in results:
status = "✅" if r["success"] else "❌"
print(f" {status} {r['name']}: {r['score']:.1f}/10 ({r['iterations']} iterations)")
print(f"\n Total Iterations: {total_iterations}")
print(f" Average Score: {avg_score:.1f}/10")
print(f" All Steps Passed: {'Yes' if all_success else 'No'}")
print("\n" + "─"*60)
print("FINAL REPORT OUTPUT:")
print("─"*60)
print(results[-1]["output"][:600])
if __name__ == "__main__":
main()
@@ -1,183 +0,0 @@
"""
Recipe Optimization Loop (CLI-based)
Demonstrates the 5-cycle recipe improvement pattern using CLI commands:
Create (once) → Run → Judge → Optimize (loop 5x)
Usage:
pip install praisonai
export OPENAI_API_KEY=your-key
export TAVILY_API_KEY=your-key
python recipe_optimization_loop.py "research AI trends in healthcare"
"""
import subprocess
import sys
import os
import json
from pathlib import Path
def run_cli(cmd: str, cwd: str = None) -> tuple[int, str, str]:
"""Run a CLI command and return (exit_code, stdout, stderr)."""
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
text=True,
cwd=cwd,
)
return result.returncode, result.stdout, result.stderr
def create_recipe(goal: str, work_dir: str) -> str:
"""Create a recipe once. Returns recipe name."""
print(f"\n{'═'*60}")
print("STEP 1: CREATE RECIPE (once)")
print(f"{'═'*60}")
print(f"Goal: {goal}")
cmd = f'praisonai recipe create "{goal}" --no-optimize'
code, stdout, stderr = run_cli(cmd, cwd=work_dir)
if code != 0:
print(f"❌ Failed to create recipe: {stderr}")
return None
# Extract recipe name from output
for line in stdout.split('\n'):
if 'Created recipe:' in line:
recipe_name = line.split('Created recipe:')[1].strip()
print(f"✅ Created: {recipe_name}")
return recipe_name
print(f"✅ Recipe created")
return None
def run_recipe(recipe_name: str, trace_name: str, work_dir: str) -> tuple[bool, str]:
"""Run the recipe and save trace. Returns (success, output)."""
cmd = f'praisonai recipe run {recipe_name} --save --name {trace_name}'
code, stdout, stderr = run_cli(cmd, cwd=work_dir)
success = code == 0 and 'status: completed' in stdout.lower()
return success, stdout
def judge_recipe(trace_name: str, work_dir: str) -> tuple[float, str]:
"""Judge the trace. Returns (score, feedback)."""
cmd = f'praisonai recipe judge {trace_name}'
code, stdout, stderr = run_cli(cmd, cwd=work_dir)
# Extract score from output
score = 0.0
for line in stdout.split('\n'):
if 'Overall Score:' in line:
try:
score = float(line.split(':')[1].strip().split('/')[0])
except:
pass
return score, stdout
def optimize_recipe(recipe_name: str, iterations: int, work_dir: str) -> tuple[float, str]:
"""Optimize the recipe. Returns (final_score, output)."""
cmd = f'praisonai recipe optimize {recipe_name} --iterations {iterations}'
code, stdout, stderr = run_cli(cmd, cwd=work_dir)
# Extract final score
score = 0.0
for line in stdout.split('\n'):
if 'Final score:' in line or 'score:' in line.lower():
try:
score = float(line.split(':')[1].strip().split('/')[0])
except:
pass
return score, stdout
def run_optimization_loop(goal: str, num_cycles: int = 5, threshold: float = 8.0):
"""Run the full Create → Run → Judge → Optimize loop."""
print("╔════════════════════════════════════════════════════════════╗")
print("║ Recipe Optimization Loop (CLI-based) ║")
print("║ Pattern: Create (once) → Run → Judge → Optimize (loop) ║")
print(f"║ Cycles: {num_cycles} | Threshold: {threshold}/10 ║")
print("╚════════════════════════════════════════════════════════════╝")
# Create work directory
work_dir = Path("/tmp/recipe-optimization-loop")
work_dir.mkdir(parents=True, exist_ok=True)
os.chdir(work_dir)
# Step 1: Create recipe (once)
recipe_name = create_recipe(goal, str(work_dir))
if not recipe_name:
print("Failed to create recipe. Exiting.")
return
# Step 2-N: Run → Judge → Optimize loop
results = []
for cycle in range(1, num_cycles + 1):
print(f"\n{'─'*60}")
print(f"CYCLE {cycle}/{num_cycles}")
print(f"{'─'*60}")
trace_name = f"cycle-{cycle}"
# Run
print(f" 📝 Running recipe...")
success, run_output = run_recipe(recipe_name, trace_name, str(work_dir))
run_status = "✅" if success else "⚠️"
print(f" {run_status} Run complete")
# Judge
print(f" ⚖️ Judging output...")
score, judge_output = judge_recipe(trace_name, str(work_dir))
score_status = "✅" if score >= threshold else "⚠️" if score >= 6.0 else "❌"
print(f" {score_status} Score: {score}/10")
# Check if threshold met
if score >= threshold:
print(f" 🎉 Threshold {threshold}/10 reached!")
results.append({"cycle": cycle, "score": score, "status": "passed"})
break
# Optimize
print(f" 🔧 Optimizing recipe...")
opt_score, opt_output = optimize_recipe(recipe_name, 1, str(work_dir))
print(f" → Optimized score: {opt_score}/10")
results.append({
"cycle": cycle,
"initial_score": score,
"optimized_score": opt_score,
"status": "optimized" if opt_score > score else "no_change"
})
# Summary
print(f"\n{'═'*60}")
print("SUMMARY")
print(f"{'═'*60}")
for r in results:
if "initial_score" in r:
print(f" Cycle {r['cycle']}: {r['initial_score']} → {r['optimized_score']}/10")
else:
print(f" Cycle {r['cycle']}: {r['score']}/10 ✅ PASSED")
final_score = results[-1].get("optimized_score", results[-1].get("score", 0))
success = final_score >= threshold
print(f"\n Final Score: {final_score}/10")
print(f" Success: {'Yes ✅' if success else 'No ❌'}")
print(f" Recipe: {work_dir}/{recipe_name}")
return results
if __name__ == "__main__":
goal = sys.argv[1] if len(sys.argv) > 1 else "research latest AI trends and create a summary report"
run_optimization_loop(goal, num_cycles=5, threshold=8.0)
@@ -5,7 +5,7 @@ This example demonstrates callback systems using PraisonAI's built-in
callback functionality for monitoring agent interactions and tool usage.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.display_callback import register_display_callback
from praisonaiagents.tools import internet_search
+5 -5
View File
@@ -1,7 +1,7 @@
import asyncio
import time
from typing import List, Dict
from praisonaiagents import Agent, Task, AgentTeam, TaskOutput
from praisonaiagents import Agent, Task, Agents, TaskOutput
from praisonaiagents.main import (
display_error,
display_interaction,
@@ -156,7 +156,7 @@ workflow_async_task = Task(
def run_sync_example():
"""Run synchronous example"""
display_instruction("\nRunning Synchronous Example...", console)
agents = AgentTeam(
agents = Agents(
agents=[sync_agent],
tasks=[sync_task],
process="sequential"
@@ -167,7 +167,7 @@ def run_sync_example():
async def run_async_example():
"""Run asynchronous example"""
display_instruction("\nRunning Asynchronous Example...", console)
agents = AgentTeam(
agents = Agents(
agents=[async_agent],
tasks=[async_task],
process="sequential"
@@ -178,7 +178,7 @@ async def run_async_example():
async def run_mixed_example():
"""Run mixed sync/async example"""
display_instruction("\nRunning Mixed Sync/Async Example...", console)
agents = AgentTeam(
agents = Agents(
agents=[sync_agent, async_agent],
tasks=[sync_task, async_task],
process="sequential"
@@ -189,7 +189,7 @@ async def run_mixed_example():
async def run_workflow_example():
"""Run workflow example with both sync and async tasks"""
display_instruction("\nRunning Workflow Example...", console)
agents = AgentTeam(
agents = Agents(
agents=[sync_agent, async_agent],
tasks=[workflow_sync_task, workflow_async_task],
process="workflow"
@@ -1,7 +1,7 @@
import asyncio
import time
from typing import List, Dict
from praisonaiagents import Agent, Task, AgentTeam, TaskOutput
from praisonaiagents import Agent, Task, Agents, TaskOutput
from duckduckgo_search import DDGS
from pydantic import BaseModel
@@ -111,7 +111,7 @@ async def run_parallel_tasks():
)
# Create a single Agents instance with both agents
agents = AgentTeam(
agents = Agents(
agents=[async_agent, summary_agent],
tasks=parallel_tasks + [summary_task],
process="sequential"
@@ -1,7 +1,7 @@
import asyncio
import time
from typing import List, Dict
from praisonaiagents import Agent, Task, AgentTeam, TaskOutput
from praisonaiagents import Agent, Task, Agents, TaskOutput
from duckduckgo_search import DDGS
from pydantic import BaseModel
@@ -99,7 +99,7 @@ async_task = Task(
async def run_single_task():
"""Run single async task"""
print("\nRunning Single Async Task...")
agents = AgentTeam(
agents = Agents(
agents=[async_agent],
tasks=[async_task],
process="sequential"
@@ -182,7 +182,7 @@ Present the summary in a clear, structured format with sections for findings, pa
)
# First run parallel search tasks
agents = AgentTeam(
agents = Agents(
agents=[async_agent],
tasks=parallel_tasks, # Only run search tasks first
process="sequential"
@@ -206,7 +206,7 @@ Present the summary in a clear, structured format with sections for findings, pa
summary_task.context = completed_tasks
# Run summarization task with summary agent
summary_agents = AgentTeam(
summary_agents = Agents(
agents=[summary_agent], # Use summary agent for synthesis
tasks=[summary_task],
process="sequential"
@@ -18,7 +18,7 @@ from praisonaiagents import AutoAgents
from praisonaiagents.tools import duckduckgo
# Basic usage - AutoAgents analyzes complexity and creates optimal agents
agents = AutoAgentTeam(
agents = AutoAgents(
instructions="Search for information about AI Agents",
tools=[duckduckgo],
process="sequential", # or "hierarchical"
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import time
def get_environment_state():
@@ -86,7 +86,7 @@ feedback_task = Task(
)
# Create workflow manager
workflow = AgentTeam(
workflow = Agents(
agents=[llm_caller, action_agent, feedback_agent],
tasks=[monitor_task, action_task, feedback_task],
process="workflow", output="verbose"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import json
from e2b_code_interpreter import Sandbox
@@ -46,5 +46,5 @@ execution_agent_task = Task(
agent=execution_agent
)
agents = AgentTeam(agents=[code_agent, execution_agent], tasks=[code_agent_task, execution_agent_task])
agents = Agents(agents=[code_agent, execution_agent], tasks=[code_agent_task, execution_agent_task])
agents.start()
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Create generator and evaluator agents
generator = Agent(
@@ -53,7 +53,7 @@ evaluate_task = Task(
)
# Create workflow manager
workflow = AgentTeam(
workflow = Agents(
agents=[generator, evaluator],
tasks=[generate_task, evaluate_task],
process="workflow", output="verbose"
+1 -1
View File
@@ -183,7 +183,7 @@ def main():
)
# Create and run agents manager
agents = AgentTeam(
agents = Agents(
agents=[researcher, writer],
tasks=[task1, task2, task3, task4],
process="sequential",
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from typing import List, Dict, Union
from duckduckgo_search import DDGS
from langchain_community.tools import YouTubeSearchTool
@@ -141,7 +141,7 @@ validate_task = Task(
)
# 4. Workflow
agents = AgentTeam(
agents = Agents(
agents=[data_agent],
tasks=[collect_task, validate_task],
process="workflow"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam, error_logs
from praisonaiagents import Agent, Task, Agents, error_logs
from duckduckgo_search import DDGS
def my_callback(output):
@@ -92,7 +92,7 @@ task4 = Task(
)
# Create and run agents manager
agents = AgentTeam(
agents = Agents(
agents=[researcher, writer],
tasks=[task1, task2, task3, task4],
output="minimal",
@@ -24,7 +24,7 @@ import sys
# Add the local development path to use the current implementation
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src', 'praisonai-agents'))
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import python_tools, file_tools, shell_tools
from praisonaiagents.main import register_approval_callback
from praisonaiagents.approval import (
@@ -109,7 +109,7 @@ def main():
]
# Create and run process
process = AgentTeam(
process = Agents(
agents=[agent],
tasks=tasks, output="verbose"
)
@@ -166,7 +166,7 @@ async def async_demo():
expected_output="Async execution result"
)
process = AgentTeam(
process = Agents(
agents=[agent],
tasks=[task], output="verbose"
)
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from langchain_community.tools import YouTubeSearchTool
from langchain_community.utilities import WikipediaAPIWrapper
@@ -21,7 +21,7 @@ task = Task(
)
# Create and start the workflow
agents = AgentTeam(
agents = Agents(
agents=[agent],
tasks=[task], output="verbose"
)
+3 -3
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import logging
import os
@@ -101,7 +101,7 @@ def main():
)
# Initialize Agents with memory configuration
agents = AgentTeam(
agents = Agents(
agents=[researcher, retriever],
tasks=[store_task, verify_task, query_task, query_both_task], # Use same verbose level as memory
memory={
@@ -115,7 +115,7 @@ def main():
}
)
# agents = AgentTeam(
# agents = Agents(
# agents=[researcher, retriever],
# tasks=[store_task, verify_task, query_task, query_both_task],
# # Use same verbose level as memory
+1 -1
View File
@@ -54,7 +54,7 @@ blog_task = Task(
agent=blog_agent
)
agents = AgentTeam(
agents = Agents(
agents=[fact_agent, research_agent, blog_agent],
tasks=[fact_task, research_task, research_task2, research_task3, research_task4, blog_task],
memory=True
@@ -1,6 +1,6 @@
from praisonaiagents import Agent, AgentTeam, Tools
from praisonaiagents import Agent, Agents, Tools
research_agent = Agent(instructions="You are a research agent to search internet about AI 2024", tools=[Tools.internet_search])
summarise_agent = Agent(instructions="You are a summarize agent to summarise in points")
agents = AgentTeam(agents=[research_agent, summarise_agent])
agents = Agents(agents=[research_agent, summarise_agent])
agents.start()
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Create Vision Analysis Agent
vision_agent = Agent(
@@ -43,7 +43,7 @@ task3 = Task(
)
# Create Agents instance
agents = AgentTeam(
agents = Agents(
agents=[vision_agent],
tasks=[task1, task2, task3],
process="sequential"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import time
def get_time_check():
@@ -93,7 +93,7 @@ synthesize_task = Task(
)
# Create workflow manager
workflow = AgentTeam(
workflow = Agents(
agents=[router, worker1, worker2, worker3, synthesizer],
tasks=[router_task, worker1_task, worker2_task, worker3_task, synthesize_task],
process="workflow", output="verbose"
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from datetime import datetime
import asyncio
@@ -75,7 +75,7 @@ aggregate_task = Task(
async def main():
# Create workflow manager
workflow = AgentTeam(
workflow = Agents(
agents=[agent1, agent2, agent3, aggregator],
tasks=[task1, task2, task3, aggregate_task],
process="workflow"
+1 -1
View File
@@ -64,7 +64,7 @@ final_task = Task(
)
# Create the workflow manager
workflow = AgentTeam(
workflow = Agents(
agents=[agent1, agent2, agent3],
tasks=[initial_task, analysis_task, final_task],
process="workflow", # Use workflow process type
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam, Tools
from praisonaiagents import Agent, Task, Agents, Tools
from pydantic import BaseModel
class AnalysisReport(BaseModel):
@@ -44,7 +44,7 @@ analysis_task = Task(
)
# Initialize and run agents
agents = AgentTeam(
agents = Agents(
agents=[researcher, analyst],
tasks=[research_task, analysis_task],
process="sequential",
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import os
import requests
from typing import Any, Dict, List, Optional
@@ -106,7 +106,7 @@ task = Task(
)
# Create and start the workflow
agents = AgentTeam(
agents = Agents(
agents=[agent],
tasks=[task], output="verbose"
)
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import get_article, get_news_sources, get_articles_from_source, get_trending_topics
# Create Wikipedia agent
@@ -22,7 +22,7 @@ news_task = Task(
# Run agent
agents = AgentTeam(
agents = Agents(
agents=[news_agent],
tasks=[news_task],
process="sequential"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from typing import List, Dict
from duckduckgo_search import DDGS
@@ -64,7 +64,7 @@ validate_task = Task(
)
# 4. AI Agents Workflow
agents = AgentTeam(
agents = Agents(
agents=[data_agent],
tasks=[collect_task, validate_task],
process="workflow"
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
import random
from typing import List, Dict, Union
import json
@@ -225,7 +225,7 @@ process_task = Task(
)
# Create Agents instance with workflow process
workflow = AgentTeam(
workflow = Agents(
agents=[data_agent, process_agent],
tasks=[collect_task, validate_task, process_task],
process="workflow"
@@ -12,7 +12,7 @@ Features demonstrated:
- Quality assurance workflows
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.task import TaskOutput
from typing import Tuple, Any
import re
@@ -181,7 +181,7 @@ llm_guardrail_task = Task(
)
# Execute tasks with guardrails
agents = AgentTeam(
agents = Agents(
agents=[email_agent, content_agent, business_agent, research_agent, llm_guardrail_agent],
tasks=[email_task, content_task, business_task, research_task, llm_guardrail_task], output="verbose"
)
@@ -5,7 +5,7 @@ This example demonstrates production guardrail patterns using PraisonAI's
built-in validation and safety mechanisms for secure agent operations.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import internet_search
print("=== Production Guardrails Patterns Example ===\n")
@@ -5,7 +5,7 @@ This example demonstrates an advanced system that dynamically creates agents and
based on user inputs, including conditional logic, custom configurations, and file output.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import duckduckgo
import os
from typing import Dict, List
@@ -137,7 +137,7 @@ class DynamicAgentSystem:
# Run the system
print(f"\n🚀 Starting {process} analysis for '{inputs['topic']}'...")
praison_agents = AgentTeam(
praison_agents = Agents(
agents=agents,
tasks=tasks,
process=process,
@@ -6,7 +6,7 @@ to create flexible agent configurations that can be pre-configured via environme
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Set via environment or use default
default_topic = os.getenv("RESEARCH_TOPIC", "AI trends")
@@ -46,7 +46,7 @@ print(f" - Max Retries: {max_retries}")
print("\n" + "="*50 + "\n")
# Run agents
agents = AgentTeam(agents=[agent], tasks=[task])
agents = Agents(agents=[agent], tasks=[task])
result = agents.start()
# Save to environment-specified location if provided
@@ -5,7 +5,7 @@ This example shows how to use multiple user inputs to create a more sophisticate
agent system with tools, multiple agents, and context passing between tasks.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import duckduckgo
# Get multiple inputs
@@ -47,7 +47,7 @@ analyze_task = Task(
)
# Run sequential process
agents = AgentTeam(
agents = Agents(
agents=[search_agent, analysis_agent],
tasks=[search_task, analyze_task],
process="sequential"
+2 -2
View File
@@ -5,7 +5,7 @@ This example demonstrates how to use basic user input to create dynamic agents a
The user is prompted for a search query, and the agent searches for information about it.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Get user input
user_query = input("What would you like to search for? ")
@@ -26,5 +26,5 @@ task = Task(
)
# Run
agents = AgentTeam(agents=[agent], tasks=[task])
agents = Agents(agents=[agent], tasks=[task])
agents.start()
+2 -2
View File
@@ -10,7 +10,7 @@ To run this example:
"""
import streamlit as st
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import duckduckgo
# Set page configuration
@@ -125,7 +125,7 @@ if st.button("🚀 Submit", type="primary", use_container_width=True):
)
# Run agents
agents = AgentTeam(
agents = Agents(
agents=[agent],
tasks=[task],
process=process_type
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, AgentTeam, MCP
from praisonaiagents import Agent, Agents, MCP
airbnb_agent = Agent(
instructions="""Search for Apartments in Paris for 2 nights on Airbnb. 04/28 - 04/30 for 2 adults""",
@@ -12,6 +12,6 @@ whatsapp_agent = Agent(
tools=MCP("python /Users/praison/whatsapp-mcp/whatsapp-mcp-server/main.py")
)
agents = AgentTeam(agents=[airbnb_agent, whatsapp_agent])
agents = Agents(agents=[airbnb_agent, whatsapp_agent])
agents.start()
+2 -2
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent, AgentTeam, MCP
from praisonaiagents import Agent, Agents, MCP
import gradio as gr
def search_airbnb(query):
@@ -14,7 +14,7 @@ def search_airbnb(query):
tools=MCP("python /Users/praison/whatsapp-mcp/whatsapp-mcp-server/main.py")
)
agents = AgentTeam(agents=[airbnb_agent, whatsapp_agent])
agents = Agents(agents=[airbnb_agent, whatsapp_agent])
result = agents.start()
return f"## Airbnb Search Results\n\n{result}"
@@ -5,7 +5,7 @@ This example demonstrates graph memory capabilities with PraisonAI agents
for knowledge graph construction and relationship-aware memory retrieval.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import internet_search
print("=== Advanced Graph Memory Integration Example ===\n")
@@ -57,7 +57,7 @@ query_task = Task(
)
# Run with graph memory integration
agents_system = AgentTeam(
agents_system = Agents(
agents=[knowledge_agent],
tasks=[build_task, query_task],
memory=True,
@@ -5,7 +5,7 @@ This example demonstrates memory search optimization using PraisonAI's
built-in memory capabilities with semantic search and quality filtering.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import internet_search
print("=== Advanced Memory Search and Optimization Example ===\n")
@@ -58,7 +58,7 @@ search_task = Task(
)
# Run with memory optimization
agents_system = AgentTeam(
agents_system = Agents(
agents=[research_agent],
tasks=[build_memory_task, search_task],
memory=True,
@@ -20,7 +20,7 @@ Prerequisites:
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
def main():
"""Demonstrate Gemini embedding usage"""
@@ -82,7 +82,7 @@ def main():
# Configure with Gemini embeddings
# Option 1: Using stable text-embedding-004
agents = AgentTeam(
agents = Agents(
agents=[researcher, retriever],
tasks=[store_task, retrieve_task],
memory={
@@ -97,7 +97,7 @@ def main():
)
# Alternative: Using experimental model with advanced features
# agents = AgentTeam(
# agents = Agents(
# agents=[researcher, retriever],
# tasks=[store_task, retrieve_task],
#
+2 -2
View File
@@ -16,7 +16,7 @@ Setup:
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
def main():
# Example with Neo4j (uncomment and configure as needed)
@@ -149,7 +149,7 @@ def main():
)
# Run the multi-agent system with graph memory
agents_system = AgentTeam(
agents_system = Agents(
agents=[researcher],
tasks=[build_knowledge_task, query_knowledge_task, expand_knowledge_task],
memory=True,
@@ -20,7 +20,7 @@ Features demonstrated:
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import mongodb_tools
# Ensure OpenAI API key is set
@@ -186,7 +186,7 @@ def main():
print("🚀 Starting Comprehensive MongoDB Business System...")
print("=" * 60)
business_system = AgentTeam(
business_system = Agents(
agents=[data_manager, knowledge_curator, business_analyst, customer_service],
tasks=business_tasks,
memory=True,
@@ -19,7 +19,7 @@ Features demonstrated:
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Ensure OpenAI API key is set
if not os.environ.get("OPENAI_API_KEY"):
@@ -122,7 +122,7 @@ def main():
print("🚀 Starting MongoDB Knowledge Management System...")
print("=" * 60)
knowledge_system = AgentTeam(
knowledge_system = Agents(
agents=[research_agent, knowledge_agent],
tasks=knowledge_tasks,
memory=True, output="verbose"
@@ -19,7 +19,7 @@ Features demonstrated:
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
# Ensure OpenAI API key is set
if not os.environ.get("OPENAI_API_KEY"):
@@ -90,7 +90,7 @@ def main():
print("🚀 Starting MongoDB Memory Research System...")
print("=" * 60)
research_system = AgentTeam(
research_system = Agents(
agents=[research_agent],
tasks=research_tasks,
memory=True,
@@ -19,7 +19,7 @@ Features demonstrated:
"""
import os
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import mongodb_tools
# Ensure OpenAI API key is set
@@ -111,7 +111,7 @@ def main():
print("🚀 Starting MongoDB Tools Demo System...")
print("=" * 60)
mongodb_system = AgentTeam(
mongodb_system = Agents(
agents=[db_agent, analysis_agent],
tasks=mongodb_tasks, output="verbose"
)
@@ -10,7 +10,7 @@ Demonstrates performance monitoring in a multi-agent workflow:
Shows how to monitor complex multi-agent systems.
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.telemetry import (
monitor_function, track_api_call, get_function_stats,
analyze_function_flow, generate_comprehensive_report
@@ -101,7 +101,7 @@ def main():
with track_api_call("multi_agent_workflow"):
print("\n🚀 Starting multi-agent workflow...")
workflow = AgentTeam(
workflow = Agents(
agents=[researcher, analyst, writer],
tasks=[research_task, analysis_task, report_task],
process="sequential", output="verbose"
@@ -11,7 +11,7 @@ Shows how to monitor complex organizational agent structures.
"""
import time
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.telemetry import (
monitor_function, track_api_call, get_function_stats,
visualize_execution_flow, generate_comprehensive_report
@@ -13,7 +13,7 @@ Shows how to create a comprehensive performance monitoring solution.
import time
import json
from datetime import datetime, timedelta
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.telemetry import (
monitor_function, track_api_call, performance_monitor,
get_performance_report, get_function_stats, get_api_stats,
@@ -139,7 +139,7 @@ def simulate_complex_workflow():
# Execute workflow
with track_api_call("complex_workflow_execution"):
workflow = AgentTeam(
workflow = Agents(
agents=[planner, executor, reviewer],
tasks=[planning_task, execution_task, review_task],
process="sequential", output="minimal"
+5 -5
View File
@@ -11,7 +11,7 @@ These patterns enable complex data processing pipelines
while maintaining clean, readable workflow definitions.
"""
from praisonaiagents import AgentFlow, WorkflowContext, StepResult
from praisonaiagents import Workflow, WorkflowContext, StepResult
from praisonaiagents.workflows import loop, parallel, route
@@ -51,7 +51,7 @@ def nested_loop_example():
var_name="row"
)
workflow = AgentFlow(
workflow = Workflow(
steps=[outer_loop],
variables={
"rows": [
@@ -101,7 +101,7 @@ def parallel_inside_loop_example():
parallel_analysis = parallel([security_scan, performance_test, code_review])
# Loop through projects, running parallel analysis for each
workflow = AgentFlow(
workflow = Workflow(
steps=[
loop(
steps=[parallel_analysis],
@@ -161,7 +161,7 @@ def route_inside_loop_example():
item_type = item.get("type", "unknown")
return StepResult(output=item_type)
workflow = AgentFlow(
workflow = Workflow(
steps=[
loop(
steps=[get_type, type_router],
@@ -214,7 +214,7 @@ def three_level_nesting_example():
# Level 1: Process each department (contains team loop)
dept_loop = loop(steps=[team_loop], over="departments", var_name="dept")
workflow = AgentFlow(
workflow = Workflow(
steps=[dept_loop],
variables={
"departments": [
@@ -21,7 +21,7 @@ Features Demonstrated:
import time
import random
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import duckduckgo
from praisonaiagents.telemetry import (
monitor_function, track_api_call, performance_monitor,
@@ -213,7 +213,7 @@ def execute_monitored_task(agent, task_description):
agent=agent
)
agents_workflow = AgentTeam(
agents_workflow = Agents(
agents=[agent],
tasks=[task], output="minimal"
)
@@ -12,7 +12,7 @@ Features demonstrated:
- State-based workflow management
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import duckduckgo
import random
@@ -203,7 +203,7 @@ for request in sample_requests:
)
# Execute the workflow with conditional routing
workflow_agents = AgentTeam(
workflow_agents = Agents(
agents=[
intake_agent, specialist_agent, review_agent,
coordinator_agent
@@ -12,7 +12,7 @@ Features demonstrated:
- Process-level orchestration
"""
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents import Agent, Task, Agents
from praisonaiagents.tools import duckduckgo
# Create Manager Agent
@@ -83,7 +83,7 @@ coordination_task = Task(
)
# Create Hierarchical Process
agents = AgentTeam(
agents = Agents(
agents=[manager, researcher, data_analyst, writer],
tasks=[research_task, analysis_task, writing_task, coordination_task],
process="hierarchical", # Hierarchical process type
Loaded 100 of 657 files, more files were not shown because too many files have changed in this diff. Show more