Compare commits

..
Author SHA1 Message Date
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
1393 changed files with 15151 additions and 186182 deletions

No files matched your search

-145
View File
@@ -1,145 +0,0 @@
name: Performance Benchmarks
on:
workflow_dispatch:
inputs:
iterations:
description: 'Number of benchmark iterations'
required: false
default: '100'
fail_on_regression:
description: 'Fail if performance regresses'
required: false
default: 'true'
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e src/praisonai-agents[all]
pip install agno crewai langgraph
- name: Run Import Time Benchmark
id: import_time
run: |
cd src/praisonai-agents
python benchmarks/import_time.py 2>&1 | tee import_time_output.txt
# Extract import time
IMPORT_TIME=$(grep -oP 'Median:\s+\K[\d.]+' import_time_output.txt || echo "0")
echo "import_time=$IMPORT_TIME" >> $GITHUB_OUTPUT
# Check threshold (200ms)
if (( $(echo "$IMPORT_TIME > 200" | bc -l) )); then
echo "::warning::Import time ${IMPORT_TIME}ms exceeds 200ms threshold"
if [ "${{ inputs.fail_on_regression }}" == "true" ]; then
echo "import_passed=false" >> $GITHUB_OUTPUT
fi
else
echo "import_passed=true" >> $GITHUB_OUTPUT
fi
- name: Run Memory Usage Benchmark
id: memory
run: |
cd src/praisonai-agents
python benchmarks/memory_usage.py 2>&1 | tee memory_output.txt
# Extract peak memory
PEAK_MEMORY=$(grep -oP 'Peak:\s+\K[\d.]+' memory_output.txt || echo "0")
echo "peak_memory=$PEAK_MEMORY" >> $GITHUB_OUTPUT
# Check threshold (30MB)
if (( $(echo "$PEAK_MEMORY > 30" | bc -l) )); then
echo "::warning::Memory usage ${PEAK_MEMORY}MB exceeds 30MB threshold"
if [ "${{ inputs.fail_on_regression }}" == "true" ]; then
echo "memory_passed=false" >> $GITHUB_OUTPUT
fi
else
echo "memory_passed=true" >> $GITHUB_OUTPUT
fi
- name: Run Simple Benchmark
id: simple
run: |
cd src/praisonai-agents
python benchmarks/simple_benchmark.py 2>&1 | tee simple_output.txt
# Extract PraisonAI time
PRAISON_TIME=$(grep -oP 'PraisonAI\s+\K[\d.]+' simple_output.txt | head -1 || echo "0")
echo "praison_time=$PRAISON_TIME" >> $GITHUB_OUTPUT
- name: Run Tools Benchmark
id: tools
run: |
cd src/praisonai-agents
python benchmarks/tools_benchmark.py 2>&1 | tee tools_output.txt
# Extract PraisonAI time with tools
PRAISON_TOOLS_TIME=$(grep -oP 'PraisonAI\s+\K[\d.]+' tools_output.txt | head -1 || echo "0")
echo "praison_tools_time=$PRAISON_TOOLS_TIME" >> $GITHUB_OUTPUT
- name: Run Parameter Impact Benchmark
id: param_impact
run: |
cd src/praisonai-agents
python benchmarks/param_impact_benchmark.py --no-save --iterations ${{ inputs.iterations }} 2>&1 | tee param_impact_output.txt
- name: Check Lazy Imports
id: lazy_imports
run: |
cd src/praisonai-agents
python -c "
import sys
from praisonaiagents import Agent
agent = Agent(name='Test', output='silent')
# Check litellm is NOT loaded
if 'litellm' in sys.modules:
print('FAIL: litellm loaded during silent agent creation')
exit(1)
else:
print('PASS: litellm not loaded (lazy import working)')
"
- name: Generate Benchmark Summary
if: always()
run: |
echo "## Performance Benchmark Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Metric | Value | Threshold | Status |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|-----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Import Time | ${{ steps.import_time.outputs.import_time }}ms | <200ms | ${{ steps.import_time.outputs.import_passed == 'true' && '✅' || '❌' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Peak Memory | ${{ steps.memory.outputs.peak_memory }}MB | <30MB | ${{ steps.memory.outputs.memory_passed == 'true' && '✅' || '❌' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Agent Instantiation | ${{ steps.simple.outputs.praison_time }}μs | - | ℹ️ |" >> $GITHUB_STEP_SUMMARY
echo "| Agent with Tools | ${{ steps.tools.outputs.praison_tools_time }}μs | - | ℹ️ |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Lazy Import Check" >> $GITHUB_STEP_SUMMARY
echo "✅ litellm not loaded during silent agent creation" >> $GITHUB_STEP_SUMMARY
- name: Fail on Regression
if: inputs.fail_on_regression == 'true'
run: |
if [ "${{ steps.import_time.outputs.import_passed }}" == "false" ]; then
echo "::error::Import time regression detected"
exit 1
fi
if [ "${{ steps.memory.outputs.memory_passed }}" == "false" ]; then
echo "::error::Memory usage regression detected"
exit 1
fi
echo "All performance checks passed!"
-204
View File
@@ -1,204 +0,0 @@
name: Windows Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
jobs:
test-windows:
runs-on: windows-latest
timeout-minutes: 5
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL_NAME: gpt-4o-mini
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install praisonaiagents
run: |
python -m pip install --upgrade pip
cd src/praisonai-agents
pip install .
shell: bash
- name: Install praisonai wrapper
run: |
cd src/praisonai
pip install .[dev]
shell: bash
# ==================== CORE IMPORTS ====================
- name: Test core imports
run: |
python -c "from praisonaiagents import Agent, Agents, Workflow; print('Core imports OK')"
python -c "from praisonaiagents import tool, Tools; print('Tool imports OK')"
python -c "from praisonaiagents import Task, WorkflowStep; print('Task/Step imports OK')"
# ==================== AGENT FEATURES ====================
- name: Test Agent instantiation
run: |
python -c "
from praisonaiagents import Agent
a = Agent(name='Test', instructions='You are helpful')
print('Agent created:', a.name)
a2 = Agent(name='ToolAgent', instructions='Use tools', tools=[])
print('Agent with tools:', a2.name)
"
- name: Test Agents orchestration
run: |
python -c "
from praisonaiagents import Agent, Agents, Task
a1 = Agent(name='Agent1', instructions='First agent')
a2 = Agent(name='Agent2', instructions='Second agent')
t = Task(description='Do something', agent=a1)
agents = Agents(agents=[a1, a2], tasks=[t])
print('Agents:', len(agents.agents), 'Tasks:', len(agents.tasks))
"
# ==================== WORKFLOW FEATURES ====================
- name: Test Workflow and WorkflowStep
run: |
python -c "
from praisonaiagents import Workflow, WorkflowStep
from praisonaiagents.workflows import WorkflowOutputConfig
w = Workflow(name='test')
s1 = WorkflowStep(name='step1')
s2 = WorkflowStep(name='step2', context=['step1'])
print('Workflow:', w.name)
print('Steps:', s1.name, s2.name)
cfg = WorkflowOutputConfig(verbose=True, stream=False)
w2 = Workflow(name='configured', output=cfg)
print('Configured workflow verbose:', w2.verbose)
"
# ==================== MEMORY FEATURES ====================
- name: Test Memory classes
run: |
python -c "
from praisonaiagents.memory import FileMemory
from praisonaiagents.config import MemoryConfig
cfg = MemoryConfig(backend='file', user_id='test_user')
print('MemoryConfig backend:', cfg.backend)
mem = FileMemory(user_id='test_user', base_path='.praison/test_memory')
print('FileMemory user:', mem.user_id)
"
# ==================== TOOL DECORATOR ====================
- name: Test tool decorator
run: |
python -c "
from praisonaiagents import tool
@tool
def my_tool(query: str) -> str:
'''A test tool'''
return f'Echo: {query}'
result = my_tool('hello')
print('Tool result:', result)
"
# ==================== CONFIG CLASSES ====================
- name: Test config classes
run: |
python -c "
from praisonaiagents.config import OutputConfig, ExecutionConfig, PlanningConfig
out_cfg = OutputConfig(verbose=True, stream=True)
print('OutputConfig verbose:', out_cfg.verbose)
exec_cfg = ExecutionConfig(max_iter=50, max_retry_limit=5)
print('ExecutionConfig max_iter:', exec_cfg.max_iter)
plan_cfg = PlanningConfig(reasoning=True, auto_approve=False)
print('PlanningConfig reasoning:', plan_cfg.reasoning)
"
# ==================== HANDOFF ====================
- name: Test Handoff
run: |
python -c "
from praisonaiagents import Handoff, handoff, Agent
a1 = Agent(name='Agent1', instructions='First')
a2 = Agent(name='Agent2', instructions='Second')
# Using Handoff class directly
h = Handoff(agent=a2)
print('Handoff tool name:', h.tool_name)
# Using handoff function
h2 = handoff(a1, tool_name_override='custom_handoff')
print('Custom handoff name:', h2.tool_name)
"
# ==================== ASYNC FEATURES ====================
- name: Test async imports
run: |
python -c "
import asyncio
from praisonaiagents import Agent
async def test_async():
agent = Agent(name='AsyncAgent', instructions='Test')
assert hasattr(agent, 'arun'), 'Missing arun'
assert hasattr(agent, 'astart'), 'Missing astart'
print('Async methods available')
asyncio.run(test_async())
"
# ==================== CLI COMMANDS ====================
- name: Test CLI help
run: praisonai --help
- name: Test CLI session list
run: praisonai session list
continue-on-error: true
- name: Test CLI queue list
run: praisonai queue list
continue-on-error: true
# ==================== REAL API TESTS ====================
- name: Real API test - Agent run
if: env.OPENAI_API_KEY != ''
run: |
python -c "
from praisonaiagents import Agent
agent = Agent(name='TestAgent', instructions='Reply with exactly: WINDOWS_OK', llm='gpt-4o-mini')
result = agent.run('Say WINDOWS_OK')
print('Result:', result)
print('Real API test passed')
"
- name: Real API test - Multi-agent
if: env.OPENAI_API_KEY != ''
run: |
python -c "
from praisonaiagents import Agent, Agents, Task
researcher = Agent(name='Researcher', instructions='You research topics', llm='gpt-4o-mini')
writer = Agent(name='Writer', instructions='You write content', llm='gpt-4o-mini')
task = Task(description='Say hello world', agent=researcher)
agents = Agents(agents=[researcher, writer], tasks=[task])
result = agents.start()
print('Multi-agent result type:', type(result))
print('Multi-agent test passed')
"
@@ -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 -9
View File
@@ -83,12 +83,4 @@ issue_details.json
# MCP Registry tokens
.mcpregistry_*
*.log
.internal
.praisonai
# Rust / Cargo
target/
Cargo.lock
**/*.rs.bk
*.pdb
*.log
+2 -1
View File
@@ -23,7 +23,7 @@
</div>
PraisonAI is a production-ready Multi-AI Agents framework with self-reflection, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. It provides a low-code solution to streamline the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.
PraisonAI is a production-ready Multi-AI Agents framework with self-reflection, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. By integrating PraisonAI Agents, AG2 (Formerly AutoGen), and CrewAI into a low-code solution, it streamlines the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.
<div align="center">
<a href="https://docs.praison.ai">
@@ -137,6 +137,7 @@ PraisonAI Agents is the **fastest AI agent framework** for agent instantiation.
| PraisonAI (LiteLLM) | 7.56 | 2.00x |
| PydanticAI | 226.94 | 60.16x |
| LangGraph | 4,558.71 | 1,209x |
| CrewAI | 15,607.92 | 4,138x |
<details>
<summary>Run benchmarks yourself</summary>
+155 -427
View File
@@ -23,12 +23,12 @@ Methods:
Types:
```python
from praisonaiagents import Agent, AutoAgents, AutoRagAgent, ContextAgent, DeepResearchAgent, ImageAgent, PlanningAgent, PromptExpanderAgent, QueryRewriterAgent, create_context_agent
from praisonaiagents import Agent, Agents, AutoAgents, AutoRagAgent, ContextAgent, DeepResearchAgent, ImageAgent, PraisonAIAgents, PromptExpanderAgent, QueryRewriterAgent, create_context_agent
```
Methods:
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">achat</a>(prompt: str, temperature = 1.0, tools = None, output_json = None, output_pydantic = None, reasoning_steps = False, task_name = None, task_description = None, task_id = None, attachments = None)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">achat</a>(prompt: str, temperature = 1.0, tools = None, output_json = None, output_pydantic = None, reasoning_steps = False, task_name = None, task_description = None, task_id = None)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">aexecute</a>(task, context = None)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">agent_id</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">analyze_prompt</a>(prompt: str) -> set</code>
@@ -38,7 +38,7 @@ Methods:
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">auto_memory</a>(value)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">background</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">background</a>(value)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">chat</a>(prompt, temperature = 1.0, tools = None, output_json = None, output_pydantic = None, reasoning_steps = False, stream = None, task_name = None, task_description = None, task_id = None, config = None, force_retrieval = False, skip_retrieval = False, attachments = None, tool_choice = None)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">chat</a>(prompt, temperature = 1.0, tools = None, output_json = None, output_pydantic = None, reasoning_steps = False, stream = None, task_name = None, task_description = None, task_id = None, config = None, force_retrieval = False, skip_retrieval = False)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">chat_with_context</a>(message: str, context: 'ContextPack', **kwargs) -> str</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">checkpoints</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">checkpoints</a>(value)</code>
@@ -47,32 +47,25 @@ Methods:
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">console</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">context_manager</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">context_manager</a>(value)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">delete_history</a>(index: int) -> bool</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">delete_history_matching</a>(pattern: str) -> int</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">display_name</a>() -> str</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">ephemeral</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">display_generating</a>(content: str, start_time: float)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">execute</a>(task, context = None)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">execute_tool</a>(function_name, arguments)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">execute_tool_async</a>(function_name: str, arguments: Dict[str, Any]) -> Any</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">from_template</a>(uri: str, config: Optional[Dict[str, Any]] = None, offline: bool = False, **kwargs) -> 'Agent'</code>
* <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>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">get_skills_prompt</a>() -> str</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">handoff_to</a>(target_agent: 'Agent', prompt: str, context: Optional[Dict[str, Any]] = None, config: Optional['HandoffConfig'] = None) -> 'HandoffResult'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">handoff_to_async</a>(target_agent: 'Agent', prompt: str, context: Optional[Dict[str, Any]] = None, config: Optional['HandoffConfig'] = None) -> 'HandoffResult'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">iter_stream</a>(prompt: str, **kwargs)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">launch</a>(path: str = '/', port: int = 8000, host: str = '0.0.0.0', debug: bool = False, protocol: str = 'http')</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">llm_model</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">output_style</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">output_style</a>(value)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">policy</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">policy</a>(value)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">prune_history</a>(keep_last: int = 5) -> int</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">query</a>(question: str, **kwargs) -> 'RAGResult'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">rag</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">rag_query</a>(question: str, **kwargs) -> 'RAGResult'</code>
@@ -80,42 +73,70 @@ Methods:
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">retrieve</a>(query: str, **kwargs) -> 'ContextPack'</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">rules_manager</a>()</code>
* <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">run_autonomous</a>(prompt: str, max_iterations: Optional[int] = None, timeout_seconds: Optional[float] = None)</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>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">start</a>(prompt: str, **kwargs)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">store_memory</a>(content: str, memory_type: str = 'short_term', **kwargs)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">stream_emitter</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">stream_emitter</a>(value)</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">switch_model</a>(new_model: str) -> None</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">thinking_budget</a>()</code>
* <code title="class Agent">Agent.<a href="./src/praisonai-agents/praisonaiagents/agent/agent.py">thinking_budget</a>(value)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">add_task</a>(task)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">aexecute_task</a>(task_id)</code>
* <code title="class Agents">Agents.<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 Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_all_tasks</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_task</a>(task_id)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">astart</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clean_json_output</a>(output: str) -> str</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clear_state</a>() -> None</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">context_manager</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">current_plan</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">default_completion_checker</a>(task, agent_output)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">delete_state</a>(key: str) -> bool</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">display_token_usage</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">execute_task</a>(task_id)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_agent_details</a>(agent_name)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_state</a>() -> Dict[str, Any]</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_tasks_status</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_detailed_token_report</a>() -> Dict[str, Any]</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_plan_markdown</a>() -> str</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_state</a>(key: str, default: Any = None) -> Any</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_details</a>(task_id)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_result</a>(task_id)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_status</a>(task_id)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_todo_markdown</a>() -> str</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_token_usage_summary</a>() -> Dict[str, Any]</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">has_state</a>(key: str) -> bool</code>
* <code title="class Agents">Agents.<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 Agents">Agents.<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 Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">restore_session_state</a>(session_id: str) -> bool</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_all_tasks</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_task</a>(task_id)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">save_output_to_file</a>(task, task_output)</code>
* <code title="class Agents">Agents.<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 Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">set_state</a>(key: str, value: Any) -> None</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">start</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">todo_list</a>()</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_plan_step_status</a>(step_id: str, status: str) -> bool</code>
* <code title="class Agents">Agents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_state</a>(updates: Dict) -> None</code>
* <code title="class AutoAgents">AutoAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/autoagents.py">astart</a>()</code>
* <code title="class AutoAgents">AutoAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/autoagents.py">start</a>()</code>
* <code title="class AutoRagAgent">AutoRagAgent.<a href="./src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py">achat</a>(message: str, **kwargs) -> str</code>
* <code title="class AutoRagAgent">AutoRagAgent.<a href="./src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py">chat</a>(message: str, **kwargs) -> str</code>
* <code title="class AutoRagAgent">AutoRagAgent.<a href="./src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py">name</a>() -> str</code>
* <code title="class AutoRagAgent">AutoRagAgent.<a href="./src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py">rag</a>() -> Optional['RAG']</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">aanalyze_codebase</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">acreate_implementation_blueprint</a>(feature_request: str, context_analysis: Optional[Dict[str, Any]] = None) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">agenerate_prp</a>(feature_request: str, context_analysis: Optional[Dict[str, Any]] = None) -> str</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">analyze_codebase</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">analyze_codebase_with_gitingest</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">analyze_integration_points</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">analyze_test_patterns</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">build_implementation_blueprint</a>(feature_request: str, context_analysis: Dict[str, Any] = None) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">compile_context_documentation</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">create_implementation_blueprint</a>(feature_request: str, context_analysis: Optional[Dict[str, Any]] = None) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">create_quality_gates</a>(requirements: List[str]) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">create_validation_framework</a>(project_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">execute_prp</a>(prp_file_path: str) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">extract_implementation_patterns</a>(project_path: str, ast_analysis: Dict[str, Any] = None) -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">generate_comprehensive_prp</a>(feature_request: str, context_analysis: Dict[str, Any] = None) -> str</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">generate_feature_prp</a>(feature_request: str) -> str</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">generate_prp</a>(feature_request: str, context_analysis: Optional[Dict[str, Any]] = None) -> str</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">get_agent_interaction_summary</a>() -> Dict[str, Any]</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">log_debug</a>(message: str, **kwargs)</code>
* <code title="class ContextAgent">ContextAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/context_agent.py">perform_ast_analysis</a>(project_path: str) -> Dict[str, Any]</code>
@@ -133,23 +154,49 @@ Methods:
* <code title="class DeepResearchAgent">DeepResearchAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/deep_research_agent.py">research</a>(query: str, instructions: Optional[str] = None, model: Optional[str] = None, summary_mode: Optional[Literal['auto', 'detailed', 'concise']] = None, web_search: Optional[bool] = None, code_interpreter: Optional[bool] = None, mcp_servers: Optional[List[Dict[str, Any]]] = None, file_ids: Optional[List[str]] = None, file_search: Optional[bool] = None, file_search_stores: Optional[List[str]] = None, stream: bool = True) -> DeepResearchResponse</code>
* <code title="class DeepResearchAgent">DeepResearchAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/deep_research_agent.py">rewrite_query</a>(query: str, model: Optional[str] = None) -> str</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">achat</a>(prompt: str, temperature: float = 0.2, tools: Optional[List[Any]] = None, output_json: Optional[str] = None, output_pydantic: Optional[Any] = None, reasoning_steps: bool = False, **kwargs) -> Union[str, Dict[str, Any]]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">aedit</a>(image: str, prompt: str, mask: Optional[str] = None, n: int = 1, size: Optional[str] = None, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">agenerate</a>(prompt: str, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">agenerate_image</a>(prompt: str, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">avariation</a>(image: str, n: int = 1, size: Optional[str] = None, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">chat</a>(prompt: str, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">edit</a>(image: str, prompt: str, mask: Optional[str] = None, n: int = 1, size: Optional[str] = None, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">generate</a>(prompt: str, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">generate_image</a>(prompt: str, **kwargs) -> Dict[str, Any]</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">litellm</a>()</code>
* <code title="class ImageAgent">ImageAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/image_agent.py">variation</a>(image: str, n: int = 1, size: Optional[str] = None, **kwargs) -> Dict[str, Any]</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">analyze_context</a>(context: str) -> str</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">analyze_context_sync</a>(context: str) -> str</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">create_plan</a>(request: str, agents: List['Agent'], tasks: Optional[List['Task']] = None, context: Optional[str] = None) -> Plan</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">create_plan_sync</a>(request: str, agents: List['Agent'], tasks: Optional[List['Task']] = None, context: Optional[str] = None) -> Plan</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">is_tool_allowed</a>(tool_name: str) -> bool</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">refine_plan</a>(plan: Plan, feedback: str) -> Plan</code>
* <code title="class PlanningAgent">PlanningAgent.<a href="./src/praisonai-agents/praisonaiagents/planning/planner.py">refine_plan_sync</a>(plan: Plan, feedback: str) -> Plan</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">add_task</a>(task)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">aexecute_task</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<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 PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_all_tasks</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">arun_task</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">astart</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clean_json_output</a>(output: str) -> str</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">clear_state</a>() -> None</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">context_manager</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">current_plan</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">default_completion_checker</a>(task, agent_output)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">delete_state</a>(key: str) -> bool</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">display_token_usage</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">execute_task</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_agent_details</a>(agent_name)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_state</a>() -> Dict[str, Any]</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_all_tasks_status</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_detailed_token_report</a>() -> Dict[str, Any]</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_plan_markdown</a>() -> str</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_state</a>(key: str, default: Any = None) -> Any</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_details</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_result</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_task_status</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_todo_markdown</a>() -> str</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">get_token_usage_summary</a>() -> Dict[str, Any]</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">has_state</a>(key: str) -> bool</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<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 PraisonAIAgents">PraisonAIAgents.<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 PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">restore_session_state</a>(session_id: str) -> bool</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_all_tasks</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">run_task</a>(task_id)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">save_output_to_file</a>(task, task_output)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<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 PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">set_state</a>(key: str, value: Any) -> None</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">start</a>(content = None, return_dict = False, **kwargs)</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">todo_list</a>()</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_plan_step_status</a>(step_id: str, status: str) -> bool</code>
* <code title="class PraisonAIAgents">PraisonAIAgents.<a href="./src/praisonai-agents/praisonaiagents/agents/agents.py">update_state</a>(updates: Dict) -> None</code>
* <code title="class PromptExpanderAgent">PromptExpanderAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/prompt_expander_agent.py">agent</a>()</code>
* <code title="class PromptExpanderAgent">PromptExpanderAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/prompt_expander_agent.py">expand</a>(prompt: str, strategy: ExpandStrategy = ..., context: Optional[str] = None) -> ExpandResult</code>
* <code title="class PromptExpanderAgent">PromptExpanderAgent.<a href="./src/praisonai-agents/praisonaiagents/agent/prompt_expander_agent.py">expand_basic</a>(prompt: str, context: Optional[str] = None) -> ExpandResult</code>
@@ -188,14 +235,12 @@ 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>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">list_tools</a>() -> List[str]</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">register</a>(tool: Union[BaseTool, Callable], name: Optional[str] = None, overwrite: bool = False) -> None</code>
* <code title="class ToolRegistry">ToolRegistry.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">unregister</a>(name: str) -> bool</code>
* <code title="class Tools">Tools.<a href="./src/praisonai-agents/praisonaiagents/tools/tools.py">internet_search</a>(*args, **kwargs)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">get_registry</a>() -> ToolRegistry</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">get_tool</a>(name: str) -> Optional[Union[BaseTool, Callable]]</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/tools/registry.py">register_tool</a>(tool: Union[BaseTool, Callable], name: Optional[str] = None) -> None</code>
@@ -206,21 +251,44 @@ 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, WorkflowStep, 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="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="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 WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">async_execution</a>() -> bool</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">branch_condition</a>() -> Optional[Dict[str, List[str]]]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">context_from</a>() -> Optional[List[str]]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">evaluator</a>()</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">executor</a>()</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">max_retries</a>() -> int</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">next_steps</a>() -> Optional[List[str]]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">on_error</a>() -> str</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">output_file</a>() -> Optional[str]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">output_json</a>() -> Optional[Any]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">output_pydantic</a>() -> Optional[Any]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">output_variable</a>() -> Optional[str]</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">quality_check</a>() -> bool</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">rerun</a>() -> bool</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">retain_full_context</a>() -> bool</code>
* <code title="class WorkflowStep">WorkflowStep.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">loop</a>(step: Any, over: Optional[str] = None, from_csv: Optional[str] = None, from_file: Optional[str] = None, var_name: str = 'item') -> 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>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">route</a>(routes: Dict[str, List], default: Optional[List] = None) -> Route</code>
@@ -236,7 +304,7 @@ from praisonaiagents import db
Types:
```python
from praisonaiagents import Memory, MemoryBackend, MemoryConfig
from praisonaiagents import Memory
```
Methods:
@@ -244,15 +312,8 @@ Methods:
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">build_context_for_task</a>(task_descr: str, user_id: Optional[str] = None, additional: str = '', max_items: int = 3, include_in_output: Optional[bool] = None) -> str</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">calculate_quality_metrics</a>(output: str, expected_output: str, llm: Optional[str] = None, custom_prompt: Optional[str] = None) -> Dict[str, float]</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">compute_quality_score</a>(completeness: float, relevance: float, clarity: float, accuracy: float, weights: Dict[str, float] = None) -> float</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">delete_long_term</a>(memory_id: str) -> bool</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">delete_memories</a>(memory_ids: List[str]) -> int</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">delete_memories_matching</a>(query: str, memory_type: Optional[str] = None, limit: int = 10) -> int</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">delete_memory</a>(memory_id: str, memory_type: Optional[str] = None) -> bool</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">delete_short_term</a>(memory_id: str) -> bool</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">finalize_task_output</a>(content: str, agent_name: str, quality_score: float, threshold: float = 0.7, metrics: Dict[str, Any] = None, task_id: str = None)</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">get_all_memories</a>() -> List[Dict[str, Any]]</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">get_learn_context</a>() -> str</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">learn</a>()</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">reset_all</a>()</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">reset_entity_only</a>()</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">reset_long_term</a>()</code>
@@ -269,13 +330,12 @@ Methods:
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">store_quality</a>(text: str, quality_score: float, task_id: Optional[str] = None, iteration: Optional[int] = None, metrics: Optional[Dict[str, float]] = None, memory_type: Literal['short', 'long'] = 'long') -> None</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">store_short_term</a>(text: str, metadata: Dict[str, Any] = None, completeness: float = None, relevance: float = None, clarity: float = None, accuracy: float = None, weights: Dict[str, float] = None, evaluator_quality: float = None)</code>
* <code title="class Memory">Memory.<a href="./src/praisonai-agents/praisonaiagents/memory/memory.py">store_user_memory</a>(user_id: str, text: str, extra: Dict[str, Any] = None)</code>
* <code title="class MemoryConfig">MemoryConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
# Knowledge
Types:
```python
from praisonaiagents import Chunking, ChunkingStrategy, Knowledge, KnowledgeConfig
from praisonaiagents import Chunking, Knowledge
```
Methods:
@@ -302,21 +362,16 @@ Methods:
* <code title="class Knowledge">Knowledge.<a href="./src/praisonai-agents/praisonaiagents/knowledge/knowledge.py">search</a>(query, user_id = None, agent_id = None, run_id = None, rerank = None, **kwargs)</code>
* <code title="class Knowledge">Knowledge.<a href="./src/praisonai-agents/praisonaiagents/knowledge/knowledge.py">store</a>(content, user_id = None, agent_id = None, run_id = None, metadata = None)</code>
* <code title="class Knowledge">Knowledge.<a href="./src/praisonai-agents/praisonaiagents/knowledge/knowledge.py">update</a>(memory_id, data)</code>
* <code title="class KnowledgeConfig">KnowledgeConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
# RAG
Types:
```python
from praisonaiagents import CitationsMode, ContextPack, RAG, RAGCitation, RAGConfig, RAGResult, RetrievalConfig, RetrievalPolicy
from praisonaiagents import RAG, RAGCitation, RAGConfig, RAGResult
```
Methods:
* <code title="class ContextPack">ContextPack.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">format_for_prompt</a>(include_sources: bool = True) -> str</code>
* <code title="class ContextPack">ContextPack.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">from_dict</a>(data: Dict[str, Any]) -> 'ContextPack'</code>
* <code title="class ContextPack">ContextPack.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">has_citations</a>() -> bool</code>
* <code title="class ContextPack">ContextPack.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class RAG">RAG.<a href="./src/praisonai-agents/praisonaiagents/rag/pipeline.py">aquery</a>(question: str, user_id: Optional[str] = None, agent_id: Optional[str] = None, run_id: Optional[str] = None, **kwargs) -> RAGResult</code>
* <code title="class RAG">RAG.<a href="./src/praisonai-agents/praisonaiagents/rag/pipeline.py">aretrieve</a>(query: str, **kwargs) -> ContextPack</code>
* <code title="class RAG">RAG.<a href="./src/praisonai-agents/praisonaiagents/rag/pipeline.py">astream</a>(question: str, user_id: Optional[str] = None, agent_id: Optional[str] = None, run_id: Optional[str] = None, **kwargs) -> AsyncIterator[str]</code>
@@ -333,13 +388,6 @@ Methods:
* <code title="class RAGResult">RAGResult.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">from_dict</a>(data: Dict[str, Any]) -> 'RAGResult'</code>
* <code title="class RAGResult">RAGResult.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">has_citations</a>() -> bool</code>
* <code title="class RAGResult">RAGResult.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">from_dict</a>(data: Dict[str, Any]) -> 'RetrievalConfig'</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">get_strategy</a>(corpus_stats = None)</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">get_token_budget</a>(model_name: Optional[str] = None)</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">should_retrieve</a>(query: str, force: bool = False, skip: bool = False) -> bool</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">to_knowledge_config</a>() -> Dict[str, Any]</code>
* <code title="class RetrievalConfig">RetrievalConfig.<a href="./src/praisonai-agents/praisonaiagents/rag/retrieval_config.py">to_rag_config</a>() -> Dict[str, Any]</code>
# Handoff
@@ -367,97 +415,18 @@ Methods:
Types:
```python
from praisonaiagents import GuardrailAction, GuardrailConfig, LLMGuardrail
from praisonaiagents import LLMGuardrail
```
Methods:
* <code title="class GuardrailConfig">GuardrailConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class LLMGuardrail">LLMGuardrail.<a href="./src/praisonai-agents/praisonaiagents/guardrails/llm_guardrail.py">__call__</a>(task_output: TaskOutput) -> Tuple[bool, Union[str, TaskOutput]]</code>
# Planning
Types:
```python
from praisonaiagents import ApprovalCallback, Plan, PlanStep, PlanStorage, PlanningConfig, READ_ONLY_TOOLS, RESTRICTED_TOOLS, TodoItem, TodoList
```
Methods:
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">__call__</a>(plan: 'Plan') -> bool</code>
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">always_approve</a>(plan: 'Plan') -> bool</code>
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">always_reject</a>(plan: 'Plan') -> bool</code>
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">approve_if_no_dangerous_tools</a>(plan: 'Plan') -> bool</code>
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">approve_if_small</a>(plan: 'Plan', max_steps: int = 5) -> bool</code>
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">async_call</a>(plan: 'Plan') -> bool</code>
* <code title="class ApprovalCallback">ApprovalCallback.<a href="./src/praisonai-agents/praisonaiagents/planning/approval.py">console_approval</a>(plan: 'Plan') -> bool</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">add_step</a>(step: PlanStep) -> None</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">approve</a>() -> None</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">cancel</a>() -> None</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">complete</a>() -> None</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">completed_step_ids</a>() -> List[str]</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">from_dict</a>(data: Dict[str, Any]) -> 'Plan'</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">from_markdown</a>(markdown: str) -> 'Plan'</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">get_next_steps</a>() -> List[PlanStep]</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">get_step</a>(step_id: str) -> Optional[PlanStep]</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">is_complete</a>() -> bool</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">progress</a>() -> float</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">remove_step</a>(step_id: str) -> bool</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">start_execution</a>() -> None</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">to_markdown</a>() -> str</code>
* <code title="class Plan">Plan.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">update_step_status</a>(step_id: str, status: str) -> bool</code>
* <code title="class PlanStep">PlanStep.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">from_dict</a>(data: Dict[str, Any]) -> 'PlanStep'</code>
* <code title="class PlanStep">PlanStep.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">is_ready</a>(completed_steps: List[str]) -> bool</code>
* <code title="class PlanStep">PlanStep.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">mark_complete</a>() -> None</code>
* <code title="class PlanStep">PlanStep.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">mark_in_progress</a>() -> None</code>
* <code title="class PlanStep">PlanStep.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">mark_skipped</a>() -> None</code>
* <code title="class PlanStep">PlanStep.<a href="./src/praisonai-agents/praisonaiagents/planning/plan.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">cleanup_old_plans</a>(keep_count: int = 10) -> int</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">delete_plan</a>(plan_id: str) -> bool</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">delete_todo</a>(name: str) -> bool</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">get_latest_plan</a>() -> Optional[Plan]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">list_plans</a>() -> List[Dict[str, Any]]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">list_todos</a>() -> List[str]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">load_plan</a>(plan_id: str) -> Optional[Plan]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">load_plan_from_file</a>(path: str) -> Optional[Plan]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">load_todo</a>(name: str = 'current') -> Optional[TodoList]</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">save_plan</a>(plan: Plan, filename: Optional[str] = None) -> str</code>
* <code title="class PlanStorage">PlanStorage.<a href="./src/praisonai-agents/praisonaiagents/planning/storage.py">save_todo</a>(todo: TodoList, name: str = 'current') -> str</code>
* <code title="class PlanningConfig">PlanningConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class TodoItem">TodoItem.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">complete</a>() -> None</code>
* <code title="class TodoItem">TodoItem.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">from_dict</a>(data: Dict[str, Any]) -> 'TodoItem'</code>
* <code title="class TodoItem">TodoItem.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">is_ready</a>(completed_ids: List[str]) -> bool</code>
* <code title="class TodoItem">TodoItem.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">reset</a>() -> None</code>
* <code title="class TodoItem">TodoItem.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">start</a>() -> None</code>
* <code title="class TodoItem">TodoItem.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">add</a>(item: Union[TodoItem, str]) -> TodoItem</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">complete</a>(item_id: str) -> bool</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">completed</a>() -> List[TodoItem]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">completed_ids</a>() -> List[str]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">from_dict</a>(data: Dict[str, Any]) -> 'TodoList'</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">from_json</a>(json_str: str) -> 'TodoList'</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">from_markdown</a>(markdown: str) -> 'TodoList'</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">from_plan</a>(plan: 'Plan') -> 'TodoList'</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">get</a>(item_id: str) -> Optional[TodoItem]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">get_ready_items</a>() -> List[TodoItem]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">in_progress</a>() -> List[TodoItem]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">is_complete</a>() -> bool</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">pending</a>() -> List[TodoItem]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">progress</a>() -> float</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">remove</a>(item_id: str) -> bool</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">start</a>(item_id: str) -> bool</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">sync_with_plan</a>(plan: 'Plan') -> None</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">to_json</a>() -> str</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">to_markdown</a>() -> str</code>
* <code title="class TodoList">TodoList.<a href="./src/praisonai-agents/praisonaiagents/planning/todo.py">update_from_plan</a>(plan: 'Plan') -> None</code>
# Skills
Types:
```python
from praisonaiagents import SkillLoader, SkillManager, SkillMetadata, SkillProperties, SkillsConfig
from praisonaiagents import SkillLoader, SkillManager, SkillMetadata, SkillProperties
```
Methods:
@@ -483,7 +452,6 @@ Methods:
* <code title="class SkillManager">SkillManager.<a href="./src/praisonai-agents/praisonaiagents/skills/manager.py">to_prompt</a>() -> str</code>
* <code title="class SkillMetadata">SkillMetadata.<a href="./src/praisonai-agents/praisonaiagents/skills/models.py">from_properties</a>(props: SkillProperties) -> 'SkillMetadata'</code>
* <code title="class SkillProperties">SkillProperties.<a href="./src/praisonai-agents/praisonaiagents/skills/models.py">to_dict</a>() -> dict</code>
* <code title="class SkillsConfig">SkillsConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
# Session
@@ -512,50 +480,15 @@ Methods:
* <code title="class Session">Session.<a href="./src/praisonai-agents/praisonaiagents/session/api.py">send_message</a>(message: str, **kwargs) -> str</code>
* <code title="class Session">Session.<a href="./src/praisonai-agents/praisonaiagents/session/api.py">set_state</a>(key: str, value: Any) -> None</code>
# MCP
Types:
```python
from praisonaiagents import MCP
```
Methods:
* <code title="class MCP">MCP.<a href="./src/praisonai-agents/praisonaiagents/mcp/mcp.py">get_tools</a>() -> List[Callable]</code>
* <code title="class MCP">MCP.<a href="./src/praisonai-agents/praisonaiagents/mcp/mcp.py">shutdown</a>()</code>
* <code title="class MCP">MCP.<a href="./src/praisonai-agents/praisonaiagents/mcp/mcp.py">to_openai_tool</a>()</code>
# Telemetry
Types:
```python
from praisonaiagents import MinimalTelemetry, TelemetryCollector, cleanup_telemetry_resources, disable_performance_mode, disable_telemetry, enable_performance_mode, enable_telemetry, get_telemetry
from praisonaiagents import get_telemetry
```
Methods:
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">flush</a>()</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">get_metrics</a>() -> Dict[str, Any]</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">shutdown</a>()</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">track_agent_execution</a>(agent_name: str = None, success: bool = True, async_mode: bool = False)</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">track_error</a>(error_type: str = None)</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">track_feature_usage</a>(feature_name: str)</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">track_task_completion</a>(task_name: str = None, success: bool = True)</code>
* <code title="class MinimalTelemetry">MinimalTelemetry.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">track_tool_usage</a>(tool_name: str, success: bool = True, execution_time: float = None)</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">get_metrics</a>() -> Dict[str, Any]</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">record_cost</a>(cost: float, model: str = None)</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">record_tokens</a>(prompt_tokens: int, completion_tokens: int, model: str = None)</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">start</a>()</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">stop</a>()</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">trace_agent_execution</a>(agent_name: str, **attributes)</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">trace_llm_call</a>(model: str = None, **attributes)</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">trace_task_execution</a>(task_name: str, agent_name: str = None, **attributes)</code>
* <code title="class TelemetryCollector">TelemetryCollector.<a href="./src/praisonai-agents/praisonaiagents/telemetry/telemetry.py">trace_tool_call</a>(tool_name: str, **attributes)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/telemetry/__init__.py">cleanup_telemetry_resources</a>()</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/telemetry/__init__.py">disable_performance_mode</a>()</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/telemetry/__init__.py">disable_telemetry</a>()</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/telemetry/__init__.py">enable_performance_mode</a>()</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/telemetry/__init__.py">enable_telemetry</a>()</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/telemetry/__init__.py">get_telemetry</a>() -> 'MinimalTelemetry'</code>
# Observability
@@ -576,13 +509,12 @@ Methods:
Types:
```python
from praisonaiagents import ContextManager
from praisonaiagents import ContextManager, ManagerConfig
```
Methods:
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">capture_llm_boundary</a>(messages: List[Dict[str, Any]], tools: List[Dict[str, Any]]) -> SnapshotHookData</code>
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">emergency_truncate</a>(messages: List[Dict[str, Any]], target_tokens: int) -> List[Dict[str, Any]]</code>
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">estimate_tokens</a>(text: str, validate: bool = False) -> Tuple[int, Optional[EstimationMetrics]]</code>
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">get_history</a>() -> List[Dict[str, Any]]</code>
* <code title="class ContextManager">ContextManager.<a href="./src/praisonai-agents/praisonaiagents/context/manager.py">get_last_snapshot_hook</a>() -> Optional[SnapshotHookData]</code>
@@ -594,33 +526,9 @@ 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>
# 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
```
Methods:
* <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>
* <code title="class HooksConfig">HooksConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class KnowledgeConfig">KnowledgeConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class MemoryConfig">MemoryConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class MultiAgentExecutionConfig">MultiAgentExecutionConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class MultiAgentHooksConfig">MultiAgentHooksConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class MultiAgentMemoryConfig">MultiAgentMemoryConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class MultiAgentOutputConfig">MultiAgentOutputConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class MultiAgentPlanningConfig">MultiAgentPlanningConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class OutputConfig">OutputConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class PlanningConfig">PlanningConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class ReflectionConfig">ReflectionConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class SkillsConfig">SkillsConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class TemplateConfig">TemplateConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class WebConfig">WebConfig.<a href="./src/praisonai-agents/praisonaiagents/config/feature_configs.py">to_dict</a>() -> Dict[str, Any]</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>
# Display
@@ -635,118 +543,39 @@ Methods:
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_error</a>(message: str, console = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_generating</a>(content: str = '', start_time: Optional[float] = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_instruction</a>(message: str, console = None, agent_name: str = None, agent_role: str = None, agent_tools: List[str] = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_interaction</a>(message, response, markdown = True, generation_time = None, console = None, agent_name = None, agent_role = None, agent_tools = None, task_name = None, task_description = None, task_id = None, metrics = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_interaction</a>(message, response, markdown = True, generation_time = None, console = None, agent_name = None, agent_role = None, agent_tools = None, task_name = None, task_description = None, task_id = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_self_reflection</a>(message: str, console = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_tool_call</a>(message: str, console = None, tool_name: str = None, tool_input: dict = None, tool_output: str = None, elapsed_time: float = None, success: bool = True)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">display_tool_call</a>(message: str, console = None, tool_name: str = None, tool_input: dict = None, tool_output: str = None)</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/main.py">register_display_callback</a>(display_type: str, callback_fn, is_async: bool = False)</code>
# Utilities
Types:
```python
from praisonaiagents import ArrayMode, is_policy_string, parse_policy_string, resolve, resolve_autonomy, resolve_caching, resolve_context, resolve_execution, resolve_guardrail_policies, resolve_guardrails, resolve_hooks, resolve_knowledge, resolve_memory, resolve_output, resolve_planning, resolve_reflection, resolve_routing, resolve_skills, resolve_web
```
Methods:
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/parse_utils.py">is_policy_string</a>(value: str) -> bool</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/parse_utils.py">parse_policy_string</a>(value: str) -> tuple</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve</a>(value: Any, param_name: str, config_class: Optional[Type] = None, presets: Optional[Dict[str, Any]] = None, default: Any = None, instance_check: Optional[Callable[[Any], bool]] = None, url_schemes: Optional[Dict[str, str]] = None, array_mode: Optional[str] = None, string_mode: Optional[str] = None) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_autonomy</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_caching</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_context</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_execution</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_guardrail_policies</a>(policies: list, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_guardrails</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_hooks</a>(value: Any, config_class: Optional[Type] = None) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_knowledge</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_memory</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_output</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_planning</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_reflection</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_routing</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_skills</a>(value: Any, config_class: Type) -> Any</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/config/param_resolver.py">resolve_web</a>(value: Any, config_class: Type) -> Any</code>
# Other
Types:
```python
from praisonaiagents import AgentAppConfig, AgentAppProtocol, AgentFlow, AgentManager, AgentOSConfig, AgentOSProtocol, AgentTeam, EmbeddingResult, aembedding, aembeddings, embedding, embeddings, get_dimensions
from praisonaiagents import AutoRagConfig, Citation, CodeExecutionStep, DeepResearchResponse, ExpandResult, ExpandStrategy, FileSearchCall, MCPCall, Provider, RagRetrievalPolicy, ReasoningStep, RewriteResult, RewriteStrategy, Task, WebSearchCall, warmup
```
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="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>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/embedding/embed.py">embeddings</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/dimensions.py">get_dimensions</a>(model_name: str) -> int</code>
* <code title="class AutoRagConfig">AutoRagConfig.<a href="./src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py">from_dict</a>(data: Dict[str, Any]) -> 'AutoRagConfig'</code>
* <code title="class AutoRagConfig">AutoRagConfig.<a href="./src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class Citation">Citation.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">from_dict</a>(data: Dict[str, Any]) -> 'Citation'</code>
* <code title="class Citation">Citation.<a href="./src/praisonai-agents/praisonaiagents/rag/models.py">to_dict</a>() -> Dict[str, Any]</code>
* <code title="class DeepResearchResponse">DeepResearchResponse.<a href="./src/praisonai-agents/praisonaiagents/agent/deep_research_agent.py">get_all_sources</a>() -> List[Dict[str, str]]</code>
* <code title="class DeepResearchResponse">DeepResearchResponse.<a href="./src/praisonai-agents/praisonaiagents/agent/deep_research_agent.py">get_citation_text</a>(citation: Citation) -> str</code>
* <code title="class RewriteResult">RewriteResult.<a href="./src/praisonai-agents/praisonaiagents/agent/query_rewriter_agent.py">all_queries</a>() -> List[str]</code>
* <code title="class RewriteResult">RewriteResult.<a href="./src/praisonai-agents/praisonaiagents/agent/query_rewriter_agent.py">primary_query</a>() -> str</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/__init__.py">warmup</a>(include_litellm: bool = False, include_openai: bool = True) -> dict</code>
# Wrapper (praisonai)
Types:
```python
from praisonai import AgentApp, AgentOS, CloudProvider, Deploy, DeployConfig, DeployType, PraisonAI, __version__
from praisonai import CloudProvider, Deploy, DeployConfig, DeployType, PraisonAI, __version__
```
# CLI
@@ -758,12 +587,7 @@ Methods:
* <code title="cli">praisonai agents create <a href="./src/praisonai/praisonai/cli/commands/agents.py">--help</a></code>
* <code title="cli">praisonai agents info <a href="./src/praisonai/praisonai/cli/commands/agents.py">--help</a></code>
* <code title="cli">praisonai agents list <a href="./src/praisonai/praisonai/cli/commands/agents.py">--help</a></code>
* <code title="cli">praisonai app app <a href="./src/praisonai/praisonai/cli/commands/app.py">--help</a></code>
* <code title="cli">praisonai audit agent-centric <a href="./src/praisonai/praisonai/cli/commands/audit.py">--help</a></code>
* <code title="cli">praisonai batch batch-run <a href="./src/praisonai/praisonai/cli/commands/batch.py">--help</a></code>
* <code title="cli">praisonai batch list <a href="./src/praisonai/praisonai/cli/commands/batch.py">--help</a></code>
* <code title="cli">praisonai batch report <a href="./src/praisonai/praisonai/cli/commands/batch.py">--help</a></code>
* <code title="cli">praisonai batch stats <a href="./src/praisonai/praisonai/cli/commands/batch.py">--help</a></code>
* <code title="cli">praisonai benchmark agent <a href="./src/praisonai/praisonai/cli/commands/benchmark.py">--help</a></code>
* <code title="cli">praisonai benchmark benchmark-callback <a href="./src/praisonai/praisonai/cli/commands/benchmark.py">--help</a></code>
* <code title="cli">praisonai benchmark cli <a href="./src/praisonai/praisonai/cli/commands/benchmark.py">--help</a></code>
@@ -772,19 +596,6 @@ Methods:
* <code title="cli">praisonai benchmark profile <a href="./src/praisonai/praisonai/cli/commands/benchmark.py">--help</a></code>
* <code title="cli">praisonai benchmark sdk <a href="./src/praisonai/praisonai/cli/commands/benchmark.py">--help</a></code>
* <code title="cli">praisonai benchmark workflow <a href="./src/praisonai/praisonai/cli/commands/benchmark.py">--help</a></code>
* <code title="cli">praisonai bot bot-callback <a href="./src/praisonai/praisonai/cli/commands/bot.py">--help</a></code>
* <code title="cli">praisonai bot discord <a href="./src/praisonai/praisonai/cli/commands/bot.py">--help</a></code>
* <code title="cli">praisonai bot slack <a href="./src/praisonai/praisonai/cli/commands/bot.py">--help</a></code>
* <code title="cli">praisonai bot telegram <a href="./src/praisonai/praisonai/cli/commands/bot.py">--help</a></code>
* <code title="cli">praisonai browser browser-callback <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser click <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser navigate <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser open <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser profiles <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser screenshot <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser snapshot <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser status <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai browser type <a href="./src/praisonai/praisonai/cli/commands/browser.py">--help</a></code>
* <code title="cli">praisonai call call-main <a href="./src/praisonai/praisonai/cli/commands/call.py">--help</a></code>
* <code title="cli">praisonai chat <a href="./src/praisonai/praisonai/cli/main.py">--help</a></code>
* <code title="cli">praisonai chat chat-main <a href="./src/praisonai/praisonai/cli/commands/chat.py">--help</a></code>
@@ -804,11 +615,8 @@ Methods:
* <code title="cli">praisonai context clear <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context compact <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context export <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context grep <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context list <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context show <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context stats <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai context tail <a href="./src/praisonai/praisonai/cli/commands/context.py">--help</a></code>
* <code title="cli">praisonai debug acp <a href="./src/praisonai/praisonai/cli/commands/debug.py">--help</a></code>
* <code title="cli">praisonai debug debug-callback <a href="./src/praisonai/praisonai/cli/commands/debug.py">--help</a></code>
* <code title="cli">praisonai debug interactive <a href="./src/praisonai/praisonai/cli/commands/debug.py">--help</a></code>
@@ -828,7 +636,6 @@ Methods:
* <code title="cli">praisonai docs run-all <a href="./src/praisonai/praisonai/cli/commands/docs.py">--help</a></code>
* <code title="cli">praisonai docs serve <a href="./src/praisonai/praisonai/cli/commands/docs.py">--help</a></code>
* <code title="cli">praisonai docs stats <a href="./src/praisonai/praisonai/cli/commands/docs.py">--help</a></code>
* <code title="cli">praisonai doctor cleanup <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai doctor config <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai doctor db <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai doctor doctor-callback <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
@@ -838,15 +645,12 @@ Methods:
* <code title="cli">praisonai doctor performance <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai doctor selftest <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai doctor tools <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai doctor troubleshoot <a href="./src/praisonai/praisonai/cli/commands/doctor.py">--help</a></code>
* <code title="cli">praisonai endpoints list <a href="./src/praisonai/praisonai/cli/commands/endpoints.py">--help</a></code>
* <code title="cli">praisonai endpoints test <a href="./src/praisonai/praisonai/cli/commands/endpoints.py">--help</a></code>
* <code title="cli">praisonai environment check <a href="./src/praisonai/praisonai/cli/commands/environment.py">--help</a></code>
* <code title="cli">praisonai environment doctor <a href="./src/praisonai/praisonai/cli/commands/environment.py">--help</a></code>
* <code title="cli">praisonai environment view <a href="./src/praisonai/praisonai/cli/commands/environment.py">--help</a></code>
* <code title="cli">praisonai eval accuracy <a href="./src/praisonai/praisonai/cli/commands/eval.py">--help</a></code>
* <code title="cli">praisonai eval judge <a href="./src/praisonai/praisonai/cli/commands/eval.py">--help</a></code>
* <code title="cli">praisonai eval list-judges <a href="./src/praisonai/praisonai/cli/commands/eval.py">--help</a></code>
* <code title="cli">praisonai eval performance <a href="./src/praisonai/praisonai/cli/commands/eval.py">--help</a></code>
* <code title="cli">praisonai examples info <a href="./src/praisonai/praisonai/cli/commands/examples.py">--help</a></code>
* <code title="cli">praisonai examples list <a href="./src/praisonai/praisonai/cli/commands/examples.py">--help</a></code>
@@ -861,43 +665,23 @@ Methods:
* <code title="cli">praisonai knowledge index <a href="./src/praisonai/praisonai/cli/commands/knowledge.py">--help</a></code>
* <code title="cli">praisonai knowledge list <a href="./src/praisonai/praisonai/cli/commands/knowledge.py">--help</a></code>
* <code title="cli">praisonai knowledge search <a href="./src/praisonai/praisonai/cli/commands/knowledge.py">--help</a></code>
* <code title="cli">praisonai loop help <a href="./src/praisonai/praisonai/cli/commands/loop.py">--help</a></code>
* <code title="cli">praisonai loop loop-main <a href="./src/praisonai/praisonai/cli/commands/loop.py">--help</a></code>
* <code title="cli">praisonai lsp logs <a href="./src/praisonai/praisonai/cli/commands/lsp.py">--help</a></code>
* <code title="cli">praisonai lsp lsp-callback <a href="./src/praisonai/praisonai/cli/commands/lsp.py">--help</a></code>
* <code title="cli">praisonai lsp start <a href="./src/praisonai/praisonai/cli/commands/lsp.py">--help</a></code>
* <code title="cli">praisonai lsp status <a href="./src/praisonai/praisonai/cli/commands/lsp.py">--help</a></code>
* <code title="cli">praisonai lsp stop <a href="./src/praisonai/praisonai/cli/commands/lsp.py">--help</a></code>
* <code title="cli">praisonai mcp add <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp auth <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp describe <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp list <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp logout <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp mcp-callback <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp remove <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp run <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp status <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp sync <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp test <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai mcp tools <a href="./src/praisonai/praisonai/cli/commands/mcp.py">--help</a></code>
* <code title="cli">praisonai memory add <a href="./src/praisonai/praisonai/cli/commands/memory.py">--help</a></code>
* <code title="cli">praisonai memory clear <a href="./src/praisonai/praisonai/cli/commands/memory.py">--help</a></code>
* <code title="cli">praisonai memory search <a href="./src/praisonai/praisonai/cli/commands/memory.py">--help</a></code>
* <code title="cli">praisonai memory show <a href="./src/praisonai/praisonai/cli/commands/memory.py">--help</a></code>
* <code title="cli">praisonai memory status <a href="./src/praisonai/praisonai/cli/commands/memory.py">--help</a></code>
* <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>
@@ -911,24 +695,11 @@ Methods:
* <code title="cli">praisonai rag query <a href="./src/praisonai/praisonai/cli/commands/rag.py">--help</a></code>
* <code title="cli">praisonai rag serve <a href="./src/praisonai/praisonai/cli/commands/rag.py">--help</a></code>
* <code title="cli">praisonai realtime realtime-main <a href="./src/praisonai/praisonai/cli/commands/realtime.py">--help</a></code>
* <code title="cli">praisonai recipe apply <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe create <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe info <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe install <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe judge <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe list <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe optimize <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe run <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai recipe serve <a href="./src/praisonai/praisonai/cli/commands/recipe.py">--help</a></code>
* <code title="cli">praisonai registry list <a href="./src/praisonai/praisonai/cli/commands/registry.py">--help</a></code>
* <code title="cli">praisonai registry serve <a href="./src/praisonai/praisonai/cli/commands/registry.py">--help</a></code>
* <code title="cli">praisonai replay cleanup <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai replay context <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai replay dashboard <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai replay delete <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai replay flow <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai replay list <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai replay show <a href="./src/praisonai/praisonai/cli/commands/replay.py">--help</a></code>
* <code title="cli">praisonai research research-main <a href="./src/praisonai/praisonai/cli/commands/research.py">--help</a></code>
* <code title="cli">praisonai retrieval index <a href="./src/praisonai/praisonai/cli/commands/retrieval.py">--help</a></code>
* <code title="cli">praisonai retrieval query <a href="./src/praisonai/praisonai/cli/commands/retrieval.py">--help</a></code>
@@ -938,11 +709,6 @@ Methods:
* <code title="cli">praisonai rules list <a href="./src/praisonai/praisonai/cli/commands/rules.py">--help</a></code>
* <code title="cli">praisonai run <a href="./src/praisonai/praisonai/cli/main.py">--help</a></code>
* <code title="cli">praisonai run run-main <a href="./src/praisonai/praisonai/cli/commands/run.py">--help</a></code>
* <code title="cli">praisonai sandbox explain <a href="./src/praisonai/praisonai/cli/commands/sandbox.py">--help</a></code>
* <code title="cli">praisonai sandbox list <a href="./src/praisonai/praisonai/cli/commands/sandbox.py">--help</a></code>
* <code title="cli">praisonai sandbox recreate <a href="./src/praisonai/praisonai/cli/commands/sandbox.py">--help</a></code>
* <code title="cli">praisonai sandbox sandbox-callback <a href="./src/praisonai/praisonai/cli/commands/sandbox.py">--help</a></code>
* <code title="cli">praisonai sandbox status <a href="./src/praisonai/praisonai/cli/commands/sandbox.py">--help</a></code>
* <code title="cli">praisonai schedule delete <a href="./src/praisonai/praisonai/cli/commands/schedule.py">--help</a></code>
* <code title="cli">praisonai schedule describe <a href="./src/praisonai/praisonai/cli/commands/schedule.py">--help</a></code>
* <code title="cli">praisonai schedule list <a href="./src/praisonai/praisonai/cli/commands/schedule.py">--help</a></code>
@@ -952,37 +718,19 @@ Methods:
* <code title="cli">praisonai schedule start <a href="./src/praisonai/praisonai/cli/commands/schedule.py">--help</a></code>
* <code title="cli">praisonai schedule stats <a href="./src/praisonai/praisonai/cli/commands/schedule.py">--help</a></code>
* <code title="cli">praisonai schedule stop <a href="./src/praisonai/praisonai/cli/commands/schedule.py">--help</a></code>
* <code title="cli">praisonai serve a2a <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve a2u <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve acp <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve agents <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve docs <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve gateway <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve lsp <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve mcp <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve rag <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve recipe <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve registry <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve scheduler <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve serve-callback <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve start <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve status <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve stop <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve ui <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai serve unified <a href="./src/praisonai/praisonai/cli/commands/serve.py">--help</a></code>
* <code title="cli">praisonai session delete <a href="./src/praisonai/praisonai/cli/commands/session.py">--help</a></code>
* <code title="cli">praisonai session export <a href="./src/praisonai/praisonai/cli/commands/session.py">--help</a></code>
* <code title="cli">praisonai session import <a href="./src/praisonai/praisonai/cli/commands/session.py">--help</a></code>
* <code title="cli">praisonai session list <a href="./src/praisonai/praisonai/cli/commands/session.py">--help</a></code>
* <code title="cli">praisonai session resume <a href="./src/praisonai/praisonai/cli/commands/session.py">--help</a></code>
* <code title="cli">praisonai session show <a href="./src/praisonai/praisonai/cli/commands/session.py">--help</a></code>
* <code title="cli">praisonai skills check <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills create <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills eligible <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills info <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills install <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills list <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills search <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai skills validate <a href="./src/praisonai/praisonai/cli/commands/skills.py">--help</a></code>
* <code title="cli">praisonai standardise check <a href="./src/praisonai/praisonai/cli/commands/standardise.py">--help</a></code>
* <code title="cli">praisonai standardise fix <a href="./src/praisonai/praisonai/cli/commands/standardise.py">--help</a></code>
@@ -991,7 +739,6 @@ Methods:
* <code title="cli">praisonai templates create <a href="./src/praisonai/praisonai/cli/commands/templates.py">--help</a></code>
* <code title="cli">praisonai templates list <a href="./src/praisonai/praisonai/cli/commands/templates.py">--help</a></code>
* <code title="cli">praisonai test info <a href="./src/praisonai/praisonai/cli/commands/test.py">--help</a></code>
* <code title="cli">praisonai test interactive <a href="./src/praisonai/praisonai/cli/commands/test.py">--help</a></code>
* <code title="cli">praisonai test run <a href="./src/praisonai/praisonai/cli/commands/test.py">--help</a></code>
* <code title="cli">praisonai todo add <a href="./src/praisonai/praisonai/cli/commands/todo.py">--help</a></code>
* <code title="cli">praisonai todo done <a href="./src/praisonai/praisonai/cli/commands/todo.py">--help</a></code>
@@ -999,17 +746,11 @@ Methods:
* <code title="cli">praisonai tools info <a href="./src/praisonai/praisonai/cli/commands/tools.py">--help</a></code>
* <code title="cli">praisonai tools list <a href="./src/praisonai/praisonai/cli/commands/tools.py">--help</a></code>
* <code title="cli">praisonai tools test <a href="./src/praisonai/praisonai/cli/commands/tools.py">--help</a></code>
* <code title="cli">praisonai tools validate <a href="./src/praisonai/praisonai/cli/commands/tools.py">--help</a></code>
* <code title="cli">praisonai traces disable <a href="./src/praisonai/praisonai/cli/commands/traces.py">--help</a></code>
* <code title="cli">praisonai traces enable <a href="./src/praisonai/praisonai/cli/commands/traces.py">--help</a></code>
* <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>
* <code title="cli">praisonai train train-callback <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
* <code title="cli">praisonai train train-main <a href="./src/praisonai/praisonai/cli/commands/train.py">--help</a></code>
* <code title="cli">praisonai ui chat <a href="./src/praisonai/praisonai/cli/commands/ui.py">--help</a></code>
* <code title="cli">praisonai ui code <a href="./src/praisonai/praisonai/cli/commands/ui.py">--help</a></code>
* <code title="cli">praisonai ui gradio <a href="./src/praisonai/praisonai/cli/commands/ui.py">--help</a></code>
@@ -1026,10 +767,8 @@ Methods:
Types/Exports:
```ts
export { Agent, AgentTeam, Agents, PraisonAIAgents, Router } from "./agent";
export type { AgentTeamConfig, PraisonAIAgentsConfig, SimpleAgentConfig, SimpleRouteConfig, SimpleRouterConfig } from "./agent";
export { AudioAgent, createAudioAgent } from "./agent/audio";
export type { AudioAgentConfig, AudioProvider, AudioSpeakOptions, AudioSpeakResult, AudioTranscribeOptions, AudioTranscribeResult } from "./agent/audio";
export { Agent, Agents, PraisonAIAgents, Router } from "./agent";
export type { PraisonAIAgentsConfig, SimpleAgentConfig, SimpleRouteConfig, SimpleRouterConfig } from "./agent";
export { ContextAgent, createContextAgent } from "./agent/context";
export { Handoff, handoff, handoffFilters } from "./agent/handoff";
export { ImageAgent, createImageAgent } from "./agent/image";
@@ -1051,8 +790,8 @@ export { // Agent loop
configureTelemetry, // Tool Approval (AI SDK v6 parity)
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";
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, 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, createAutoAgents } from "./auto";
export { BaseCache, FileCache, MemoryCache, createFileCache, createMemoryCache } from "./cache";
export { CLI_SPEC_VERSION, executeCommand, parseArgs } from "./cli";
export { // Autonomy Mode
@@ -1075,11 +814,9 @@ export type { DbAdapter, DbConfig, DbMessage, DbRun, DbTrace } from "./db";
export { MemoryPostgresAdapter, NeonPostgresAdapter, PostgresSessionStorage, createMemoryPostgres, createNeonPostgres, createPostgresSessionStorage } from "./db/postgres";
export { MemoryRedisAdapter, UpstashRedisAdapter, createMemoryRedis, createUpstashRedis } from "./db/redis";
export { SQLiteAdapter, createSQLiteAdapter } from "./db/sqlite";
export { // LLM-as-Judge
Judge, AccuracyJudge, CriteriaJudge, EvalResults, EvalSuite, Evaluator, RecipeJudge, accuracyEval, addJudge, addOptimizationRule, containsKeywordsCriterion, createDefaultEvaluator, createEvalResults, createEvaluator, getJudge, getOptimizationRule, lengthCriterion, listJudges, listOptimizationRules, noHarmfulContentCriterion, parseJudgeResponse, performanceEval, relevanceCriterion, reliabilityEval, removeJudge, removeOptimizationRule } from "./eval";
export { EvalSuite, accuracyEval, performanceEval, reliabilityEval } from "./eval";
export { AgentEventBus, AgentEvents, EventEmitterPubSub, PubSub, createEventBus, createPubSub } from "./events";
export { LLMGuardrail, createLLMGuardrail } from "./guardrails/llm-guardrail";
export { DisplayTypes, HooksManager, WorkflowHooksExecutor, clearAllCallbacks, clearApprovalCallback, createHooksManager, createLoggingOperationHooks, createLoggingWorkflowHooks, createTimingWorkflowHooks, createValidationOperationHooks, createWorkflowHooks, executeCallback, executeSyncCallback, getRegisteredDisplayTypes, hasApprovalCallback, registerApprovalCallback, registerDisplayCallback, requestApproval, unregisterDisplayCallback } from "./hooks";
export { // Computer Use
createComputerUse, ComputerUseClient, createCLIApprovalPrompt, createComputerUseAgent } from "./integrations/computer-use";
export { BaseObservabilityProvider, ConsoleObservabilityProvider, LangfuseObservabilityProvider, MemoryObservabilityProvider, ObservabilityTraceContext, createConsoleObservability, createLangfuseObservability, createMemoryObservability } from "./integrations/observability";
@@ -1097,34 +834,25 @@ export { // Provider classes
ProviderRegistry, // Types
type LLMProvider, AnthropicProvider, BaseProvider, GoogleProvider, ProviderMessage, ProviderToolDefinition, createProviderRegistry, getAvailableProviders, getDefaultProvider, getDefaultRegistry, hasProvider, isProviderAvailable, listProviders, parseModelString, registerBuiltinProviders, registerProvider, unregisterProvider } from "./llm/providers";
export { ADAPTERS, AISDK_PROVIDERS, COMMUNITY_PROVIDERS, PROVIDER_ALIASES } from "./llm/providers/ai-sdk/types";
export { MCPClient, MCPSecurity, MCPServer, MCPSessionManager, createApiKeyPolicy, createMCPClient, createMCPSecurity, createMCPServer, createMCPSession, createRateLimitPolicy, getMCPTools } from "./mcp";
export { AutoMemory, AutoMemoryKnowledgeBase, AutoMemoryVectorStore, DEFAULT_POLICIES, createAutoMemory, createLLMSummarizer } from "./memory/auto-memory";
export { DocsManager, createDocsManager } from "./memory/docs-manager";
export { FileMemory, createFileMemory } from "./memory/file-memory";
export { MemoryHooks, createEncryptionHooks, createLoggingHooks, createMemoryHooks, createValidationHooks } from "./memory/hooks";
export { Memory, createMemory } from "./memory/memory";
export type { MemoryConfig, MemoryEntry } from "./memory/memory";
export { RulesManager, createRulesManager, createSafetyRules } from "./memory/rules-manager";
export { // Adapters
NoopObservabilityAdapter, // Constants
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";
export { // Subagent Tool (agent-as-tool pattern)
SubagentTool, BaseTool, FunctionTool, ToolRegistry, ToolResult, ToolValidationError, createDelegator, createSubagentTool, createSubagentTools, createTool, getRegistry, getTool, registerTool, tool, validateTool } from "./tools";
export { AgentTelemetry, TelemetryCollector, cleanupTelemetry, createAgentTelemetry, disableTelemetry, enableTelemetry, getTelemetry } from "./telemetry";
export { BaseTool, FunctionTool, ToolRegistry, ToolResult, ToolValidationError, createTool, getRegistry, getTool, registerTool, tool, validateTool } from "./tools";
export { airweaveSearch, bedrockBrowserClick, bedrockBrowserFill, bedrockBrowserNavigate, bedrockCodeInterpreter, codeExecution, codeMode, createCustomTool, exaSearch, firecrawlCrawl, firecrawlScrape, parallelSearch, perplexitySearch, registerCustomTool, registerLocalTool, registerNpmTool, superagentGuard, superagentRedact, superagentVerify, tavilyCrawl, tavilyExtract, tavilySearch, valyuBioSearch, valyuCompanyResearch, valyuEconomicsSearch, valyuFinanceSearch, valyuPaperSearch, valyuPatentSearch, valyuSecSearch, valyuWebSearch } from "./tools/builtins";
export { MissingDependencyError, MissingEnvVarError, ToolsRegistry, composeMiddleware, createLoggingMiddleware, createRateLimitMiddleware, createRedactionMiddleware, createRetryMiddleware, createTimeoutMiddleware, createToolsRegistry, createTracingMiddleware, createValidationMiddleware, getToolsRegistry, resetToolsRegistry } from "./tools/registry";
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";
export { Workflow, loop, parallel, repeat, route } from "./workflows";
export type { StepResult, WorkflowContext, WorkflowStep } from "./workflows";
export { createWorkflowFromYAML, loadWorkflowFromFile, parseYAMLWorkflow, validateWorkflowDefinition } from "./workflows/yaml-parser";
```
-6
View File
@@ -13,12 +13,6 @@ GOOGLE_API_KEY=your_google_api_key_here
GROQ_API_KEY=your_groq_api_key_here
COHERE_API_KEY=your_cohere_api_key_here
# Bot Tokens (for messaging bot services)
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
SLACK_APP_TOKEN=xapp-your-slack-app-token
DISCORD_BOT_TOKEN=your-discord-bot-token
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
# Optional: Service Configuration
FLASK_ENV=development
CHAINLIT_HOST=0.0.0.0
+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.7.4" \
"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.7.4" \
"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.7.4" \
"praisonai[ui]" \
"praisonai[crewai]"
-15
View File
@@ -1,15 +0,0 @@
# Bot Environment Variables
# Copy to .env and fill in your values
# Required: LLM API Key
OPENAI_API_KEY=your_openai_api_key_here
# Slack Bot (Socket Mode)
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
SLACK_APP_TOKEN=xapp-your-slack-app-token
# Discord Bot
DISCORD_BOT_TOKEN=your-discord-bot-token
# Telegram Bot
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
-42
View File
@@ -1,42 +0,0 @@
# Dockerfile for PraisonAI Slack Bot
# Secrets are passed at runtime via environment variables
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Create praison config directory
RUN mkdir -p /root/.praison
# Install praisonai with bot dependencies
RUN pip install --no-cache-dir \
praisonai \
slack-bolt \
slack-sdk \
"discord.py>=2.0.0" \
"python-telegram-bot>=20.0"
# Set environment variables for directory management
ENV PRAISON_CONFIG_DIR=/root/.praison
ENV DOCKER_CONTAINER=true
# Bot tokens should be passed at runtime (not baked into image)
# SLACK_BOT_TOKEN=xoxb-...
# SLACK_APP_TOKEN=xapp-...
# Optional: Copy custom agent configuration
# COPY agent.yaml /app/agent.yaml
# Expose no ports - Socket Mode doesn't need them
# For webhook mode, expose port 3000
# Default command - tokens from environment
CMD ["praisonai", "bot", "slack"]
-66
View File
@@ -1,66 +0,0 @@
# PraisonAI Bot Docker Deployment
Deploy Slack, Discord, or Telegram bots using Docker.
## Quick Start
```bash
# 1. Copy environment template
cp .env.template .env
# 2. Edit .env with your tokens
nano .env
# 3. Run specific bot
docker compose up slack-bot -d
# Or run all bots
docker compose up -d
```
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `OPENAI_API_KEY` | Yes | LLM API key |
| `SLACK_BOT_TOKEN` | For Slack | Bot token (xoxb-...) |
| `SLACK_APP_TOKEN` | For Slack | App token (xapp-...) |
| `DISCORD_BOT_TOKEN` | For Discord | Bot token |
| `TELEGRAM_BOT_TOKEN` | For Telegram | Bot token |
## Slack Setup
1. Create app at https://api.slack.com/apps
2. Enable **Socket Mode** → Generate App-Level Token with `connections:write`
3. Add **OAuth Scopes**: `chat:write`, `app_mentions:read`, `im:history`
4. Enable **Event Subscriptions** → Subscribe to `app_mention`, `message.im`
5. **Install to Workspace**
6. Copy Bot Token and App Token to `.env`
## Commands
```bash
# Start Slack bot
docker compose up slack-bot -d
# View logs
docker compose logs -f slack-bot
# Stop bot
docker compose down slack-bot
# Rebuild after updates
docker compose build --no-cache slack-bot
```
## Custom Agent Configuration
Mount your agent config:
```yaml
services:
slack-bot:
volumes:
- ./agent.yaml:/app/agent.yaml
command: ["praisonai", "bot", "slack", "--agent", "/app/agent.yaml"]
```
-53
View File
@@ -1,53 +0,0 @@
version: '3.8'
# PraisonAI Bot Services
# Run specific bots: docker compose up slack-bot
# Run all bots: docker compose up
services:
# Slack Bot
slack-bot:
build:
context: ../..
dockerfile: docker/bots/Dockerfile
volumes:
- praison_data:/root/.praison
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN}
SLACK_APP_TOKEN: ${SLACK_APP_TOKEN}
PRAISON_CONFIG_DIR: /root/.praison
command: [ "praisonai", "bot", "slack" ]
restart: unless-stopped
# Discord Bot
discord-bot:
build:
context: ../..
dockerfile: docker/bots/Dockerfile
volumes:
- praison_data:/root/.praison
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN}
PRAISON_CONFIG_DIR: /root/.praison
command: [ "praisonai", "bot", "discord" ]
restart: unless-stopped
# Telegram Bot
telegram-bot:
build:
context: ../..
dockerfile: docker/bots/Dockerfile
volumes:
- praison_data:/root/.praison
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
PRAISON_CONFIG_DIR: /root/.praison
command: [ "praisonai", "bot", "telegram" ]
restart: unless-stopped
volumes:
praison_data:
driver: local
+4 -5
View File
@@ -22,7 +22,7 @@ services:
CHAINLIT_DB_DIR: /root/.praison
command: praisonai ui --host 0.0.0.0
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8082" ]
test: ["CMD", "curl", "-f", "http://localhost:8082"]
interval: 10s
timeout: 5s
retries: 3
@@ -49,7 +49,7 @@ services:
CHAINLIT_DB_DIR: /root/.praison
command: praisonai chat --host 0.0.0.0 --port 8083
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8083" ]
test: ["CMD", "curl", "-f", "http://localhost:8083"]
interval: 10s
timeout: 5s
retries: 3
@@ -69,7 +69,7 @@ services:
OPENAI_API_KEY: ${OPENAI_API_KEY}
PRAISON_CONFIG_DIR: /root/.praison
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
@@ -89,7 +89,6 @@ services:
PRAISON_CONFIG_DIR: /root/.praison
networks:
- praison_network
# For bot services (Slack, Discord, Telegram), see docker/bots/
volumes:
praison_data:
@@ -97,4 +96,4 @@ volumes:
networks:
praison_network:
driver: bridge
driver: bridge
+3 -3
View File
@@ -35,7 +35,7 @@ def run_quick_comparison():
prompt="What is 2+2?",
iterations=2,
paths=["openai_sdk", "praisonai_agent"],
output="verbose"
verbose=True
)
# Print comparison table
@@ -56,7 +56,7 @@ def run_full_benchmark():
report = handler.run_full_benchmark(
prompt="Hi",
iterations=3,
output="verbose"
verbose=True
)
# Print full report
@@ -78,7 +78,7 @@ def run_agent_benchmark():
prompt="Explain Python in one sentence",
iterations=3,
paths=["openai_sdk", "praisonai_agent"],
output="verbose"
verbose=True
)
# Show timeline diagrams
+3 -22
View File
@@ -2,14 +2,12 @@
Embeddings Capability Example
Demonstrates text embedding generation using PraisonAI capabilities.
Both `embed` and `embedding` work identically - use whichever you prefer.
"""
from praisonai import embed, embedding # Both work from top-level
# Or: from praisonai.capabilities import embed, embedding
from praisonai.capabilities import embed
# Single text embedding using embed()
print("=== Single Text Embedding (using embed) ===")
# Single text embedding
print("=== Single Text Embedding ===")
result = embed(
input="Hello, world!",
model="text-embedding-3-small"
@@ -18,14 +16,6 @@ print(f"Embedding dimensions: {len(result.embeddings[0])}")
print(f"First 5 values: {result.embeddings[0][:5]}")
print(f"Usage: {result.usage}")
# Same thing using embedding() alias
print("\n=== Single Text Embedding (using embedding alias) ===")
result = embedding(
input="Hello, world!",
model="text-embedding-3-small"
)
print(f"Embedding dimensions: {len(result.embeddings[0])}")
# Multiple text embeddings
print("\n=== Multiple Text Embeddings ===")
result = embed(
@@ -35,12 +25,3 @@ result = embed(
print(f"Number of embeddings: {len(result.embeddings)}")
for i, emb in enumerate(result.embeddings):
print(f" Text {i+1}: {len(emb)} dimensions")
# With custom dimensions (for models that support it)
print("\n=== Custom Dimensions ===")
result = embed(
input="Hello world",
model="text-embedding-3-large",
dimensions=256
)
print(f"Reduced dimensions: {len(result.embeddings[0])}")
+1 -1
View File
@@ -22,7 +22,7 @@ custom_modes = {
}
# Create handler with verbose output
handler = CompareHandler(output="verbose")
handler = CompareHandler(verbose=True)
# Example: Manually create comparison results for analysis
# (useful for testing without API calls)
+1 -1
View File
@@ -22,7 +22,7 @@ modes = parse_modes("basic,tools,planning")
print(f"\nParsed modes: {modes}")
# Create compare handler
handler = CompareHandler(output="verbose")
handler = CompareHandler(verbose=True)
# Compare modes (this will run actual agent calls)
# Uncomment to run:
@@ -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."),
@@ -32,7 +32,7 @@ workflow = AgentFlow(
),
],
# Workflow-level consolidated params
output=WorkflowOutputConfig(output="verbose", stream=True),
output=WorkflowOutputConfig(verbose=True, stream=True),
planning=WorkflowPlanningConfig(enabled=True, reasoning=True),
memory=WorkflowMemoryConfig(backend="file"),
# Agent-like params
+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,
+14 -17
View File
@@ -1,24 +1,21 @@
"""Basic memory example - minimal usage."""
"""
Basic Memory Example - Agent-Centric API
Demonstrates the simplest memory usage with consolidated params.
"""
from praisonaiagents import Agent
# Simple enable (uses default file-based memory)
# Basic: Enable memory with preset
agent = Agent(
instructions="You are a helpful assistant with memory.",
memory=True,
memory="sqlite", # Preset: sqlite, redis, postgres, file
)
# With preset
agent_redis = Agent(
instructions="You are a helpful assistant.",
memory="redis", # Uses redis preset
)
# Run a simple task
response = agent.start("Remember that my favorite color is blue.")
print(response)
# With URL
agent_postgres = Agent(
instructions="You are a helpful assistant.",
memory="postgresql://localhost/mydb", # URL auto-detected
)
if __name__ == "__main__":
response = agent.chat("Remember that my favorite color is blue.")
print(response)
# Follow-up to test memory
response = agent.start("What is my favorite color?")
print(response)
@@ -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."),
+22 -18
View File
@@ -1,22 +1,26 @@
"""Basic workflow example with consolidated params."""
"""
Basic Workflow Example - Agent-Centric API
Demonstrates minimal workflow 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(
name="Content Pipeline",
steps=[
Task(name="write", agent=writer, action="Write about {{topic}}"),
Task(name="edit", agent=editor, action="Edit the content", context=["write"]),
],
output="verbose",
planning=True,
# Create a simple workflow
workflow = Workflow(
name="simple_workflow",
output="verbose", # Workflow-level output preset
)
if __name__ == "__main__":
result = workflow.run(variables={"topic": "AI agents"})
print(result)
# Add a step
step = WorkflowStep(
name="writer",
action="Write a haiku about programming",
agent=Agent(instructions="You are a creative poet."),
output="result.txt", # Save output to file
)
# Note: This is a structural example - actual execution requires workflow.run()
print("Workflow created with output preset:", workflow.output)
print("Step output file:", step.output_file)
@@ -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."),
-59
View File
@@ -1,59 +0,0 @@
"""
Basic Context Management Example
Demonstrates enabling context management with ContextConfig.
This manages token budgets, auto-compaction, and prevents context overflow.
"""
from praisonaiagents import Agent
from praisonaiagents.context import ContextConfig, OptimizerStrategy
# Example 1: Enable context with defaults
agent_basic = Agent(
name="Assistant",
instructions="You are a helpful assistant",
context=True # Auto-compact at 80% utilization
)
# Example 2: Custom configuration
agent_custom = Agent(
name="CustomAgent",
instructions="You are a helpful assistant with custom context settings",
context=ContextConfig(
auto_compact=True,
compact_threshold=0.8, # Trigger at 80% utilization
strategy=OptimizerStrategy.SMART,
output_reserve=8000, # Reserve tokens for output
keep_recent_turns=5, # Always keep last 5 turns
tool_output_max=10000, # Max tokens per tool output
)
)
# Example 3: Sliding window strategy
agent_sliding = Agent(
name="SlidingAgent",
instructions="You are a helpful assistant using sliding window",
context=ContextConfig(
strategy=OptimizerStrategy.SLIDING_WINDOW,
keep_recent_turns=10, # Keep last 10 turns
)
)
if __name__ == "__main__":
print("=== Basic Context Example ===")
print("Context management is automatically enabled.")
print()
# Test basic agent
result = agent_basic.chat("Hello! What is 2 + 2?")
print(f"Response: {result}")
print()
# Show context config
print("=== Context Configuration ===")
config = ContextConfig(
auto_compact=True,
compact_threshold=0.8,
strategy=OptimizerStrategy.SMART,
)
print(f"Config: {config.to_dict()}")
-71
View File
@@ -1,71 +0,0 @@
"""
Session Tracking Example
Demonstrates tracking conversation state (goal, plan, progress) across turns.
Inspired by Agno's SessionContextStore pattern.
"""
from praisonaiagents.context import SessionContextTracker
# Create session tracker
tracker = SessionContextTracker(
session_id="user123",
track_summary=True,
track_goal=True,
track_plan=True,
track_progress=True,
)
# Set the user's goal
tracker.update_goal("Build a Python web application with Flask")
# Define the plan
tracker.update_plan([
"Create Flask project structure",
"Add routes for API endpoints",
"Implement database models",
"Add authentication",
"Write tests",
"Deploy to cloud"
])
# Mark completed steps
tracker.add_progress("Created Flask project structure")
tracker.add_progress("Added routes for API endpoints")
# Update summary
tracker.update_summary(
"User is building a Flask web app. Completed project setup and API routes. "
"Next: implement database models."
)
if __name__ == "__main__":
print("=== Session Tracking Example ===")
print()
# Show current state
print(f"Session ID: {tracker.session_id}")
print(f"Goal: {tracker.goal}")
print(f"Plan: {tracker.plan}")
print(f"Progress: {tracker.progress}")
print()
# Get context string (simple format)
print("=== Context String ===")
print(tracker.to_context_string())
print()
# Get system prompt section (XML format with guidelines)
print("=== System Prompt Section ===")
print(tracker.to_system_prompt_section())
print()
# Export to dict for persistence
print("=== Export as Dict ===")
data = tracker.to_dict()
print(f"Exported: {data.keys()}")
print()
# Recreate from dict
new_tracker = SessionContextTracker.from_dict(data)
print(f"Restored goal: {new_tracker.goal}")
-81
View File
@@ -1,81 +0,0 @@
"""
Multi-Memory Aggregation Example
Demonstrates concurrent fetching from multiple context sources.
Inspired by CrewAI's ContextualMemory pattern.
"""
import asyncio
from praisonaiagents.context import ContextAggregator, create_aggregator_from_config
# Example 1: Basic aggregator with mock sources
def mock_memory_search(query: str) -> str:
"""Mock memory search - returns recent conversation context."""
return f"[Memory] User previously asked about: {query}. They prefer Python."
def mock_knowledge_search(query: str) -> str:
"""Mock knowledge search - returns facts from knowledge base."""
return f"[Knowledge] Relevant facts: Python is a high-level programming language."
def mock_rag_retrieve(query: str) -> str:
"""Mock RAG retrieval - returns document chunks."""
return f"[RAG] Retrieved: Documentation about {query} from the codebase."
# Create aggregator
aggregator = ContextAggregator(
max_tokens=4000,
separator="\n\n---\n\n",
include_source_labels=True
)
# Register sources with priorities (lower = higher priority)
aggregator.register_source("memory", mock_memory_search, priority=10)
aggregator.register_source("knowledge", mock_knowledge_search, priority=20)
aggregator.register_source("rag", mock_rag_retrieve, priority=30)
async def demo_async():
"""Demo async aggregation."""
print("=== Async Aggregation ===")
result = await aggregator.aggregate("Python web development")
print(f"Sources used: {result.sources_used}")
print(f"Tokens used: {result.tokens_used}")
print(f"Fetch times: {result.fetch_times}")
print()
print("Context:")
print(result.context)
return result
def demo_sync():
"""Demo sync aggregation."""
print("=== Sync Aggregation ===")
result = aggregator.aggregate_sync("Flask API development")
print(f"Sources used: {result.sources_used}")
print(f"Tokens used: {result.tokens_used}")
print()
print("Context:")
print(result.context)
return result
if __name__ == "__main__":
print("=== Multi-Memory Aggregation Example ===")
print()
# Show registered sources
print(f"Registered sources: {aggregator.sources}")
print()
# Demo sync aggregation
demo_sync()
print()
# Demo async aggregation
asyncio.run(demo_async())
print()
# Demo selective sources
print("=== Selective Sources ===")
result = aggregator.aggregate_sync(
"Find database info",
sources=["memory", "knowledge"] # Only use these
)
print(f"Sources used: {result.sources_used}")
+1 -1
View File
@@ -37,7 +37,7 @@ def main():
name="CodeAssistant",
instructions="You are a helpful code assistant.",
context=config,
output="silent"
verbose=False
)
print(f" Agent name: {agent.name}")
@@ -1,76 +0,0 @@
"""
Compaction Strategies Example
Demonstrates different context compaction strategies.
"""
from praisonaiagents import Agent
from praisonaiagents.context import ContextConfig, OptimizerStrategy
# Strategy 1: TRUNCATE - Fast, removes oldest messages
agent_truncate = Agent(
name="TruncateAgent",
instructions="You are a helpful assistant",
context=ContextConfig(
strategy=OptimizerStrategy.TRUNCATE,
compact_threshold=0.8,
)
)
# Strategy 2: SLIDING_WINDOW - Keeps recent N turns
agent_sliding = Agent(
name="SlidingAgent",
instructions="You are a helpful assistant",
context=ContextConfig(
strategy=OptimizerStrategy.SLIDING_WINDOW,
keep_recent_turns=10,
)
)
# Strategy 3: SMART - Importance-based (default)
agent_smart = Agent(
name="SmartAgent",
instructions="You are a helpful assistant",
context=ContextConfig(
strategy=OptimizerStrategy.SMART, # Default
compact_threshold=0.8,
)
)
# Strategy 4: PRUNE_TOOLS - Truncate old tool outputs
agent_prune = Agent(
name="PruneAgent",
instructions="You are a helpful assistant with tools",
context=ContextConfig(
strategy=OptimizerStrategy.PRUNE_TOOLS,
tool_output_max=5000, # Max tokens per tool output
)
)
# Strategy 5: NON_DESTRUCTIVE - Only prune tools, keep all history
agent_safe = Agent(
name="SafeAgent",
instructions="You are a helpful assistant (safety-critical)",
context=ContextConfig(
strategy=OptimizerStrategy.NON_DESTRUCTIVE,
)
)
if __name__ == "__main__":
print("=== Compaction Strategies Example ===")
print()
strategies = [
("TRUNCATE", OptimizerStrategy.TRUNCATE, "Remove oldest messages"),
("SLIDING_WINDOW", OptimizerStrategy.SLIDING_WINDOW, "Keep last N turns"),
("SMART", OptimizerStrategy.SMART, "Importance-based (default)"),
("PRUNE_TOOLS", OptimizerStrategy.PRUNE_TOOLS, "Truncate tool outputs"),
("NON_DESTRUCTIVE", OptimizerStrategy.NON_DESTRUCTIVE, "Only prune tools"),
]
for name, strategy, description in strategies:
print(f" {name:20} - {description}")
print()
print("Usage:")
print(" context=ContextConfig(strategy=OptimizerStrategy.SLIDING_WINDOW)")
-85
View File
@@ -1,85 +0,0 @@
"""
Context Monitoring Example
Demonstrates monitoring context usage with logging and metrics.
"""
from praisonaiagents import Agent
from praisonaiagents.context import ContextConfig, MonitorConfig, OptimizerStrategy
# Example 1: Human-readable monitoring
agent_human = Agent(
name="MonitoredAgent",
instructions="You are a helpful assistant",
context=ContextConfig(
auto_compact=True,
monitor=MonitorConfig(
enabled=True,
path="./context_logs/",
format="human", # Human-readable format
frequency="turn", # Log on every turn
redact_sensitive=True, # Redact sensitive data
multi_agent_files=True, # Separate files per agent
)
)
)
# Example 2: JSON monitoring (for parsing)
agent_json = Agent(
name="JSONMonitorAgent",
instructions="You are a helpful assistant",
context=ContextConfig(
monitor=MonitorConfig(
enabled=True,
path="./context_logs/",
format="json", # JSON format for parsing
frequency="tool_call", # Log on tool calls
)
)
)
# Example 3: Overflow-only monitoring
agent_overflow = Agent(
name="OverflowAgent",
instructions="You are a helpful assistant",
context=ContextConfig(
monitor=MonitorConfig(
enabled=True,
path="./context_logs/",
format="human",
frequency="overflow", # Only log on overflow
)
)
)
if __name__ == "__main__":
print("=== Context Monitoring Example ===")
print()
# Show monitor configuration
config = MonitorConfig(
enabled=True,
path="./context_logs/",
format="human",
frequency="turn",
redact_sensitive=True,
)
print("Monitor Config:")
print(f" enabled: {config.enabled}")
print(f" path: {config.path}")
print(f" format: {config.format}")
print(f" frequency: {config.frequency}")
print(f" redact_sensitive: {config.redact_sensitive}")
print()
print("Frequency options:")
print(" 'turn' - Log on every conversation turn")
print(" 'tool_call' - Log when tools are called")
print(" 'manual' - Manual logging only")
print(" 'overflow' - Log only when context overflows")
print()
print("Format options:")
print(" 'human' - Human-readable format")
print(" 'json' - JSON format for parsing")
+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
-274
View File
@@ -1,274 +0,0 @@
"""
Example 15: Recursive Context Pattern
Demonstrates the RLM (Recursive Language Model) pattern for handling large context:
- Store large documents as artifacts (not in LLM context)
- Agent uses tools (grep/head/tail/chunk) to explore artifacts
- Dramatically reduces token usage (~2K vs ~10K+)
This pattern solves "context rot" by treating context as programmatically
explorable data instead of dumping everything into the LLM's context window.
"""
import tempfile
import os
from praisonaiagents import Agent
from praisonai.context import FileSystemArtifactStore
from praisonai.context.queue import create_artifact_tools
from praisonaiagents.context.artifacts import ArtifactMetadata
def create_sample_document():
"""Create a sample large document for testing."""
# Simulate a research paper / large document
content = """
# Attention Is All You Need
## Abstract
The dominant sequence transduction models are based on complex recurrent or
convolutional neural networks that include an encoder and a decoder. The best
performing models also connect the encoder and decoder through an attention
mechanism. We propose a new simple network architecture, the Transformer,
based solely on attention mechanisms, dispensing with recurrence and convolutions
entirely.
## Introduction
Recurrent neural networks, long short-term memory and gated recurrent neural
networks in particular, have been firmly established as state of the art
approaches in sequence modeling and transduction problems such as language
modeling and machine translation.
## Background
The goal of reducing sequential computation also forms the foundation of the
Extended Neural GPU, ByteNet and ConvS2S, all of which use convolutional neural
networks as basic building block.
## Model Architecture
### Encoder and Decoder Stacks
The encoder is composed of a stack of N = 6 identical layers. Each layer has
two sub-layers. The first is a multi-head self-attention mechanism, and the
second is a simple, position-wise fully connected feed-forward network.
### Attention
An attention function can be described as mapping a query and a set of key-value
pairs to an output, where the query, keys, values, and output are all vectors.
#### Scaled Dot-Product Attention
We call our particular attention "Scaled Dot-Product Attention". The input
consists of queries and keys of dimension dk, and values of dimension dv.
The formula is: Attention(Q, K, V) = softmax(QK^T / sqrt(d_k))V
### Multi-Head Attention
Multi-head attention allows the model to jointly attend to information from
different representation subspaces at different positions.
## Results
### Machine Translation
On the WMT 2014 English-to-German translation task, the big transformer model
outperforms the best previously reported models including ensembles.
The model achieved a BLEU score of 28.4 on the WMT 2014 English-to-German
translation task, improving over the existing best results by over 2 BLEU.
On the WMT 2014 English-to-French translation task, our big model achieves
a BLEU score of 41.8, outperforming all published single models.
### Training
Training took 3.5 days on 8 P100 GPUs. The big model was trained for 300,000
steps (3.5 days) at a cost of approximately $1000 in cloud compute.
## Model Variations
| Model | Parameters | BLEU EN-DE | BLEU EN-FR |
|-------|------------|------------|------------|
| Base | 65M | 27.3 | 38.1 |
| Big | 213M | 28.4 | 41.8 |
The base model has 65 million parameters (65 × 10^6).
The big model has 213 million parameters.
## Conclusion
In this work, we presented the Transformer, the first sequence transduction
model based entirely on attention, replacing the recurrent layers most commonly
used in encoder-decoder architectures with multi-headed self-attention.
The Transformer can be trained significantly faster than architectures based
on recurrent or convolutional layers.
## Authors
Ashish Vaswani (Google Brain)
Noam Shazeer (Google Brain)
Niki Parmar (Google Research)
Jakob Uszkoreit (Google Research)
Llion Jones (Google Research)
Aidan N. Gomez (University of Toronto)
Łukasz Kaiser (Google Brain)
Illia Polosukhin
## References
[1] Neural Machine Translation by Jointly Learning to Align and Translate
[2] Sequence to Sequence Learning with Neural Networks
[3] Learning Phrase Representations using RNN Encoder-Decoder
"""
# Repeat content to make it larger
full_content = (content + "\n\n") * 10 # ~35KB
return full_content
def main():
print("=" * 70)
print("Recursive Context Pattern - Token Efficiency Demo")
print("=" * 70)
# Track token usage across methods
token_stats = {
"traditional": {"input": 0, "output": 0},
"recursive": {"input": 0, "output": 0},
}
with tempfile.TemporaryDirectory() as tmpdir:
# 1. Create artifact store and tools
store = FileSystemArtifactStore(base_dir=tmpdir)
artifact_tools = create_artifact_tools(store=store)
print(f"\n1. Created FileSystemArtifactStore")
print(f" Location: {tmpdir}")
print(f" Tools available: {[t.__name__ for t in artifact_tools]}")
# 2. Create sample document and store as artifact
document = create_sample_document()
doc_size = len(document)
doc_tokens = doc_size // 4 # Rough estimate: 4 chars per token
metadata = ArtifactMetadata(
agent_id="research_agent",
run_id="demo_run",
tool_name="document_loader",
turn_id=1
)
ref = store.store(document, metadata)
print(f"\n2. Stored document as artifact")
print(f" Size: {doc_size:,} chars (~{doc_tokens:,} tokens)")
print(f" Path: {ref.path}")
print(f" Summary: {ref.summary[:80]}...")
# 3. Create agent WITH artifact tools (Recursive Context approach)
agent = Agent(
instructions="""You are a research paper analyst with access to artifact exploration tools.
When given an artifact path, use the tools to explore it efficiently:
- artifact_grep: Search for patterns (USE THIS FIRST)
- artifact_head: See first N lines
- artifact_tail: See last N lines
- artifact_chunk: Get specific line ranges
Be precise and cite line numbers when finding information.""",
tools=artifact_tools,
output='silent' # Quiet output for cleaner demo
)
print(f"\n3. Created agent with {len(agent.tools)} artifact tools")
# 4. Query using RECURSIVE CONTEXT (small prompt + tools)
print(f"\n4. RECURSIVE CONTEXT APPROACH")
print("-" * 40)
prompt = f"""I have a research paper stored at: {ref.path}
Find the BLEU score on the WMT 2014 English-to-German translation task.
Use artifact_grep to search, then report the answer with line number."""
prompt_tokens = len(prompt) // 4
print(f" Prompt size: {len(prompt)} chars (~{prompt_tokens} tokens)")
print(f" Document NOT in prompt context!")
response = agent.chat(prompt)
# Estimate output tokens (could use actual LiteLLM response if available)
output_tokens = len(response) // 4
# Calculate recursive approach tokens (prompt + tool calls + response)
# Tool call: ~200 tokens for tool desc + call
# Tool response: ~300 tokens for grep results
estimated_total = prompt_tokens + 200 + 300 + output_tokens
token_stats["recursive"]["input"] = estimated_total
print(f"\n Agent Response:")
print(f" {response[:200]}...")
print(f"\n Estimated tokens used: ~{estimated_total:,}")
# 5. Compare with TRADITIONAL approach (full context)
print(f"\n5. TRADITIONAL APPROACH (for comparison)")
print("-" * 40)
traditional_prompt_tokens = prompt_tokens + doc_tokens
token_stats["traditional"]["input"] = traditional_prompt_tokens
print(f" If we passed FULL document in prompt:")
print(f" Prompt: {prompt_tokens} + Document: {doc_tokens} = {traditional_prompt_tokens:,} tokens")
# 6. Show token savings
print(f"\n6. TOKEN COMPARISON")
print("=" * 40)
savings = token_stats["traditional"]["input"] - token_stats["recursive"]["input"]
savings_pct = (savings / token_stats["traditional"]["input"]) * 100
print(f" Traditional approach: ~{token_stats['traditional']['input']:,} tokens")
print(f" Recursive approach: ~{token_stats['recursive']['input']:,} tokens")
print(f" -----------------------------------")
print(f" SAVINGS: ~{savings:,} tokens ({savings_pct:.0f}%)")
# 7. Demonstrate other artifact operations
print(f"\n7. ARTIFACT OPERATIONS DEMO")
print("-" * 40)
# head
head_result = store.head(ref, lines=5)
print(f" head(5 lines):")
for line in head_result.split('\n')[:3]:
print(f" {line[:60]}")
# grep
grep_results = store.grep(ref, pattern=r"BLEU.*\d+", max_matches=3)
print(f"\n grep('BLEU.*\\d+'):")
for match in grep_results[:2]:
print(f" Line {match.line_number}: {match.line_content[:50].strip()}...")
# chunk
chunk_result = store.chunk(ref, start_line=50, end_line=55)
print(f"\n chunk(lines 50-55):")
for line in chunk_result.split('\n')[:3]:
print(f" {line[:60]}")
print("\n" + "=" * 70)
print("CONCLUSION: Recursive Context Pattern")
print("=" * 70)
print("""
The Recursive Context pattern (RLM) provides:
✓ Token efficiency: ~{savings_pct:.0f}% reduction in token usage
✓ Scalability: Handle documents of any size
✓ Precision: Agent searches for exactly what it needs
✓ Cost savings: Lower API costs due to fewer tokens
✓ Better accuracy: Avoids "context rot" from large contexts
""".format(savings_pct=savings_pct))
if __name__ == "__main__":
main()
@@ -22,7 +22,7 @@ agents: # Canonical: use 'agents' instead of 'roles'
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -76,7 +76,7 @@ agents: # Canonical: use 'agents' instead of 'roles'
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -130,7 +130,7 @@ agents: # Canonical: use 'agents' instead of 'roles'
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -185,7 +185,7 @@ agents: # Canonical: use 'agents' instead of 'roles'
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.4
tools:
- "InternetSearchTool"
@@ -239,7 +239,7 @@ agents: # Canonical: use 'agents' instead of 'roles'
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -299,7 +299,7 @@ agents: # Canonical: use 'agents' instead of 'roles'
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tasks:
report_synthesis:
-145
View File
@@ -1,145 +0,0 @@
"""
Agent-centric Embedding Example
This example shows how to use embeddings with PraisonAI Agents.
Embeddings are used internally by Agent for:
- Knowledge retrieval (RAG)
- Memory storage and search
- Semantic similarity
You can also use the embedding API directly for custom use cases.
"""
from praisonaiagents import Agent, embedding
# =============================================================================
# Example 1: Direct Embedding API
# =============================================================================
def example_direct_embedding():
"""Use the embedding API directly."""
# Single text embedding
result = embedding("Hello, world!")
print(f"Single embedding: {len(result.embeddings[0])} dimensions")
# Batch embedding
texts = ["AI agents are powerful", "Machine learning is fascinating"]
result = embedding(texts, model="text-embedding-3-small")
print(f"Batch embeddings: {len(result.embeddings)} vectors")
# Custom dimensions (for models that support it)
result = embedding("Hello", model="text-embedding-3-large", dimensions=256)
print(f"Custom dimensions: {len(result.embeddings[0])} dimensions")
return result
# =============================================================================
# Example 2: Agent with Knowledge (uses embeddings internally)
# =============================================================================
def example_agent_with_knowledge():
"""Agent with knowledge uses embeddings for RAG."""
agent = Agent(
instructions="You are a helpful assistant with knowledge about AI.",
knowledge=["AI agents can use tools to accomplish tasks."],
knowledge_config={
"embedder": {
"provider": "openai",
"config": {"model": "text-embedding-3-small"}
}
}
)
# The agent uses embeddings internally for knowledge retrieval
response = agent.chat("What can AI agents do?")
print(f"Agent response: {response}")
return agent
# =============================================================================
# Example 3: Agent with Memory (uses embeddings internally)
# =============================================================================
def example_agent_with_memory():
"""Agent with memory uses embeddings for semantic search."""
agent = Agent(
instructions="You are a helpful assistant that remembers conversations.",
memory=True,
memory_config={
"embedding_model": "text-embedding-3-small"
}
)
# The agent uses embeddings internally for memory storage/retrieval
agent.chat("My name is Alice and I love Python programming.")
response = agent.chat("What do I love?")
print(f"Agent remembered: {response}")
return agent
# =============================================================================
# Example 4: Custom Embedding for Similarity Search
# =============================================================================
def example_similarity_search():
"""Use embeddings for custom similarity search."""
import math
def cosine_similarity(a, b):
dot = sum(x * y for x, y in zip(a, b))
norm_a = math.sqrt(sum(x * x for x in a))
norm_b = math.sqrt(sum(x * x for x in b))
return dot / (norm_a * norm_b) if norm_a and norm_b else 0
# Embed documents
documents = [
"Python is a programming language",
"JavaScript runs in browsers",
"AI agents can automate tasks"
]
doc_embeddings = embedding(documents)
# Embed query
query = "What language is used for web development?"
query_embedding = embedding(query)
# Find most similar document
similarities = [
cosine_similarity(query_embedding.embeddings[0], doc_emb)
for doc_emb in doc_embeddings.embeddings
]
best_idx = similarities.index(max(similarities))
print(f"Most similar document: {documents[best_idx]}")
print(f"Similarity score: {similarities[best_idx]:.4f}")
return similarities
if __name__ == "__main__":
print("=" * 60)
print("Example 1: Direct Embedding API")
print("=" * 60)
example_direct_embedding()
print("\n" + "=" * 60)
print("Example 4: Custom Similarity Search")
print("=" * 60)
example_similarity_search()
# Uncomment to run agent examples (requires API key)
# print("\n" + "=" * 60)
# print("Example 2: Agent with Knowledge")
# print("=" * 60)
# example_agent_with_knowledge()
# print("\n" + "=" * 60)
# print("Example 3: Agent with Memory")
# print("=" * 60)
# example_agent_with_memory()
+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]
)
+15 -20
View File
@@ -2,34 +2,32 @@
"""
Basic Hooks Example for PraisonAI Agents.
This example demonstrates the simplified hook API using add_hook():
This example demonstrates how to use the hooks system to:
1. Log tool calls before execution
2. Block dangerous operations
3. Add context to agent responses
4. Monitor session lifecycle
For the simplest example, see simple_hooks.py
Usage:
python basic_hooks.py
"""
import asyncio
from praisonaiagents import Agent
from praisonaiagents.hooks import (
add_hook, remove_hook, has_hook, get_default_registry,
HookRunner, HookEvent, HookResult,
HookRegistry, HookRunner, HookEvent, HookResult,
BeforeToolInput, AfterToolInput
)
def main():
# Clear any existing hooks from previous runs
get_default_registry().clear()
# Create a hook registry
registry = HookRegistry()
# ==========================================================================
# Hook 1: Log all tool calls (using string event name)
# Hook 1: Log all tool calls
# ==========================================================================
@add_hook('before_tool')
@registry.on(HookEvent.BEFORE_TOOL)
def log_tool_calls(event_data: BeforeToolInput) -> HookResult:
"""Log every tool call before execution."""
print(f"\n📝 [LOG] Tool: {event_data.tool_name}")
@@ -37,9 +35,9 @@ def main():
return HookResult.allow()
# ==========================================================================
# Hook 2: Block dangerous file operations
# Hook 2: Block dangerous file operations (using function logic)
# ==========================================================================
@add_hook('before_tool')
@registry.on(HookEvent.BEFORE_TOOL)
def block_delete_operations(event_data: BeforeToolInput) -> HookResult:
"""Block any delete or remove operations."""
dangerous_keywords = ['delete', 'remove', 'rm', 'unlink']
@@ -55,7 +53,7 @@ def main():
# ==========================================================================
# Hook 3: Require confirmation for write operations
# ==========================================================================
@add_hook('before_tool')
@registry.on(HookEvent.BEFORE_TOOL)
def confirm_write_operations(event_data: BeforeToolInput) -> HookResult:
"""Request confirmation for write operations."""
write_keywords = ['write', 'save', 'create', 'update']
@@ -64,13 +62,14 @@ def main():
if any(kw in tool_lower for kw in write_keywords):
print(f"\n⚠️ [CONFIRM] Write operation: {event_data.tool_name}")
# In a real scenario, you might prompt the user here
# For this example, we'll auto-approve
return HookResult.allow("Auto-approved for demo")
return HookResult.allow()
# ==========================================================================
# Hook 4: Add timing information after tool execution
# ==========================================================================
@add_hook('after_tool')
@registry.on(HookEvent.AFTER_TOOL)
def log_tool_completion(event_data: AfterToolInput) -> HookResult:
"""Log tool completion with timing."""
print(f"\n✅ [DONE] Tool: {event_data.tool_name}")
@@ -83,14 +82,10 @@ def main():
# Test the hooks
# ==========================================================================
print("=" * 60)
print("Testing Hooks System (using add_hook API)")
print("Testing Hooks System")
print("=" * 60)
# Check hooks are registered
print(f"\nHooks registered for 'before_tool': {has_hook('before_tool')}")
print(f"Hooks registered for 'after_tool': {has_hook('after_tool')}")
runner = HookRunner(get_default_registry())
runner = HookRunner(registry)
# Test 1: Normal tool call (should be logged and allowed)
print("\n--- Test 1: Normal read operation ---")
@@ -137,7 +132,7 @@ def main():
print("\n" + "=" * 60)
print("Registered Hooks:")
print("=" * 60)
for event, hooks in get_default_registry().list_hooks().items():
for event, hooks in registry.list_hooks().items():
print(f"\n{event}:")
for hook in hooks:
print(f" - {hook['name']} (matcher: {hook['matcher'] or '*'})")
-67
View File
@@ -1,67 +0,0 @@
#!/usr/bin/env python3
"""
Simple Hooks Example for PraisonAI Agents.
This example shows the SIMPLEST way to use hooks with the add_hook API.
Just a few lines of code to intercept tool calls!
No need to import HookResult - just return None/True to allow,
False to deny, or a string to deny with a reason.
Usage:
python simple_hooks.py
"""
from praisonaiagents.hooks import add_hook, has_hook
# =============================================================================
# Register hooks with simple string event names
# =============================================================================
@add_hook('before_tool')
def log_tools(event_data):
"""Log every tool call. Return nothing (None) to allow."""
print(f"🔧 Tool: {event_data.tool_name}")
# No return needed - defaults to allow
@add_hook('before_tool')
def block_dangerous(event_data):
"""Block delete operations. Return False or string to deny."""
if 'delete' in event_data.tool_name.lower():
print(f"🚫 Blocked: {event_data.tool_name}")
return "Delete operations are not allowed" # String = deny with reason
# No return = allow
@add_hook('after_tool')
def log_completion(event_data):
"""Log tool completion."""
print(f"✅ Done: {event_data.tool_name} ({event_data.execution_time_ms:.0f}ms)")
# =============================================================================
# Test the hooks
# =============================================================================
if __name__ == "__main__":
print("=" * 50)
print("Simple Hooks Example")
print("=" * 50)
# Check hooks are registered
print(f"\nHooks registered for 'before_tool': {has_hook('before_tool')}")
print(f"Hooks registered for 'after_tool': {has_hook('after_tool')}")
# You can now create an Agent and the hooks will be applied
print("\n💡 Hooks are now globally registered!")
print(" Any Agent will automatically use these hooks.")
print("\n Example:")
print(" from praisonaiagents import Agent")
print(" agent = Agent(instructions='You are helpful')")
print(" agent.start('Help me with files')")
print("\n📝 Hook returns:")
print(" - None or True → Allow the operation")
print(" - False → Deny the operation")
print(" - 'reason' → Deny with a custom message")
@@ -105,7 +105,7 @@ def example_agent_with_default_tools():
name="InteractiveAgent",
instructions="You are a helpful coding assistant with file and code analysis capabilities.",
tools=tools,
output="silent"
verbose=False
)
print(f"Agent created with {len(tools)} tools")
-128
View File
@@ -1,128 +0,0 @@
/**
* AudioAgent Integration Test
*
* Tests the AudioAgent for TTS and STT using AI SDK.
* Requires OPENAI_API_KEY for live tests.
*
* Run: npx ts-node audio-agent.ts
*/
import { AudioAgent, createAudioAgent } from '../../../src/praisonai-ts/dist';
import * as fs from 'fs';
import * as path from 'path';
async function main() {
console.log('=== AudioAgent Integration Test ===\n');
// Test 1: Create AudioAgent with defaults
console.log('1. Testing AudioAgent creation:');
const agent = new AudioAgent({
name: 'TestAudioAgent',
provider: 'openai',
voice: 'alloy',
verbose: true
});
console.log(' Agent ID:', agent.id);
console.log(' Agent Name:', agent.name);
console.log(' Success: ✅');
// Test 2: Factory function
console.log('\n2. Testing createAudioAgent() factory:');
const agent2 = createAudioAgent({ provider: 'openai', voice: 'nova' });
console.log(' Agent created:', typeof agent2);
console.log(' Success: ✅');
// Test 3: Live TTS (requires API key)
if (process.env.OPENAI_API_KEY) {
console.log('\n3. Testing Text-to-Speech (live API):');
try {
const ttsAgent = new AudioAgent({
provider: 'openai',
voice: 'alloy',
verbose: false
});
const result = await ttsAgent.speak('Hello from PraisonAI AudioAgent!');
console.log(' Audio format:', result.format);
console.log(' Audio size:', result.audio.byteLength || result.audio.length, 'bytes');
// Optionally save to file
const outputPath = path.join(__dirname, 'test-output.mp3');
if (result.audio instanceof Buffer) {
fs.writeFileSync(outputPath, result.audio);
console.log(' Saved to:', outputPath);
}
console.log(' Success: ✅');
} catch (error: any) {
console.log(' ⚠️ TTS failed:', error.message);
}
// Test 4: Live Transcription (requires audio file)
console.log('\n4. Testing Speech-to-Text (live API):');
try {
const sttAgent = new AudioAgent({
provider: 'openai',
verbose: false
});
// Check if we have the test output from TTS
const audioPath = path.join(__dirname, 'test-output.mp3');
if (fs.existsSync(audioPath)) {
const result = await sttAgent.transcribe(audioPath);
console.log(' Transcribed text:', result.text);
console.log(' Language:', result.language || 'auto-detected');
console.log(' Success: ✅');
// Cleanup
fs.unlinkSync(audioPath);
console.log(' Cleaned up test file');
} else {
console.log(' Skipped (no test audio file available)');
}
} catch (error: any) {
console.log(' ⚠️ STT failed:', error.message);
}
// Test 5: Chat method (auto-detect mode)
console.log('\n5. Testing chat() method:');
try {
const chatAgent = new AudioAgent({ provider: 'openai', voice: 'echo' });
// Text input -> TTS
const chatResult = await chatAgent.chat('Testing audio chat interface');
console.log(' Chat result:', chatResult);
console.log(' Success: ✅');
} catch (error: any) {
console.log(' ⚠️ Chat failed:', error.message);
}
} else {
console.log('\n3-5. Live API Tests: Skipped (OPENAI_API_KEY not set)');
console.log(' Set OPENAI_API_KEY to run live tests');
}
// Test 6: Different providers (just creation, no live calls)
console.log('\n6. Testing provider configurations:');
const providers = ['openai', 'elevenlabs', 'groq', 'deepgram'] as const;
for (const provider of providers) {
try {
const a = new AudioAgent({ provider });
console.log(` ${provider}: ✅ (created)`);
} catch (error: any) {
console.log(` ${provider}: ⚠️ ${error.message}`);
}
}
// Test 7: Voice options
console.log('\n7. Testing OpenAI voice options:');
const voices = ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'];
for (const voice of voices) {
const a = new AudioAgent({ provider: 'openai', voice });
console.log(` ${voice}: ✅`);
}
console.log('\n=== AudioAgent Tests Complete ===');
}
main().catch(console.error);
-124
View File
@@ -1,124 +0,0 @@
/**
* ChonkieAdapter Integration Test
*
* Tests the ChonkieJS adapter for text chunking.
* Works without ChonkieJS installed (uses native fallback).
*
* Run: npx ts-node chonkie-adapter.ts
*/
import {
ChonkieAdapter,
createChonkieAdapter,
hasChonkie,
Chunking
} from '../../../src/praisonai-ts/dist';
async function main() {
console.log('=== ChonkieAdapter Integration Test ===\n');
// Test 1: Check ChonkieJS availability
console.log('1. Checking ChonkieJS availability:');
const chonkieAvailable = await hasChonkie();
console.log(` ChonkieJS installed: ${chonkieAvailable ? '✅' : '❌ (using native fallback)'}`);
// Test 2: Create adapter with default config
console.log('\n2. Testing ChonkieAdapter creation:');
const adapter = new ChonkieAdapter({
strategy: 'token',
chunkSize: 100,
overlap: 20
});
console.log(' Adapter created: ✅');
console.log(' Info:', adapter.getInfo());
// Test 3: Chunk text
console.log('\n3. Testing text chunking:');
const sampleText = `
PraisonAI is a high-performance, agentic AI framework designed with minimal client-side API.
It features extreme performance sensitivity, lazy loading everywhere, and optional dependencies only.
The framework supports clean separation between Core SDK, Wrapper/integrations, and Tools/plugins.
All features must have a relevant CLI integration and representation.
`.trim();
const chunks = await adapter.chunk(sampleText);
console.log(` Input length: ${sampleText.length} characters`);
console.log(` Chunks created: ${chunks.length}`);
chunks.forEach((chunk, i) => {
console.log(` [${i}]: "${chunk.content.slice(0, 50)}..." (${chunk.content.length} chars)`);
});
console.log(' Success: ✅');
// Test 4: Different strategies
console.log('\n4. Testing different chunking strategies:');
const strategies = ['size', 'sentence', 'paragraph', 'semantic'] as const;
for (const strategy of strategies) {
const strategyAdapter = createChonkieAdapter({ strategy, chunkSize: 80 });
const strategyChunks = await strategyAdapter.chunk(sampleText);
console.log(` ${strategy}: ${strategyChunks.length} chunks`);
}
console.log(' Success: ✅');
// Test 5: Native Chunking class
console.log('\n5. Testing native Chunking class:');
const nativeChunker = new Chunking({ chunkSize: 100, overlap: 10, strategy: 'sentence' });
const nativeChunks = nativeChunker.chunk(sampleText);
console.log(` Native chunks: ${nativeChunks.length}`);
console.log(' Success: ✅');
// Test 6: Factory function
console.log('\n6. Testing createChunking() factory:');
const factoryChunker = createChunking({ chunkSize: 200 });
const factoryChunks = factoryChunker.chunk(sampleText);
console.log(` Factory chunks: ${factoryChunks.length}`);
console.log(' Success: ✅');
// Test 7: Merge small chunks
console.log('\n7. Testing mergeSmallChunks:');
const tinyChunker = new Chunking({ chunkSize: 20, overlap: 5 });
const tinyChunks = tinyChunker.chunk(sampleText);
const mergedChunks = tinyChunker.mergeSmallChunks(tinyChunks, 50);
console.log(` Before merge: ${tinyChunks.length} chunks`);
console.log(` After merge: ${mergedChunks.length} chunks`);
console.log(' Success: ✅');
// Test 8: Code chunking (if ChonkieJS available)
if (chonkieAvailable) {
console.log('\n8. Testing code chunking (ChonkieJS):');
const codeAdapter = createChonkieAdapter({ strategy: 'code', language: 'typescript' });
const codeText = `
function hello() {
console.log('Hello');
}
class MyClass {
constructor() {
this.value = 42;
}
getValue() {
return this.value;
}
}
`.trim();
const codeChunks = await codeAdapter.chunk(codeText);
console.log(` Code chunks: ${codeChunks.length}`);
console.log(' Success: ✅');
} else {
console.log('\n8. Code chunking: Skipped (ChonkieJS not installed)');
}
// Test 9: Verify adapter info
console.log('\n9. Verifying adapter state:');
const info = adapter.getInfo();
console.log(` Strategy: ${info.strategy}`);
console.log(` Using ChonkieJS: ${info.usingChonkie}`);
console.log(` Chunk size: ${info.config.chunkSize}`);
console.log(' Success: ✅');
console.log('\n=== ChonkieAdapter Tests Complete ===');
}
main().catch(console.error);
-97
View File
@@ -1,97 +0,0 @@
/**
* QueryEngine Integration Test
*
* Tests semantic and keyword search for RAG applications.
*
* Run: npx ts-node query-engine.ts
*/
import {
QueryEngine,
createQueryEngine,
createSimpleQueryEngine
} from '../../../src/praisonai-ts/dist';
async function main() {
console.log('=== QueryEngine Integration Test ===\n');
// Test 1: Simple in-memory engine
console.log('1. Testing simple in-memory QueryEngine:');
const docs = [
{ id: 'doc1', content: 'PraisonAI is a high-performance AI agent framework designed for production use.' },
{ id: 'doc2', content: 'TypeScript provides static typing and better tooling for JavaScript projects.' },
{ id: 'doc3', content: 'Agents can use tools, memory, and knowledge to complete complex tasks.' },
{ id: 'doc4', content: 'RAG (Retrieval-Augmented Generation) improves AI responses with relevant context.' },
{ id: 'doc5', content: 'Workflows enable sequential and parallel execution of agent tasks.' }
];
const engine = createSimpleQueryEngine(docs);
const results1 = await engine.query('agent framework', { topK: 2 });
console.log(' Query: "agent framework"');
console.log(` Found: ${results1.length} results`);
results1.forEach((r, i) => {
console.log(` [${i + 1}] ${r.content.slice(0, 50)}... (score: ${r.score.toFixed(2)})`);
});
console.log(' Success: ✅');
// Test 2: Different queries
console.log('\n2. Testing various queries:');
const queries = ['TypeScript', 'RAG', 'workflow', 'tools memory'];
for (const q of queries) {
const results = await engine.query(q, { topK: 1 });
console.log(` "${q}" → ${results.length > 0 ? results[0].content.slice(0, 40) + '...' : 'No results'}`);
}
console.log(' Success: ✅');
// Test 3: Query for context string
console.log('\n3. Testing queryForContext:');
const context = await engine.queryForContext('agent tasks', { topK: 2 });
console.log(' Context string (preview):');
console.log(' ' + context.split('\n')[0]);
console.log(' Success: ✅');
// Test 4: Cache behavior
console.log('\n4. Testing caching:');
const start = Date.now();
await engine.query('agent framework', { topK: 2 });
const cachedTime = Date.now() - start;
console.log(` Cached query time: ${cachedTime}ms (should be fast)`);
engine.clearCache();
const start2 = Date.now();
await engine.query('agent framework', { topK: 2 });
const uncachedTime = Date.now() - start2;
console.log(` Uncached query time: ${uncachedTime}ms`);
console.log(' Success: ✅');
// Test 5: QueryEngine configuration
console.log('\n5. Testing custom QueryEngine configuration:');
const customEngine = new QueryEngine({
keywordSearch: async (query, options) => {
return docs
.filter(d => d.content.toLowerCase().includes(query.toLowerCase()))
.map(d => ({ id: d.id, content: d.content, score: 0.8 }))
.slice(0, options?.topK ?? 5);
},
defaultOptions: { mode: 'keyword', topK: 3 }
});
const customResults = await customEngine.query('TypeScript');
console.log(` Custom engine results: ${customResults.length}`);
console.log(' Success: ✅');
// Test 6: Empty results handling
console.log('\n6. Testing empty results:');
const emptyResults = await engine.query('nonexistent_query_12345');
console.log(` Results for nonsense query: ${emptyResults.length}`);
const emptyContext = await engine.queryForContext('nonexistent_query_12345');
console.log(` Context: "${emptyContext}"`);
console.log(' Success: ✅');
console.log('\n=== QueryEngine Tests Complete ===');
}
main().catch(console.error);
-136
View File
@@ -1,136 +0,0 @@
/**
* MCP Client Integration Test
*
* Tests the MCP (Model Context Protocol) client.
* Note: Requires an MCP server for full integration tests.
*
* Run: npx ts-node mcp-client.ts
*/
import {
MCPClient,
createMCPClient,
getMCPTools,
type MCPClientConfig
} from '../../../src/praisonai-ts/dist/mcp';
async function main() {
console.log('=== MCPClient Integration Test ===\n');
// Test 1: Create MCP client
console.log('1. Testing MCPClient creation:');
const client = new MCPClient({
serverUrl: 'http://localhost:3000',
transport: 'http',
timeout: 5000,
verbose: true
});
console.log(' Client ID:', client.id);
console.log(' Connected:', client.isConnected());
console.log(' Success: ✅');
// Test 2: Factory function
console.log('\n2. Testing createMCPClient() factory:');
const client2 = createMCPClient({ serverUrl: 'http://localhost:8080' });
console.log(' Client created:', typeof client2);
console.log(' Success: ✅');
// Test 3: Transport configurations
console.log('\n3. Testing transport configurations:');
const transports: MCPClientConfig['transport'][] = ['http', 'websocket', 'sse', 'stdio'];
for (const transport of transports) {
try {
const c = new MCPClient({
transport,
serverUrl: transport !== 'stdio' ? 'http://localhost:3000' : undefined,
command: transport === 'stdio' ? 'npx' : undefined,
args: transport === 'stdio' ? ['mcp-server'] : undefined
});
console.log(` ${transport}: ✅ (configured)`);
} catch (error: any) {
console.log(` ${transport}: ⚠️ ${error.message}`);
}
}
// Test 4: Session info
console.log('\n4. Testing session management:');
const session = client.getSession();
console.log(' Session ID:', session.id);
console.log(' Connected:', session.connected);
console.log(' Tools:', session.tools.length);
console.log(' Resources:', session.resources.length);
console.log(' Success: ✅');
// Test 5: Live connection test (optional - requires running server)
const testServerUrl = process.env.MCP_SERVER_URL;
if (testServerUrl) {
console.log('\n5. Testing live MCP connection:');
try {
const liveClient = new MCPClient({
serverUrl: testServerUrl,
transport: 'http',
timeout: 10000,
verbose: false
});
await liveClient.connect();
console.log(' Connected: ✅');
const tools = await liveClient.listTools();
console.log(` Tools discovered: ${tools.length}`);
for (const tool of tools.slice(0, 3)) {
console.log(` - ${tool.name}: ${tool.description || 'No description'}`);
}
// Get tools in AI SDK format
const aiTools = await liveClient.getToolsAsAISDK();
console.log(` AI SDK tools: ${aiTools.length}`);
await liveClient.disconnect();
console.log(' Disconnected: ✅');
} catch (error: any) {
console.log(` ⚠️ Connection failed: ${error.message}`);
}
} else {
console.log('\n5. Live connection: Skipped (MCP_SERVER_URL not set)');
console.log(' Set MCP_SERVER_URL to test live connections');
}
// Test 6: Mock tool call simulation
console.log('\n6. Testing tool call preparation:');
const mockTool = {
name: 'search',
description: 'Search for information',
inputSchema: {
type: 'object',
properties: {
query: { type: 'string', description: 'Search query' }
},
required: ['query']
}
};
console.log(' Mock tool:', mockTool.name);
console.log(' Schema:', JSON.stringify(mockTool.inputSchema));
console.log(' Success: ✅');
// Test 7: API Key configuration
console.log('\n7. Testing API key configuration:');
const authClient = new MCPClient({
serverUrl: 'http://api.example.com',
apiKey: 'test-api-key-12345'
});
console.log(' Client with API key: ✅');
// Test 8: getMCPTools helper
console.log('\n8. Testing getMCPTools helper signature:');
console.log(' getMCPTools function:', typeof getMCPTools);
console.log(' Returns: { client, tools }');
console.log(' Success: ✅');
console.log('\n=== MCPClient Tests Complete ===');
console.log('\nNote: For full integration tests, run an MCP server and set MCP_SERVER_URL');
}
main().catch(console.error);
-137
View File
@@ -1,137 +0,0 @@
/**
* MemoryHooks Integration Test
*
* Tests pre/post hooks for memory operations.
*
* Run: npx ts-node memory-hooks.ts
*/
import {
MemoryHooks,
createMemoryHooks,
createLoggingHooks,
createValidationHooks,
Memory,
createMemory
} from '../../../src/praisonai-ts/dist';
async function main() {
console.log('=== MemoryHooks Integration Test ===\n');
// Test 1: Basic hooks
console.log('1. Testing basic MemoryHooks:');
const logs: string[] = [];
const hooks = new MemoryHooks({
beforeStore: async (key, value) => {
logs.push(`beforeStore: ${key}`);
return { key, value };
},
afterStore: async (key) => {
logs.push(`afterStore: ${key}`);
},
beforeRetrieve: async (key) => {
logs.push(`beforeRetrieve: ${key}`);
return key;
},
afterRetrieve: async (key, value) => {
logs.push(`afterRetrieve: ${key}`);
return value;
}
});
await hooks.beforeStore('key1', { data: 'value1' });
await hooks.afterStore('key1', { data: 'value1' });
await hooks.beforeRetrieve('key1');
await hooks.afterRetrieve('key1', { data: 'value1' });
console.log(' Triggered hooks:', logs);
console.log(' Success: ✅');
// Test 2: Logging hooks
console.log('\n2. Testing createLoggingHooks:');
const logMessages: string[] = [];
const loggingHooks = createLoggingHooks((msg) => logMessages.push(msg));
await loggingHooks.beforeStore('test', 'data');
await loggingHooks.afterStore('test', 'data');
await loggingHooks.beforeRetrieve('test');
await loggingHooks.afterRetrieve('test', 'data');
console.log(' Log messages:', logMessages.length);
logMessages.forEach(m => console.log(' -', m));
console.log(' Success: ✅');
// Test 3: Validation hooks
console.log('\n3. Testing createValidationHooks:');
const validationHooks = createValidationHooks((key, value) => {
// Only allow non-empty strings
if (typeof value !== 'string' || value.length === 0) {
return { valid: false, reason: 'Value must be non-empty string' };
}
return { valid: true };
});
const validResult = await validationHooks.beforeStore('good', 'valid string');
console.log(' Valid data allowed:', validResult !== null);
const invalidResult = await validationHooks.beforeStore('bad', '');
console.log(' Invalid data blocked:', invalidResult === null);
console.log(' Success: ✅');
// Test 4: Delete hooks
console.log('\n4. Testing delete hooks:');
const deleteHooks = new MemoryHooks({
beforeDelete: async (key) => {
console.log(` [Hook] About to delete: ${key}`);
return true; // Allow deletion
},
afterDelete: async (key, success) => {
console.log(` [Hook] Delete ${key}: ${success ? 'succeeded' : 'failed'}`);
}
});
const canDelete = await deleteHooks.beforeDelete('item-to-delete');
console.log(' Deletion allowed:', canDelete);
await deleteHooks.afterDelete('item-to-delete', true);
console.log(' Success: ✅');
// Test 5: Search hooks
console.log('\n5. Testing search hooks:');
const searchHooks = new MemoryHooks({
beforeSearch: async (query, options) => {
console.log(` [Hook] Searching: "${query}"`);
// Could modify query here
return { query: query.toLowerCase(), options };
},
afterSearch: async (query, results) => {
console.log(` [Hook] Found ${results.length} results for "${query}"`);
return results;
}
});
const searchParams = await searchHooks.beforeSearch('UPPERCASE QUERY');
console.log(' Modified query:', searchParams?.query);
await searchHooks.afterSearch('query', [{ id: '1' }, { id: '2' }]);
console.log(' Success: ✅');
// Test 6: Dynamic hook management
console.log('\n6. Testing dynamic hook management:');
const dynamicHooks = new MemoryHooks({});
console.log(' Initial config:', Object.keys(dynamicHooks.getConfig()).length === 0 ? 'empty' : 'has hooks');
dynamicHooks.addHook('logging', true);
dynamicHooks.setLogging(true);
console.log(' After adding logging:', dynamicHooks.getConfig().logging);
dynamicHooks.removeHook('logging');
console.log(' After removing:', dynamicHooks.getConfig().logging ?? 'undefined');
console.log(' Success: ✅');
console.log('\n=== MemoryHooks Tests Complete ===');
}
main().catch(console.error);
-181
View File
@@ -1,181 +0,0 @@
/**
* Feature Parity Integration Test Runner
*
* Runs all integration tests for the new TypeScript features.
* Tests include real API calls when OPENAI_API_KEY is available.
*
* Run: npx ts-node run-feature-tests.ts
*/
import { execSync, spawn } from 'child_process';
import * as path from 'path';
import * as fs from 'fs';
interface TestResult {
name: string;
passed: boolean;
duration: number;
output: string;
error?: string;
}
const TEST_FILES = [
// Workflow patterns
'workflows/loop-pattern.ts',
'workflows/repeat-pattern.ts',
// Agents
'agents/audio-agent.ts',
// Knowledge
'knowledge/chonkie-adapter.ts',
// MCP
'mcp/mcp-client-test.ts',
];
async function runTest(testFile: string): Promise<TestResult> {
const startTime = Date.now();
const fullPath = path.join(__dirname, testFile);
const name = path.basename(testFile, '.ts');
return new Promise((resolve) => {
const proc = spawn('npx', ['ts-node', fullPath], {
cwd: __dirname,
env: { ...process.env },
stdio: ['pipe', 'pipe', 'pipe']
});
let stdout = '';
let stderr = '';
proc.stdout.on('data', (data) => {
stdout += data.toString();
});
proc.stderr.on('data', (data) => {
stderr += data.toString();
});
proc.on('close', (code) => {
const duration = Date.now() - startTime;
resolve({
name,
passed: code === 0,
duration,
output: stdout,
error: stderr || undefined
});
});
proc.on('error', (error) => {
const duration = Date.now() - startTime;
resolve({
name,
passed: false,
duration,
output: '',
error: error.message
});
});
// Timeout after 60 seconds
setTimeout(() => {
proc.kill();
resolve({
name,
passed: false,
duration: 60000,
output: stdout,
error: 'Test timed out after 60 seconds'
});
}, 60000);
});
}
async function main() {
console.log('╔════════════════════════════════════════════════════════════╗');
console.log('║ PraisonAI TypeScript Feature Parity Integration Tests ║');
console.log('╚════════════════════════════════════════════════════════════╝\n');
// Environment info
console.log('Environment:');
console.log(` OPENAI_API_KEY: ${process.env.OPENAI_API_KEY ? '✅ Set' : '❌ Not set'}`);
console.log(` MCP_SERVER_URL: ${process.env.MCP_SERVER_URL ? '✅ Set' : '❌ Not set'}`);
console.log(` Node version: ${process.version}`);
console.log('');
// Check if test files exist
console.log('Test Files:');
for (const file of TEST_FILES) {
const fullPath = path.join(__dirname, file);
const exists = fs.existsSync(fullPath);
console.log(` ${exists ? '✅' : '❌'} ${file}`);
}
console.log('');
// Run tests
console.log('Running Tests...\n');
console.log('─'.repeat(60));
const results: TestResult[] = [];
for (const testFile of TEST_FILES) {
const fullPath = path.join(__dirname, testFile);
if (!fs.existsSync(fullPath)) {
results.push({
name: path.basename(testFile, '.ts'),
passed: false,
duration: 0,
output: '',
error: 'File not found'
});
continue;
}
console.log(`\n▶ Running: ${testFile}`);
const result = await runTest(testFile);
results.push(result);
if (result.passed) {
console.log(` ✅ PASSED (${result.duration}ms)`);
} else {
console.log(` ❌ FAILED (${result.duration}ms)`);
if (result.error) {
console.log(` Error: ${result.error.slice(0, 200)}...`);
}
}
}
console.log('\n' + '─'.repeat(60));
// Summary
const passed = results.filter(r => r.passed).length;
const failed = results.filter(r => !r.passed).length;
const totalDuration = results.reduce((sum, r) => sum + r.duration, 0);
console.log('\n╔════════════════════════════════════════════════════════════╗');
console.log('║ TEST SUMMARY ║');
console.log('╚════════════════════════════════════════════════════════════╝');
console.log(` Total Tests: ${results.length}`);
console.log(` Passed: ${passed} ✅`);
console.log(` Failed: ${failed} ${failed > 0 ? '❌' : ''}`);
console.log(` Duration: ${(totalDuration / 1000).toFixed(2)}s`);
console.log('');
// Detailed results
if (failed > 0) {
console.log('Failed Tests:');
for (const result of results.filter(r => !r.passed)) {
console.log(` ❌ ${result.name}`);
if (result.error) {
console.log(` ${result.error.slice(0, 100)}`);
}
}
console.log('');
}
// Exit with appropriate code
process.exit(failed > 0 ? 1 : 0);
}
main().catch((error) => {
console.error('Test runner failed:', error);
process.exit(1);
});
-112
View File
@@ -1,112 +0,0 @@
/**
* SubagentTool Integration Test
*
* Tests the agent-as-tool pattern with real agents.
*
* Run: npx ts-node subagent-tool.ts
* Requires: OPENAI_API_KEY
*/
import {
Agent,
SubagentTool,
createSubagentTool,
createSubagentTools,
createDelegator
} from '../../../src/praisonai-ts/dist';
async function main() {
console.log('=== SubagentTool Integration Test ===\n');
// Test 1: Create SubagentTool
console.log('1. Testing SubagentTool creation:');
const mockAgent = {
name: 'MockAgent',
chat: async (input: string) => `Echo: ${input}`
};
const tool = new SubagentTool(mockAgent, {
name: 'echo',
description: 'Echo the input'
});
console.log(' Tool name:', tool.name);
console.log(' Tool ID:', tool.id);
console.log(' Schema:', JSON.stringify(tool.getSchema()));
console.log(' Success: ✅');
// Test 2: Execute tool with mock agent
console.log('\n2. Testing tool execution:');
const mockResult = await tool.execute({ input: 'Hello World' });
console.log(' Input: "Hello World"');
console.log(' Output:', mockResult);
console.log(' Success: ✅');
// Test 3: Factory function
console.log('\n3. Testing createSubagentTool factory:');
const factoryTool = createSubagentTool(mockAgent, { name: 'factory_echo' });
console.log(' Tool name:', factoryTool.name);
console.log(' Success: ✅');
// Test 4: Multiple subagent tools
console.log('\n4. Testing createSubagentTools (batch):');
const agents = [
{ name: 'Agent1', chat: async (i: string) => `A1: ${i}` },
{ name: 'Agent2', chat: async (i: string) => `A2: ${i}` }
];
const tools = createSubagentTools(agents);
console.log(' Created tools:', tools.length);
tools.forEach(t => console.log(' -', t.name));
console.log(' Success: ✅');
// Test 5: AI SDK format conversion
console.log('\n5. Testing AI SDK format conversion:');
const aiTool = tool.toAISDKTool();
console.log(' Type:', aiTool.type);
console.log(' Function name:', aiTool.function.name);
console.log(' Has execute:', typeof aiTool.execute === 'function');
console.log(' Success: ✅');
// Test 6: Live test with real agent
if (process.env.OPENAI_API_KEY) {
console.log('\n6. Testing with real Agent (live API):');
try {
const researcher = new Agent({
name: 'QuickResearcher',
instructions: 'Answer in exactly 5 words.',
llm: 'openai/gpt-4o-mini'
});
const researchTool = createSubagentTool(researcher, {
name: 'quick_research',
description: 'Get a quick 5-word answer'
});
const result = await researchTool.execute({ input: 'What is AI?' });
console.log(' Question: "What is AI?"');
console.log(' Answer:', result);
console.log(' Success: ✅');
} catch (error: any) {
console.log(' Error:', error.message);
}
} else {
console.log('\n6. Live test: Skipped (OPENAI_API_KEY not set)');
}
// Test 7: Input/Output transforms
console.log('\n7. Testing transforms:');
const transformTool = createSubagentTool(mockAgent, {
name: 'transform_echo',
inputTransform: (input) => input.toUpperCase(),
outputTransform: (output) => `[TRANSFORMED] ${output}`
});
const transformResult = await transformTool.execute({ input: 'hello' });
console.log(' Input: "hello"');
console.log(' Output:', transformResult);
console.log(' Success: ✅');
console.log('\n=== SubagentTool Tests Complete ===');
}
main().catch(console.error);
-88
View File
@@ -1,88 +0,0 @@
/**
* Loop Pattern Integration Test
*
* Tests the Loop workflow pattern with real data.
*
* Run: npx ts-node loop-pattern.ts
*/
import { Loop, loopPattern, Agent, Workflow } from '../../../src/praisonai-ts/dist';
async function main() {
console.log('=== Loop Pattern Integration Test ===\n');
// Test 1: Basic Loop with array
console.log('1. Testing Loop with array iteration:');
const items = ['apple', 'banana', 'cherry'];
const processor = (item: string) => `Processed: ${item.toUpperCase()}`;
const arrayLoop = new Loop(processor, { over: 'items' });
const result1 = await arrayLoop.run({ items });
console.log(' Results:', result1.results);
console.log(' Iterations:', result1.iterations);
console.log(' Success:', result1.success ? '✅' : '❌');
// Test 2: Loop with convenience function
console.log('\n2. Testing loop() convenience function:');
const doubler = (n: number) => n * 2;
const numberLoop = loopPattern(doubler, { over: 'numbers' });
const result2 = await numberLoop.run({ numbers: [1, 2, 3, 4, 5] });
console.log(' Input: [1, 2, 3, 4, 5]');
console.log(' Output:', result2.results);
console.log(' Success:', result2.success ? '✅' : '❌');
// Test 3: Loop with Agent (requires OPENAI_API_KEY)
if (process.env.OPENAI_API_KEY) {
console.log('\n3. Testing Loop with Agent (live API):');
try {
const agent = new Agent({
name: 'Summarizer',
instructions: 'Summarize the given topic in one sentence.',
llm: 'openai/gpt-4o-mini'
});
const topics = ['AI', 'TypeScript'];
const agentLoop = new Loop(agent, { over: 'topics', varName: 'topic' });
console.log(' Processing topics:', topics);
const result3 = await agentLoop.run({ topics });
result3.results.forEach((res, i) => {
console.log(` [${topics[i]}]: ${res.slice(0, 80)}...`);
});
console.log(' Success:', result3.success ? '✅' : '❌');
} catch (error: any) {
console.log(' ⚠️ Agent test failed:', error.message);
}
} else {
console.log('\n3. Agent Loop Test: Skipped (OPENAI_API_KEY not set)');
}
// Test 4: Loop with error handling
console.log('\n4. Testing Loop with continueOnError:');
const errorProneProcessor = (item: string) => {
if (item === 'fail') throw new Error('Intentional failure');
return `OK: ${item}`;
};
const errorLoop = new Loop(errorProneProcessor, {
over: 'items',
continueOnError: true
});
const result4 = await errorLoop.run({ items: ['a', 'fail', 'b'] });
console.log(' Results:', result4.results);
console.log(' Errors:', result4.errors.length);
console.log(' Success:', result4.success ? '✅' : '❌ (expected - has errors)');
// Test 5: Loop type exports
console.log('\n5. Verifying exports:');
console.log(' Loop class:', typeof Loop);
console.log(' loop function:', typeof loopPattern);
console.log('\n=== Loop Pattern Tests Complete ===');
}
main().catch(console.error);
-114
View File
@@ -1,114 +0,0 @@
/**
* Repeat Pattern Integration Test
*
* Tests the Repeat workflow pattern for evaluator-optimizer loops.
*
* Run: npx ts-node repeat-pattern.ts
*/
import { Repeat, repeatPattern, Agent } from '../../../src/praisonai-ts/dist';
async function main() {
console.log('=== Repeat Pattern Integration Test ===\n');
// Test 1: Basic repeat until condition
console.log('1. Testing Repeat with condition:');
let counter = 0;
const incrementer = () => {
counter++;
return `Iteration ${counter}`;
};
const repeat1 = new Repeat(incrementer, {
until: (ctx) => ctx.iteration >= 3,
maxIterations: 10
});
const result1 = await repeat1.run('start');
console.log(' Results:', result1.iterations);
console.log(' Final:', result1.result);
console.log(' Condition met:', result1.conditionMet ? '✅' : '❌');
console.log(' Max reached:', result1.maxReached ? '⚠️' : 'No');
// Test 2: Repeat with content condition
console.log('\n2. Testing Repeat with content-based condition:');
let quality = 0;
const improver = (input: string, prev: string | null) => {
quality += 25;
return `Quality: ${quality}% - ${prev || input}`;
};
const repeat2 = new Repeat(improver, {
until: (ctx) => ctx.lastResult?.includes('100%') ?? false,
maxIterations: 5
});
quality = 0; // Reset
const result2 = await repeat2.run('Initial draft');
console.log(' Iterations:', result2.count);
console.log(' Final:', result2.result);
console.log(' Condition met:', result2.conditionMet ? '✅' : '❌');
// Test 3: Repeat reaching max iterations
console.log('\n3. Testing Repeat hitting max iterations:');
const neverDone = () => 'still working...';
const repeat3 = new Repeat(neverDone, {
until: () => false, // Never satisfied
maxIterations: 3
});
const result3 = await repeat3.run('start');
console.log(' Iterations:', result3.count);
console.log(' Max reached:', result3.maxReached ? '✅ (expected)' : '❌');
// Test 4: Repeat with Agent (requires OPENAI_API_KEY)
if (process.env.OPENAI_API_KEY) {
console.log('\n4. Testing Repeat with Agent (live API):');
try {
const agent = new Agent({
name: 'Optimizer',
instructions: 'Improve the given text. Add more detail and clarity. Say "DONE" when satisfied.',
llm: 'openai/gpt-4o-mini'
});
const repeat4 = new Repeat(agent, {
until: (ctx) => ctx.lastResult?.includes('DONE') ?? false,
maxIterations: 3
});
const result4 = await repeat4.run('Make this better: Hello world');
console.log(' Iterations:', result4.count);
console.log(' Final (truncated):', result4.result.slice(0, 100) + '...');
console.log(' Condition met:', result4.conditionMet ? '✅' : 'Max reached');
} catch (error: any) {
console.log(' ⚠️ Agent test failed:', error.message);
}
} else {
console.log('\n4. Agent Repeat Test: Skipped (OPENAI_API_KEY not set)');
}
// Test 5: Convenience function
console.log('\n5. Testing repeatPattern() convenience function:');
let seq = 0;
const sequencer = () => `seq-${++seq}`;
const repeat5 = repeatPattern(sequencer, {
until: (ctx) => ctx.iteration >= 2,
maxIterations: 5
});
seq = 0; // Reset
const result5 = await repeat5.run('');
console.log(' Results:', result5.iterations);
console.log(' Success:', result5.conditionMet ? '✅' : '❌');
// Test 6: Verify exports
console.log('\n6. Verifying exports:');
console.log(' Repeat class:', typeof Repeat);
console.log(' repeatPattern function:', typeof repeatPattern);
console.log('\n=== Repeat Pattern Tests Complete ===');
}
main().catch(console.error);
@@ -68,7 +68,7 @@ Answer questions based ONLY on the provided knowledge context.
If the answer is not in the context, say 'I don't have that information.'
Be precise and quote exact values when asked about codes or numbers.""",
knowledge=[temp_dir],
memory={"user_id": "demo_user"},
user_id="demo_user",
output="verbose",
)
@@ -50,7 +50,7 @@ Only authorized personnel with code WRENCH-992 may access this project.
instructions="You ingest and store knowledge.",
knowledge=[temp_dir],
user_id="user_alice", # Scoped to Alice
output="silent",
verbose=False,
)
# Ensure knowledge is processed
@@ -104,7 +104,7 @@ Only authorized personnel with code WRENCH-992 may access this project.
instructions="Answer questions based on the provided knowledge. If you don't have the information, say so.",
knowledge=[temp_dir],
user_id="user_alice", # Same scope as Agent A
output="silent",
verbose=False,
)
response = agent_b.chat("What is the secret access code for Project PHOENIX?")
-148
View File
@@ -1,148 +0,0 @@
"""
Multi-Server MCP Example.
This example demonstrates how to use multiple MCP servers with PraisonAI Agents,
including mixing MCP tools with regular Python function tools.
Requirements:
- Node.js and npx installed (or uvx for Python-based servers)
- pip install praisonaiagents[mcp]
- OPENAI_API_KEY environment variable set
Usage:
python multi_server.py
"""
from praisonaiagents import Agent, MCP
import os
def calculate(expression: str) -> str:
"""
A simple calculator tool that evaluates mathematical expressions.
Args:
expression: A mathematical expression to evaluate (e.g., "2 + 2")
Returns:
The result of the calculation
"""
try:
# Safe evaluation of mathematical expressions
allowed_chars = set("0123456789+-*/.() ")
if not all(c in allowed_chars for c in expression):
return "Error: Invalid characters in expression"
result = eval(expression)
return f"Result: {result}"
except Exception as e:
return f"Error: {str(e)}"
def main():
# Check for API key
if not os.environ.get("OPENAI_API_KEY"):
print("Please set OPENAI_API_KEY environment variable")
return
print("=" * 60)
print("Multi-Server MCP Example")
print("=" * 60)
# Create MCP instance with Time server
print("\nInitializing MCP servers...")
try:
time_mcp = MCP("uvx mcp-server-time", timeout=30)
print("✓ Time MCP server initialized")
except Exception as e:
print(f"✗ Time MCP server failed: {e}")
return
# Create an agent with multiple tool sources
agent = Agent(
name="MultiToolAgent",
instructions="""You are a helpful assistant with access to multiple tools:
1. Time tools - for getting current time in different timezones
2. Calculator - for mathematical calculations
Use the appropriate tool based on the user's request.""",
llm="openai/gpt-4o-mini",
tools=[time_mcp, calculate] # Mix MCP and regular tools
)
# Show available tools
print("\nAvailable tools:")
formatted_tools = agent._format_tools_for_completion(agent.tools)
for tool in formatted_tools:
print(f" - {tool['function']['name']}: {tool['function']['description'][:50]}...")
# Example queries
queries = [
"What time is it in Tokyo?",
"Calculate 15 * 7 + 23",
"What's the current time in New York and London?"
]
print("\n" + "=" * 60)
print("Running queries...")
print("=" * 60)
for i, query in enumerate(queries, 1):
print(f"\n--- Query {i} ---")
print(f"Question: {query}\n")
try:
response = agent.chat(query)
print(f"Response:\n{response}")
except Exception as e:
print(f"Error: {e}")
print("-" * 40)
# Clean up
time_mcp.shutdown()
print("\nDone!")
def demo_multiple_mcp_servers():
"""
Demonstrate using multiple MCP servers simultaneously.
This function shows how to create agents with multiple MCP servers,
each providing different capabilities.
"""
print("\n" + "=" * 60)
print("Multiple MCP Servers Demo")
print("=" * 60)
# Initialize multiple MCP servers
servers = {}
try:
servers['time'] = MCP("uvx mcp-server-time", timeout=30)
print("✓ Time server initialized")
except Exception as e:
print(f"✗ Time server failed: {e}")
# Create agent with all available servers
available_tools = list(servers.values())
if not available_tools:
print("No MCP servers available")
return
agent = Agent(
name="MultiServerAgent",
instructions="You have access to multiple MCP servers. Use the appropriate tools.",
llm="openai/gpt-4o-mini",
tools=available_tools
)
print(f"\nAgent created with {len(available_tools)} MCP server(s)")
# Clean up
for server in servers.values():
server.shutdown()
if __name__ == "__main__":
main()
-70
View File
@@ -1,70 +0,0 @@
"""
Sequential Thinking MCP Example.
This example demonstrates how to use the Sequential Thinking MCP server
with PraisonAI Agents to break down complex problems step by step.
Requirements:
- Node.js and npx installed
- pip install praisonaiagents[mcp]
- OPENAI_API_KEY environment variable set
Usage:
python sequential_thinking.py
"""
from praisonaiagents import Agent, MCP
import os
def main():
# Check for API key
if not os.environ.get("OPENAI_API_KEY"):
print("Please set OPENAI_API_KEY environment variable")
return
# Create MCP instance with Sequential Thinking server
# The server provides tools for step-by-step problem analysis
sequential_mcp = MCP(
"npx -y @modelcontextprotocol/server-sequential-thinking",
timeout=60
)
# Create an agent with the Sequential Thinking tools
agent = Agent(
name="ProblemSolver",
instructions="""You are an expert problem solver who breaks down complex problems
into manageable steps. When given a problem:
1. Use the sequential thinking tool to analyze it step by step
2. Provide clear, actionable steps
3. Explain your reasoning at each step""",
llm="openai/gpt-4o-mini",
tools=sequential_mcp
)
# Example problems to solve
problems = [
"Break down the process of making a cup of tea",
"How would you plan a weekend trip to a new city?",
"What steps would you take to learn a new programming language?"
]
print("=" * 60)
print("Sequential Thinking MCP Example")
print("=" * 60)
for i, problem in enumerate(problems, 1):
print(f"\n--- Problem {i} ---")
print(f"Question: {problem}\n")
response = agent.chat(problem)
print(f"Response:\n{response}")
print("-" * 40)
# Clean up
sequential_mcp.shutdown()
print("\nDone!")
if __name__ == "__main__":
main()
@@ -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",
@@ -74,7 +74,7 @@ def example_agent_locks():
agent = Agent(
name="LockTestAgent",
instructions="Test agent",
output="silent"
verbose=False
)
# Check for locks
@@ -112,7 +112,7 @@ def example_concurrent_real_api():
name="ConcurrentAgent",
instructions="Reply with one word only.",
llm="gpt-4o-mini",
output="silent"
verbose=False
)
results = []
+1 -1
View File
@@ -51,7 +51,7 @@ agent = Agent(
name="KnowledgeAssistant",
instructions="You are a helpful assistant with access to technical documentation.",
knowledge=[doc_path],
knowledge={
knowledge_config={
"vector_store": "qdrant",
"url": "http://localhost:6333"
}
+1 -1
View File
@@ -39,7 +39,7 @@ agent = Agent(
instructions="You are a helpful assistant. Keep responses brief.",
db=db_instance,
session_id="demo-session-001", # Same session_id = resume conversation
output="silent"
verbose=False
)
# Chat with persistence
@@ -46,7 +46,7 @@ agent = RouterAgent(
name="Smart Assistant",
role="Adaptive AI Assistant",
goal="Complete tasks using the most appropriate model",
models=["gpt-4o-mini", "gpt-4o-mini", "claude-3-5-sonnet-20241022"],
models=["gpt-5-nano", "gpt-5-nano", "claude-3-5-sonnet-20241022"],
routing_strategy="auto" # Automatic model selection
)
@@ -90,7 +90,7 @@ analyzer = RouterAgent(
goal="Analyze data efficiently",
models={
"gemini/gemini-1.5-flash": {},
"gpt-4o-mini": {},
"gpt-5-nano": {},
"claude-3-haiku-20240307": {}
},
model_router=router,
@@ -207,7 +207,7 @@ for i, agent in enumerate(auto.agents):
name=agent.name,
role=agent.role,
goal=agent.goal,
models=["gpt-4o-mini", "gpt-4o-mini", "claude-3-5-sonnet"],
models=["gpt-5-nano", "gpt-5-nano", "claude-3-5-sonnet"],
routing_strategy="auto"
)
@@ -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")
-10
View File
@@ -1,10 +0,0 @@
from praisonaiagents import AudioAgent
# Text to Speech
tts = AudioAgent(llm="openai/tts-1")
tts.say("Hello!", output="hello.mp3")
# Speech to Text
stt = AudioAgent(llm="openai/whisper-1")
text = stt.listen("hello.mp3")
print(text)
-7
View File
@@ -1,7 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="groq/whisper-large-v3") # 10x faster
text = agent.transcribe("audio.mp3", language="en")
print(text)
# Models: openai/whisper-1, groq/whisper-large-v3, deepgram/nova-2
-8
View File
@@ -1,8 +0,0 @@
# Speech-to-Text with Groq (fastest)
# Requires: export GROQ_API_KEY=your-key
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="groq/whisper-large-v3")
text = agent.listen("audio.mp3") # Replace with your audio file
print(text)
-5
View File
@@ -1,5 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="deepgram/nova-2")
text = agent.listen("audio.mp3")
print(text)
-5
View File
@@ -1,5 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="groq/whisper-large-v3")
text = agent.listen("audio.mp3")
print(text)
-5
View File
@@ -1,5 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/whisper-1")
text = agent.listen("audio.mp3")
print(text)
-7
View File
@@ -1,7 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/tts-1-hd")
agent.speech("Hello!", voice="nova", speed=1.2, output="hello.mp3")
# Voices: alloy, echo, fable, onyx, nova, shimmer
# Models: openai/tts-1, openai/tts-1-hd, openai/gpt-4o-mini-tts
-8
View File
@@ -1,8 +0,0 @@
# Text-to-Speech with OpenAI
# Requires: export OPENAI_API_KEY=your-key
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/tts-1")
agent.say("Hello world!", output="hello.mp3")
print("Saved to hello.mp3")
-4
View File
@@ -1,4 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="elevenlabs/eleven_multilingual_v2")
agent.say("Hello world!", output="hello.mp3")
-4
View File
@@ -1,4 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="gemini/gemini-2.5-flash-preview-tts")
agent.say("Hello world!", output="hello.mp3", voice="leda")
-4
View File
@@ -1,4 +0,0 @@
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/tts-1")
agent.say("Hello world!", output="hello.mp3")
-76
View File
@@ -1,76 +0,0 @@
"""
Messaging Bot Example - Deploy Agents to Telegram, Discord, Slack
This example demonstrates how to configure bots for different
messaging platforms.
"""
import os
from praisonaiagents import Agent, BotConfig
# Telegram Bot Configuration
telegram_config = BotConfig(
token=os.environ.get("TELEGRAM_BOT_TOKEN", ""),
command_prefix="/",
mention_required=True,
typing_indicator=True,
max_message_length=4096,
metadata={"platform": "telegram"}
)
# Discord Bot Configuration
discord_config = BotConfig(
token=os.environ.get("DISCORD_BOT_TOKEN", ""),
command_prefix="!",
mention_required=True,
typing_indicator=True,
metadata={
"platform": "discord",
"guild_ids": [] # Add your guild IDs here
}
)
# Slack Bot Configuration
slack_config = BotConfig(
token=os.environ.get("SLACK_BOT_TOKEN", ""),
command_prefix="/",
mention_required=True,
typing_indicator=True,
metadata={
"platform": "slack",
"app_token": os.environ.get("SLACK_APP_TOKEN", "")
}
)
# Create the agent that will handle messages
assistant = Agent(
name="assistant",
instructions="""You are a helpful assistant that responds to messages
from users on messaging platforms. Be friendly and concise.""",
llm="gpt-4o-mini"
)
if __name__ == "__main__":
print("Bot Configurations:")
print()
print("Telegram Config:")
print(f" Token configured: {bool(telegram_config.token)}")
print(f" Command prefix: {telegram_config.command_prefix}")
print(f" Mention required: {telegram_config.mention_required}")
print()
print("Discord Config:")
print(f" Token configured: {bool(discord_config.token)}")
print(f" Command prefix: {discord_config.command_prefix}")
print()
print("Slack Config:")
print(f" Token configured: {bool(slack_config.token)}")
print(f" Command prefix: {slack_config.command_prefix}")
print()
print("To start a bot, use the CLI:")
print(" praisonai bot telegram --token $TELEGRAM_BOT_TOKEN")
print(" praisonai bot discord --token $DISCORD_BOT_TOKEN")
print(" praisonai bot slack --token $SLACK_BOT_TOKEN")
+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",
@@ -8,7 +8,7 @@ Docs: https://docs.praison.ai/cli/git-integration
from praisonai.cli.features import GitIntegrationHandler
# Initialize
handler = GitIntegrationHandler(output="verbose")
handler = GitIntegrationHandler(verbose=True)
git = handler.initialize(repo_path=".")
# Check if it's a git repo
+1 -1
View File
@@ -8,7 +8,7 @@ Docs: https://docs.praison.ai/cli/repo-map
from praisonai.cli.features import RepoMapHandler
# Initialize with current directory
handler = RepoMapHandler(output="verbose")
handler = RepoMapHandler(verbose=True)
repo_map = handler.initialize(root=".")
# Get the repository map
@@ -9,7 +9,7 @@ from praisonai.cli.features import SandboxExecutorHandler
from praisonai.cli.features.sandbox_executor import SandboxMode
# Initialize with basic sandbox
handler = SandboxExecutorHandler(output="verbose")
handler = SandboxExecutorHandler(verbose=True)
sandbox = handler.initialize(mode="basic")
print(f"Sandbox mode: {handler.get_mode()}")
+1 -1
View File
@@ -26,7 +26,7 @@ pdf_agent = Agent(
backstory="You are an expert at reading, analyzing, and answering questions about PDF documents. You provide accurate, detailed answers based on the document content.",
instructions="Read the provided PDF document and answer questions about its content. Be specific and cite relevant sections when possible.",
knowledge=["document.pdf"], # Replace with your PDF file path
knowledge=config,
knowledge_config=config,
reflection=True,
@@ -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
@@ -24,7 +24,7 @@ knowledge_agent = Agent(
goal="Store and retrieve knowledge efficiently",
backstory="Expert in managing and utilizing stored knowledge",
knowledge=["sample.pdf"],
knowledge=config)
knowledge_config=config)
# Define a task for the agent
knowledge_task = Task(
@@ -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 -1
View File
@@ -13,7 +13,8 @@ config = {
agent = Agent(
name="Knowledge Agent",
instructions="You answer questions based on the provided knowledge.",
knowledge=["small.pdf"]
knowledge=["small.pdf"],
knowledge_config=config
)
agent.start("What is KAG in one line?")
@@ -139,7 +139,7 @@ def main():
name="AI Research Assistant",
instructions="You are an AI research assistant. Use your knowledge base to answer questions about artificial intelligence topics.",
knowledge=sample_documents, # Will use default knowledge config
knowledge=rerank_config, # Use reranking config
knowledge_config=rerank_config, # Use reranking config
llm="gpt-4o-mini"
)
+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",
Loaded 100 of 1393 files, more files were not shown because too many files have changed in this diff. Show more