Compare commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

## Changes

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

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

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

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

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

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

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

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

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

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

These tests verify that actionable error messages with install instructions
are shown when users try to use MCP functionality without the mcp package.
2025-12-30 16:14:15 +00:00
Mervin Praison fff67a96de feat: improve rate limiting with retry wrappers and uncapped token wait times
- Add _completion_with_retry() and _acompletion_with_retry() convenience wrappers
- Remove max_retry_delay cap from internal token wait times to ensure correct rate limiting
- Add max_delay cap (300s default) to _parse_retry_delay() to prevent unbounded sleep from API errors
- Improve retry delay regex patterns (non-greedy matching, HTTP Retry-After header)
- Add documentation notes about large token requests exceeding burst capacity
2025-12-30 16:10:24 +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
Mervin Praison b52708f3f6 Release v1.3.4 2025-12-30 15:10:46 +00:00
Mervin Praison ba37ce39d3 Release v2.8.0 2025-12-30 15:08:22 +00:00
majiayu000 519ad56e2b feat: add tokens_per_minute rate limiting and 429 error auto-retry
- Enhance RateLimiter class to support tokens_per_minute limiting
- Add acquire_tokens() method for token-based rate limiting
- Add wait_for_retry() methods for handling rate limit delays
- Add _call_with_retry() methods in LLM class for auto-retry on 429 errors
- Parse retry delay from API error responses (e.g., "retryDelay: 58s")
- Add rate_limiter, max_retries, retry_delay settings to LLM class

Closes #1086

Signed-off-by: majiayu000 <[email protected]>
2025-12-30 20:00:05 +08:00
majiayu000 98c5e8f175 fix: make MCP package import optional to prevent errors when not installed
Wrap mcp imports in try/except blocks in mcp.py, mcp_sse.py, and
mcp_http_stream.py. Add MCP_AVAILABLE flag to check availability at runtime.
When MCP class is instantiated without the mcp package installed, raise a
clear ImportError with installation instructions.

Closes #1091

Signed-off-by: majiayu000 <[email protected]>
2025-12-30 19:53:45 +08:00
Mervin Praison bf3fdd10f1 Release v2.7.9 2025-12-30 11:15:36 +00:00
Mervin Praison 4fdc51c6ed Add provider registry system with custom provider support
Implements extensible provider registry allowing users to register custom providers (e.g., Cloudflare, Ollama) alongside built-in providers. Updates `providers` CLI command to show registered/builtin/custom providers with `list` and `info` subcommands. Enhances `createProvider()` to accept provider instances, spec objects, or strings. Updates `hasApiKey()` to support provider aliases and custom env vars. Exports registry functions (`register
2025-12-30 11:04:31 +00:00
Mervin Praison ce5026fd30 Release v2.7.8 2025-12-30 08:49:10 +00:00
Mervin Praison 4428e98a16 Remove temporary debug workflow - tests now passing 2025-12-30 08:01:05 +00:00
Mervin Praison b934cc61ba Make unit tests continue on error to allow workflow completion 2025-12-30 07:44:10 +00:00
Mervin Praison 3bd2903877 Simplify debug workflow to show only failed tests 2025-12-30 07:28:35 +00:00
Mervin Praison 985a612273 Release v2.7.7 2025-12-30 07:28:15 +00:00
Mervin Praison 9b4cc1d472 Fix: Add async cleanup fixtures to suppress aiohttp unclosed session warnings 2025-12-30 07:12:24 +00:00
Mervin Praison ad5377900b Split test run and output display for better visibility 2025-12-30 07:06:12 +00:00
Mervin Praison a0f2d9d11a Fix debug workflow to properly capture pytest exit code with PIPESTATUS 2025-12-30 06:59:59 +00:00
Mervin Praison 7428bed13f Simplify debug workflow to show full test output 2025-12-30 06:54:04 +00:00
Mervin Praison fbc191c2a2 Update debug workflow to show detailed failure info 2025-12-30 06:47:55 +00:00
Mervin Praison 8a474d680d Fix debug workflow to properly show test failures 2025-12-30 06:41:50 +00:00
Mervin Praison eb120376f7 Update debug workflow to capture full test output with artifact 2025-12-30 06:35:52 +00:00
Mervin Praison d376d88d74 Update debug workflow to capture all test failures 2025-12-30 06:29:42 +00:00
Mervin Praison f0c31ba8ec Add quick debug workflow to identify failing tests 2025-12-30 06:23:46 +00:00
Mervin Praison 439bf42eec Fix: Add pytest_plugins for pytest-asyncio support in conftest.py 2025-12-29 20:50:17 +00:00
Mervin Praison fcaeba6894 Fix: Add sse-starlette dependency and fix JobExecutor event loop issue 2025-12-29 20:43:50 +00:00
Mervin Praison 8a4c2c2c43 Release v2.7.6 2025-12-29 17:28:44 +00:00
Mervin Praison 0b2e6ff69b examples 2025-12-29 16:25:23 +00:00
Mervin Praison 1050d66970 Release v2.7.5 2025-12-29 14:31:52 +00:00
Mervin Praison bf483f3bd6 Release v2.7.4 2025-12-29 13:01:04 +00:00
Mervin Praison 00ee8eb2f3 Release v2.7.3 2025-12-29 12:19:58 +00:00
Mervin Praison 9a5a432d96 Release v2.7.2 2025-12-29 11:40:55 +00:00
Mervin Praison 8cb5bbb605 Release v2.7.2 - update doctor examples with improved check listing and CI formatting
- Add doctor examples to main README with documentation link
- Sort checks by category in list_available_checks()
- Update registry method call from list_checks() to get_all_checks()
- Remove unused results variable in run_environment_checks()
- Fix f-string formatting in CI integration print statement
2025-12-29 02:19:16 +00:00
Mervin Praison 952514d73c Release v2.7.1 2025-12-29 02:15:51 +00:00
Mervin Praison 6e1dc34864 Release v2.7.0 2025-12-29 01:33:40 +00:00
Mervin Praison 820d5c2995 Release v2.6.8 2025-12-29 00:42:47 +00:00
Mervin Praison 0b1b3d3b3e Release v2.6.7 2025-12-29 00:22:52 +00:00
Mervin Praison 59107addc3 Release v2.6.6 2025-12-28 23:51:03 +00:00
Mervin Praison b460ded5e0 Release v2.6.5 2025-12-28 23:02:27 +00:00
Mervin Praison a8967ed200 Release v1.3.1 - add Router class with simplified keyword/pattern-based routing and agent session management
- Bump praisonai-ts version from 1.3.0 to 1.3.1
- Add Router class with simplified keyword/pattern-based routing API (5-line usage)
- Export Router, RouterAgent, createRouter, routeConditions from agent module
- Add SimpleRouterConfig and SimpleRouteConfig types for simplified configuration
- Support both Agent and EnhancedAgent types in router (AnyAgent union type)
- Add Router.chat() method for direct routing
2025-12-28 22:53:04 +00:00
Mervin Praison 9189f42470 Release v2.6.4 2025-12-28 21:47:32 +00:00
Mervin Praison c86f660f66 Release v2.6.3 2025-12-28 07:31:42 +00:00
Mervin Praison a2d181dd74 Release v2.6.2 2025-12-27 07:58:18 +00:00
Mervin Praison 7411fdbb52 Release v2.6.1 2025-12-26 19:41:45 +00:00
Mervin Praison e7a8ce8eb7 Release v2.6.0 2025-12-26 19:31:15 +00:00
Mervin Praison 61fb094306 Release v1.2.3 - add comprehensive CLI feature exports and command definitions
- Bump praisonai-ts version from 1.2.2 to 1.2.3
- Add 18 new command definitions to CLI spec: query-rewrite, prompt-expand, router, context, handoff, vector, observability, voice, reranker, graph-rag, cache, db, scheduler, jobs, checkpoints, fast-context, autonomy, sandbox, repo-map, git, n8n, external-agents, flow, cost, interactive
- Export FileMemory and AutoMemory classes with factory functions and types from memory module
- Export
2025-12-26 18:41:37 +00:00
Mervin Praison 018e8c78ab refactor(ts): update CLI to v1.0.0 spec and change default model to gpt-4o-mini
- Change default agent model from gpt-5-nano to gpt-4o-mini in simple.ts
- Refactor CLI to implement CLI Spec v1.0.0 with lazy command loading
- Add parseArgs() function for spec-compliant argument parsing
- Add executeCommand() for dynamic command module loading
- Add comprehensive command definitions: memory, session, knowledge, skills, mcp, auto, image, research, guardrail, telemetry, planning
- Export CLI_SPEC_VERSION,
2025-12-26 14:07:05 +00:00
Mervin Praison f0f0f653fe Release v2.5.7 2025-12-26 13:31:45 +00:00
Mervin Praison 98a4ff8450 Release v2.5.6 2025-12-26 13:11:09 +00:00
Mervin Praison d6333aaf33 Release v1.2.1 - refactor TypeScript tools to use generic BaseTool
- Bump praisonai-ts version from 1.2.0 to 1.2.1
- Refactor BaseTool to use generics for type-safe input/output parameters
- Update ArxivSearchTool and ArxivDownloadTool to extend generic BaseTool with typed params
- Update MCPTool to extend generic BaseTool
- Change tool method from execute() to run() for consistency
- Export ToolResult, ToolValidationError, validateTool, createTool from base module
- Remove Tool interface export
2025-12-26 11:47:17 +00:00
Mervin Praison 8005094267 update 2025-12-26 08:39:22 +00:00
Mervin Praison 08b21dabe3 Release v2.5.5 2025-12-26 08:16:54 +00:00
Mervin Praison 8c70d840df docs: add knowledge export/import CLI commands to README
- Add knowledge export/import row to features table with CLI link
- Document `praisonai knowledge export <file.json>` command
- Document `praisonai knowledge import <file.json>` command
2025-12-26 06:53:20 +00:00
Mervin Praison d8e944c1d3 Release v2.5.4 2025-12-26 06:49:33 +00:00
Mervin Praison 79b2b88f72 Release v2.5.3 2025-12-26 05:54:09 +00:00
Mervin Praison f5dfbd5670 fix: resolve Core Tests failures in knowledge/reranker integration
- Fix #1: MemoryConfig Pydantic validation - add _prepare_mem0_config() to strip
  PraisonAI-specific reranker fields (enabled, default_rerank) before passing to
  mem0, which only accepts provider and config fields

- Fix #2: LLM Reranker 'Chat' object not callable - check if client.chat is
  callable, not just if it exists. OpenAI client has chat as namespace object.
  Also handle max_completion_tokens vs max_tokens for different model versions.

- Fix #3: Chroma vector store metadata validation - ensure non-empty metadata
  dicts by adding placeholder key when metadata is empty or None

- Fix test file issues: add user_id parameter (required by mem0 API), handle
  dict return type from knowledge.search, use gpt-4o-mini for reranker test
  (gpt-5-nano returns empty responses with max_completion_tokens=10)
2025-12-26 05:52:46 +00:00
Mervin Praison aa6aa5933d fix: update test files to use gpt-5-nano for cheaper CI runs
- Update test_workflow_patterns.py to use gpt-5-nano instead of gpt-4o/gpt-4o-mini
- Also set OPENAI_MODEL_NAME=gpt-5-nano as CI secret
2025-12-26 05:26:40 +00:00
Mervin Praison ff3a4f2016 Release v2.5.2 2025-12-26 05:25:08 +00:00
Mervin Praison 0d5444fc23 fix: add missing praisonai.db module to git
- Add praisonai/db/ module that was being ignored by *.db pattern
- This fixes ModuleNotFoundError: No module named 'praisonai.db' in CI tests
2025-12-26 04:54:05 +00:00
Mervin Praison d7d5dab17b fix: add missing db module to git and update .gitignore
- Add praisonaiagents/db/ module that was being ignored by *.db pattern
- Add exception in .gitignore for the db module directory
- This fixes ModuleNotFoundError: No module named 'praisonaiagents.db' in CI
2025-12-26 04:49:31 +00:00
Mervin Praison 05678394e6 fix: remove sys.exit() at module level in test files causing pytest INTERNALERROR
- test_mini_agents_fix.py: Convert module-level sys.exit(1) to pytest.mark.skipif pattern
- test_xai_fix.py: Convert to proper pytest test function with cleanup

These sys.exit() calls at module level caused pytest to crash during test collection
with INTERNALERROR, breaking all CI pipelines.
2025-12-26 04:46:58 +00:00
Mervin Praison 54cddc09b4 Release v2.5.1 2025-12-26 04:23:51 +00:00
Mervin Praison 9cbab01785 Release v2.5.0 2025-12-26 02:20:59 +00:00
Mervin Praison de9d4bd3c6 Release v2.4.4 2025-12-26 01:21:26 +00:00
Mervin Praison aba2265e5e Release v2.4.3 2025-12-26 01:01:30 +00:00
Mervin Praison ebb9b24bff Release v2.4.2 2025-12-25 00:29:49 +00:00
Mervin Praison 759ef2c655 Update database initialization to use db() shortcut and expand tools table with 100+ tools 2025-12-25 00:24:48 +00:00
Mervin Praison cb4318f6e8 Release v2.4.1 2025-12-24 15:00:45 +00:00
Mervin Praison d9bb869d5e Add documentation for 6 new features: Shadow Git Checkpoints, Background Tasks, Policy Engine, Thinking Budgets, Output Styles, and Context Compaction 2025-12-24 08:02:48 +00:00
Mervin Praison 34b6aeb76b Release v2.4.0 2025-12-24 07:47:53 +00:00
Mervin Praison 078b7801e1 Add 'response' field to workflow API for consistency with single-agent endpoint 2025-12-23 17:50:07 +00:00
Mervin Praison a970e849b4 Release v2.3.87 2025-12-23 16:08:35 +00:00
Mervin Praison 8e68f4e71c Release v2.3.86 2025-12-23 15:23:31 +00:00
Mervin Praison 308758cdc2 Release v2.3.85 2025-12-23 15:07:46 +00:00
Mervin Praison f8fa61b082 Release v2.3.84 2025-12-23 14:57:15 +00:00
Mervin Praison 955d236924 Release v2.3.84 2025-12-23 13:20:08 +00:00
Mervin Praison d9d63c3a13 Release v2.3.83 2025-12-23 13:06:42 +00:00
Mervin Praison 5bee6eb470 Release v2.3.83 2025-12-23 11:42:47 +00:00
Mervin Praison 7cb1676b7c Release v2.3.82 2025-12-23 09:41:09 +00:00
Mervin Praison e2e9c3f9ee Release v2.3.81 2025-12-23 08:11:31 +00:00
Mervin Praison cbe8beeca6 Release v2.3.80 2025-12-23 07:54:07 +00:00
Mervin Praison f7b66a52b7 Release v2.3.79 2025-12-23 07:27:35 +00:00
Mervin Praison 6dbf194312 Release v2.3.78 2025-12-23 06:46:15 +00:00
Mervin Praison 335e8d7e47 Release v2.3.77 2025-12-23 06:28:26 +00:00
Mervin Praison d65840e092 Release v2.3.76 2025-12-23 05:40:52 +00:00
Mervin Praison 5a13571fdd Release v2.3.75 2025-12-22 19:11:32 +00:00
Mervin Praison e3b48c2526 Release v2.3.74 2025-12-22 17:01:50 +00:00
Mervin Praison 8d32238b4c Release v2.3.73 2025-12-22 15:47:51 +00:00
Mervin Praison c17b1298bb Reorganize README feature table with improved categorization and hierarchy 2025-12-22 14:50:37 +00:00
Mervin Praison ec6c150315 Release v2.3.72 2025-12-22 13:44:48 +00:00
Mervin Praison 3d26cedd5d Release v2.3.71 2025-12-22 11:59:12 +00:00
Mervin Praison 8c735a60b2 Release v2.3.70 2025-12-22 10:43:48 +00:00
Mervin Praison 2f5f2f1c13 Release v2.3.69 2025-12-22 10:40:53 +00:00
Mervin Praison 0253073c68 Release v2.3.68 2025-12-22 10:35:45 +00:00
Mervin Praison 7f0e334e8c Release v2.3.67 2025-12-22 09:14:33 +00:00
Mervin Praison cacf1097ef Release v2.3.66 2025-12-22 08:50:02 +00:00
Mervin Praison 09f01919d2 Fix duplicate --max-retries argument conflict in CLI parser 2025-12-21 05:19:08 +00:00
Mervin Praison 92397615f8 Release v2.3.65 2025-12-20 21:49:04 +00:00
Mervin Praison 4b21943a53 Release v2.3.64 2025-12-20 19:57:39 +00:00
Mervin Praison af56a753bd Release v2.3.63 2025-12-20 12:02:44 +00:00
Mervin Praison 15c2559a3c Release v2.3.62 2025-12-20 11:59:46 +00:00
Mervin Praison 3215bdc0a6 Release v2.3.61 2025-12-20 11:15:22 +00:00
Mervin Praison 0ff0d83744 fix: Preserve real API keys for integration tests in conftest.py
- Check for @pytest.mark.integration marker
- Check if test file is in integration/ directory
- This prevents conftest from overriding real API keys with 'test-key'
2025-12-20 03:58:13 +00:00
Mervin Praison 8f956f91dd fix: Improve API key validation in integration test skip conditions
- Check for 'sk-' prefix and minimum length (40 chars) to detect invalid keys
- This ensures tests are skipped when using placeholder/test API keys in CI
2025-12-20 03:54:58 +00:00
Mervin Praison 954f6ac33d fix: Skip integration tests when using test API key
- test_auto_generator_integration.py: Skip when OPENAI_API_KEY contains 'test'
- test_model_routing_real.py: Skip test_real_openai_call when using test key
- test_cli_integrations.py: Skip all tests when using test key

These tests require real API credentials and should not run in CI
when only a placeholder test key is available.
2025-12-20 03:51:22 +00:00
Mervin Praison 264d11d8d9 fix: Fix failing unit tests for ClaudeCodeSDK and QueryRewriter CLI
- test_use_sdk_option: Updated test to match actual behavior where use_sdk
  is only True when SDK is available (use_sdk and CLAUDE_SDK_AVAILABLE)
- test_applies_rewrite_before_agent: Fixed mocking to properly mock
  _run_with_status_display and praisonaiagents submodules
2025-12-20 03:47:28 +00:00
Mervin Praison 88da2bdd7b Release v2.3.60 2025-12-20 03:35:28 +00:00
Mervin Praison b84e6c2460 Release v2.3.59 2025-12-20 03:28:48 +00:00
Mervin Praison 0434b23ada Release v2.3.58 2025-12-20 03:08:31 +00:00
Mervin Praison a9951e0694 Release v2.3.57 2025-12-19 16:47:09 +00:00
Mervin Praison 073062cd96 Release v2.3.56 2025-12-19 16:14:58 +00:00
Mervin Praison 936b422876 Release v2.3.55 2025-12-19 16:05:38 +00:00
Mervin Praison 99ab421ce2 Release v2.3.54 2025-12-19 16:04:43 +00:00
Mervin Praison c1f334905e Release v2.3.53 2025-12-19 15:38:30 +00:00
Mervin Praison 6d3ba7cdf8 Release v2.3.52 2025-12-19 15:34:19 +00:00
Mervin Praison 96616498d2 Release v2.3.51 2025-12-19 15:25:30 +00:00
Mervin Praison 1cad345415 Release v2.3.50 2025-12-19 15:19:29 +00:00
Mervin Praison 802e7e52f9 fix(readme): correct CLI docs URLs to include /docs/ prefix
Changed all https://docs.praison.ai/cli/* URLs to https://docs.praison.ai/docs/cli/*
Fixed 39 URLs total
2025-12-19 13:01:53 +00:00
Mervin Praison 53704f234c Release v2.3.49 2025-12-19 12:49:12 +00:00
Mervin Praison b575994d91 docs(readme): update AI commit CLI with security scanning and auto mode
- Add full auto mode (-a) with stage, security check, commit, push
- Document security scanning features
- Add --no-verify flag documentation
- List detected sensitive patterns
2025-12-19 12:35:49 +00:00
Mervin Praison 7ed8596261 Release v2.3.48 2025-12-19 12:35:02 +00:00
Mervin Praison deef65c4bb Release v2.3.47 2025-12-19 12:23:05 +00:00
Mervin Praison d51327effd Release v2.3.46 2025-12-19 12:22:29 +00:00
Mervin Praison 30ce8857e8 fix: suppress crewai.cli.config INFO log at startup 2025-12-19 12:18:23 +00:00
Mervin Praison 397874ccfc Release v2.3.45 2025-12-19 12:16:12 +00:00
Mervin Praison 2016902e9a docs: Add examples README with quick links to docs 2025-12-19 11:14:24 +00:00
Mervin Praison d2d19511da docs: Update README with Model Router info and fix links
- Rename 'Router Agent' to 'Model Router' for consistency
- Fix docs link to point to /features/model-router
- Add model-routing template CLI command
- Add link to Model Router documentation
2025-12-19 11:13:48 +00:00
Mervin Praison bc9579b497 Add Code category with individual examples for external CLI integrations
- Add Code category in Key Features table (like Workflows)
- Add individual examples for each external agent:
  - claude_code_example.py
  - gemini_cli_example.py
  - codex_cli_example.py
  - cursor_cli_example.py
  - external_agents_example.py (all integrations)
  - code_editing_example.py
- Link to individual docs pages for each integration
- Organize code-related features under Code category
2025-12-19 11:07:25 +00:00
Mervin Praison 3161389341 Add External Agents CLI documentation to README
- Add External Agents feature to Key Features table
- Update Code Editing docs link to /code/editing
- Add External Agents CLI section with examples
- Include Python API usage examples
- Add environment variables documentation
- Link to detailed docs at docs.praison.ai/code/external-agents
2025-12-19 11:01:24 +00:00
Mervin Praison b01eb2b8fa Release v2.3.44 2025-12-19 10:50:33 +00:00
Mervin Praison e609fb7425 Release v2.3.43 2025-12-19 10:32:33 +00:00
Mervin Praison 168ef98473 feat: Implement all remaining AutoAgents improvements (TDD)
TODO 2: Single-Agent Option
- Add SingleAgentStructure Pydantic model
- Add single_agent parameter to AutoGenerator and WorkflowAutoGenerator

TODO 3: LLM-Based Pattern Recommendation
- Add PatternRecommendation Pydantic model (pattern, reasoning, confidence)
- Add recommend_pattern_llm() method to WorkflowAutoGenerator

TODO 4: Validation Gates
- Add ValidationGate Pydantic model (criteria, pass_action, fail_action)
- Add optional gates field to WorkflowStructure

TODO 6: Pattern Support for AutoGenerator
- Add pattern parameter to AutoGenerator
- Add recommend_pattern() method to AutoGenerator
- Add pattern-specific guidance in get_user_content()

TODO 7: Merge Support for WorkflowAutoGenerator
- Add merge parameter to generate() method
- Add merge_with_existing_workflow() method

TODO 10: Framework Support for WorkflowAutoGenerator
- Add framework parameter to WorkflowAutoGenerator
- Default framework is 'praisonai'

Test Coverage:
- 51 tests pass (up from 34)
- 17 new tests added using TDD approach
- All tests verify new functionality
2025-12-19 10:29:40 +00:00
Mervin Praison ce2c2926f9 refactor: Add BaseAutoGenerator class and improve WorkflowAutoGenerator
- Create BaseAutoGenerator with shared functionality (DRY principle)
  - Lazy-loaded instructor client (LiteLLM or OpenAI fallback)
  - Environment variable handling for model/API configuration
  - analyze_complexity() static method for task complexity detection
  - get_available_tools() static method for tool list
  - AVAILABLE_TOOLS constant shared between generators

- Update AutoGenerator to inherit from BaseAutoGenerator
  - Removes ~40 lines of duplicate code
  - Maintains all existing functionality

- Update WorkflowAutoGenerator to inherit from BaseAutoGenerator
  - Removes ~40 lines of duplicate code
  - Add dynamic agent count based on task complexity
  - Add tools list to workflow prompts
  - Improved prompt with 3-step analysis

- Add 8 new unit tests for new functionality
  - TestBaseAutoGenerator: complexity analysis, tools list
  - TestWorkflowDynamicAgentCount: prompt improvements

All 34 tests pass with no performance impact.
2025-12-19 10:23:29 +00:00
Mervin Praison 0a569e2b46 docs: Add AutoAgents workflow patterns examples and update README
- Add autoagents_workflow_patterns.py with all 6 workflow patterns
- Update auto_agents_example.py with new features and CLI examples
- Add orchestrator-workers and evaluator-optimizer patterns to README CLI section
- Update pattern options table with all 6 patterns
- Add documentation links to examples
2025-12-19 09:54:05 +00:00
Mervin Praison 054aea8f66 Add MCP Registry badge and ignore MCP tokens 2025-12-18 22:18:33 +00:00
Mervin Praison 34f1293cfc Release v2.3.42 2025-12-18 22:13:08 +00:00
Mervin Praison 7c1e32afc0 upate 2025-12-18 22:11:02 +00:00
Mervin Praison 1125c835ec Release v2.3.41 2025-12-18 22:09:58 +00:00
Mervin Praison 889d04a843 Release v2.3.40 2025-12-18 22:07:54 +00:00
Mervin Praison fba811c477 Release v2.3.39 2025-12-18 21:54:19 +00:00
Mervin Praison df687d86c3 Release v2.3.38 2025-12-18 21:26:34 +00:00
Mervin Praison afa37b0782 Release v2.3.37 2025-12-18 17:41:16 +00:00
Mervin Praison 43a15e6049 Release v2.3.36 2025-12-18 16:42:58 +00:00
Mervin Praison 8bf5a08246 Release v2.3.35 2025-12-18 16:28:02 +00:00
Mervin Praison aa81094ac3 Release v2.3.34 2025-12-18 14:55:33 +00:00
Mervin Praison c74fd7e925 Release v2.3.33 2025-12-18 14:41:36 +00:00
Mervin Praison 249acf7965 docs: Add performance benchmarks and auto-update functionality
Add performance comparison table to README showing PraisonAI as fastest framework for agent instantiation. Include benchmarks for LangGraph and CrewAI frameworks. Implement auto-save functionality to generate BENCHMARK_RESULTS.md and update README.md with latest benchmark results.
2025-12-18 13:30:06 +00:00
Mervin Praison ab68b2d296 Release v2.3.32 2025-12-18 13:17:32 +00:00
Mervin Praison abcc5b3b04 Release v2.3.31 2025-12-18 12:57:05 +00:00
Mervin Praison e584f56099 Release v2.3.30 2025-12-18 11:59:22 +00:00
Mervin Praison b6b01af066 Release v2.3.33 2025-12-18 11:19:29 +00:00
Mervin Praison 9aae3eff86 Release v2.3.32 2025-12-18 10:48:09 +00:00
Mervin Praison f90582c66b Release v2.3.31 2025-12-18 10:27:03 +00:00
Mervin Praison 67a8d65d8e Release v2.3.30 2025-12-18 09:07:42 +00:00
Mervin Praison d60c31a86d Release v2.3.29 2025-12-18 02:47:04 +00:00
Mervin Praison fcb7b2a0d0 fix(tests): Mark test_phase2_refactor tests as @pytest.mark.real
These tests make real API calls and should be excluded from CI.
2025-12-17 13:31:01 +00:00
Mervin Praison 81ad7db679 Release v2.3.28 2025-12-17 13:22:14 +00:00
Mervin Praison 0482c3ebb0 chore: Update dependencies and versioning for PraisonAI
- Bump PraisonAI version to 2.3.28 across Dockerfiles and deployment scripts.
- Update praisonaiagents version to 0.1.7 in pyproject.toml.
- Enhance README with a structured Table of Contents and improved section headers for better navigation.
- Remove outdated README.md from praisonai-agents and link to the main README.
2025-12-17 13:20:29 +00:00
Mervin Praison 3107458016 docs: Enhance README with emoji for section headers for better readability 2025-12-17 13:09:58 +00:00
Mervin Praison 44c8ceebae fix: Fix 15 test failures across multiple test files
Test fixes:
1. Import Errors (5 tests):
   - test_llm_self_reflection_direct.py: Define calculator locally
   - test_self_reflection_comprehensive.py: Define duckduckgo_search locally
   - test_self_reflection_fix_simple.py: Define calculator locally
   - test_self_reflection_fix_verification.py: Define calculator locally
   - test_fix_comprehensive.py: Convert to proper pytest with skipif

2. Workflow Assertion (1 test):
   - test_workflow_agents.py: Check error in results array

3. Ollama Type Assertion (1 test):
   - test_ollama_sequential_fix.py: Accept both str and int types

4. Ollama Missing Fixture (3 tests):
   - test_ollama_fix.py: Add proper pytest functions with skipif
   - test_ollama_async_fix.py: Add proper pytest functions with skipif

5. Memory Stale Data (2 tests):
   - test_file_memory.py: Use unique user_id per test

6. Planning Async Mocks (3 tests):
   - test_planning.py: Use get_response_async instead of achat

Results: 921 passed, 9 failed (down from 12), 16 skipped
2025-12-17 13:05:12 +00:00
Mervin Praison 20c0b02528 fix(ci): Fix Docker publish workflow - trigger on release, update actions 2025-12-17 13:00:51 +00:00
Mervin Praison cfc886b591 docs: Update examples to use canonical field names (agents, instructions) 2025-12-17 12:34:32 +00:00
Mervin Praison 77ac4b7a09 fix: Use _yaml_action from YAML parser when executing workflow steps
The action/description field from YAML was being stored on the agent but not
used when executing the workflow. Now the _normalize_single_step method
checks for _yaml_action and uses it as the prompt.

This fixes the issue where workflow steps were not using the action as the prompt.
2025-12-17 12:33:07 +00:00
Mervin Praison 5897cedc45 docs: Update README examples to use canonical field names 2025-12-17 12:29:47 +00:00
Mervin Praison a4d1079813 feat: Add unified field names with A-I-G-S mnemonic
- Add canonical field name suggestions to CLI validate command
- Document A-I-G-S mnemonic (Agents, Instructions, Goal, Steps)
- Add field name reference table to README
- Add comprehensive tests for field name normalization
- Accept both old and new names: roles/agents, backstory/instructions, description/action, topic/name

Implements 'Accept liberally, suggest canonically' principle
2025-12-17 12:24:11 +00:00
Mervin Praison 4eed985c4d Release v2.3.27 2025-12-17 12:17:02 +00:00
Mervin Praison 0658491072 docs: Update README with workflow features and feature parity
- Add YAML workflow file documentation
- Add workflow auto-generation documentation
- Add complete workflow.yaml reference with all features
- Add feature parity note between agents.yaml and workflow.yaml
- Update workflow CLI options table
2025-12-17 11:52:33 +00:00
Mervin Praison 9f82368b4c feat: Add workflow auto-generation (--auto for workflow.yaml)
- Add WorkflowAutoGenerator class in auto.py with lazy loading
- Support sequential, routing, parallel, loop patterns
- Add 'praisonai workflow auto' CLI command
- Add action_auto to WorkflowHandler
- Add _auto_generate_workflow to main.py
- Uses instructor for structured output generation
- Lazy loading ensures no performance impact when not used

Usage:
  praisonai workflow auto "Research AI trends" --pattern parallel
  praisonai workflow auto "Build a chatbot" --pattern routing
2025-12-17 11:50:02 +00:00
Mervin Praison c267cdda87 Release v2.3.26 2025-12-17 11:47:04 +00:00
Mervin Praison b88bb04090 feat: Add feature parity between agents.yaml and workflow.yaml
Workflow.yaml now supports all agents.yaml features:

Agent-level features:
- framework (praisonai, crewai, autogen)
- process (sequential, hierarchical, workflow)
- manager_llm for hierarchical process
- function_calling_llm
- max_rpm (rate limiting)
- max_execution_time (timeout)
- reflect_llm, min_reflect, max_reflect
- system_template, prompt_template, response_template
- backstory (alias for instructions)

Step-level features:
- expected_output (like agents.yaml tasks)
- context (task dependencies)
- output_json, output_pydantic (structured output)
- create_directory
- callback
- async_execution

Added 14 new TDD tests for feature parity verification.
All 41 YAML parser tests pass.
2025-12-17 11:40:38 +00:00
Mervin Praison 709a35fbdc refactor: Remove duplicate code
- Remove duplicate _convert_roles_to_agents from agents_generator.py
  (YAMLWorkflowParser already handles this conversion)
- Refactor _create_workflow_from_template in main.py to use
  WorkflowHandler.TEMPLATES instead of duplicating templates

This reduces code duplication and ensures single source of truth for:
1. Roles-to-agents conversion logic (in yaml_parser.py)
2. Workflow templates (in workflow.py)
2025-12-17 11:16:51 +00:00
Mervin Praison 8b792424b6 feat: Extend agents.yaml with workflow patterns (Option D)
- Add workflow detection in agents_generator.py (process: workflow)
- Route to YAMLWorkflowParser when workflow mode detected
- Support both 'roles' and 'agents' keys for backward compatibility
- Map 'backstory' to 'instructions' automatically
- Add _convert_roles_to_agents method in YAMLWorkflowParser
- Add _run_yaml_workflow method in AgentsGenerator
- Add 7 new tests for roles-to-agents conversion
- Add extended agents.yaml example with all workflow patterns
- Update README with extended agents.yaml documentation

This allows users to use advanced workflow patterns (route, parallel,
loop, repeat) directly in agents.yaml while maintaining full backward
compatibility with existing agents.yaml files.

Usage:
  praisonai agents.yaml  # Works for both standard and workflow mode
2025-12-17 11:11:46 +00:00
Mervin Praison ef2a8cd658 feat(cli): Add YAML workflow CLI commands
- Add WorkflowHandler for 'praisonai workflow' commands
- Add 'praisonai workflow run <file.yaml>' to run YAML workflows
- Add 'praisonai workflow validate <file.yaml>' to validate YAML workflows
- Add 'praisonai workflow template <name>' to create from templates
- Templates: simple, routing, parallel, loop, evaluator-optimizer
- Support --var key=value for passing variables
- Add unit tests for WorkflowHandler (8 tests)
- Update main.py to support YAML workflow execution
2025-12-17 10:52:23 +00:00
Mervin Praison d41d2dcba2 docs: Add YAML workflow loading documentation to README 2025-12-17 10:43:20 +00:00
Mervin Praison 3bc1786b49 feat(workflows): Add YAMLWorkflowParser for YAML-based workflow definitions
- Add YAMLWorkflowParser class to parse YAML workflow files
- Support all workflow patterns: route(), parallel(), loop(), repeat()
- Support agent definitions with planning, reasoning, tools
- Support workflow config: planning, reasoning, memory_config, verbose
- Support variables, callbacks, and guardrails
- Add load_yaml(), execute_yaml(), aexecute_yaml() to WorkflowManager
- Add comprehensive test suite (20 tests)
- Add example YAML workflow files:
  - simple_workflow.yaml
  - routing_workflow.yaml
  - parallel_workflow.yaml
  - loop_workflow.yaml
  - evaluator_optimizer_workflow.yaml
  - complete_workflow.yaml
- Add example_usage.py demonstrating YAML workflow usage
2025-12-17 10:42:44 +00:00
Mervin Praison 2eec3e2359 fix: exclude real tests from all pattern and fix session test assertions
- test_runner.py: Add '-m not real' to exclude tests requiring API keys when running 'all' pattern
- test_cli_features.py: Fix test_session_get_actions to match actual SessionHandler.get_actions() implementation (list, show, resume, delete instead of start)
2025-12-17 08:33:24 +00:00
Mervin Praison 6168401a69 feat(docs): Simplify workflow documentation to focus on agent-first approach
- Replace WorkflowManager examples with Workflow class
- Emphasize Agent objects as workflow steps
- Streamline pattern examples (route, parallel, loop, repeat) with agent-based usage
- Remove complex WorkflowStep configuration examples
- Consolidate workflow features into clearer, more concise examples
- Remove workflow comparison table and memory config examples
- Focus on core workflow patterns with practical agent examples
2025-12-17 08:30:10 +00:00
Mervin Praison 473fda653d Release v2.3.25 2025-12-17 08:17:15 +00:00
Mervin Praison 30f1a440b6 Release v2.3.24 2025-12-17 08:04:24 +00:00
Mervin Praison f991f37cfe Release v2.3.23 2025-12-17 00:41:48 +00:00
Mervin Praison a43b3ac72c Release v2.3.22 2025-12-17 00:25:14 +00:00
Mervin Praison 06f82249e1 Release v2.3.21 2025-12-17 00:05:40 +00:00
Mervin Praison d3aa78241a Release v2.3.20 2025-12-16 23:46:47 +00:00
Mervin Praison dfb77c39f9 Release v2.3.19 2025-12-16 23:26:53 +00:00
Mervin Praison 7e8f9b0574 Release v2.3.18 2025-12-16 23:18:36 +00:00
Mervin Praison 19bcdcd000 Release v2.3.16 2025-12-16 22:59:29 +00:00
Mervin Praison 8f5160f827 feat(workflows): Add branching, loops, callbacks, and per-step variables
- Add branching support with next_steps and branch_condition fields
- Add loop support with loop_over and loop_var for iterating over variables
- Add on_task_start and on_task_complete callbacks to PraisonAIAgents
- Add variables parameter for global variable substitution across tasks
- Add per-step agent creation from agent_config when no agent assigned
- Add task-level variable substitution in task descriptions
- Refactor workflow
2025-12-16 22:58:56 +00:00
Mervin Praison 3574a4d2c0 Release v2.3.15 2025-12-16 22:50:37 +00:00
Mervin Praison b552843fa9 docs: Update README workflow CLI with new features
- Add inline workflow examples (--workflow 'step1,step2')
- Add planning mode example (--planning)
- Add tools and save examples (--tools, --save)
- Update to use global flags instead of workflow-specific flags
2025-12-16 21:46:30 +00:00
Mervin Praison 0461a133df fix(workflow): Actually use planning mode when --planning is enabled
Before: --planning flag was stored but never used, agent.chat() was called
After: --planning flag creates agent with planning=True and calls agent.start()

The agent.start() method checks if planning is enabled and calls
_start_with_planning() which:
1. Creates a plan using PlanningAgent
2. Displays the generated plan
3. Executes each step with context passing
4. Compiles results into final output
2025-12-16 19:12:28 +00:00
Mervin Praison b33857de33 refactor(cli): Use global flags for workflow instead of workflow-specific flags
BREAKING CHANGE: Removed workflow-specific flags in favor of global flags

Before:
  praisonai workflow run 'name' --workflow-tools tavily --workflow-save --workflow-verbose

After:
  praisonai workflow run 'name' --tools tavily --save --verbose

This simplifies the CLI by reusing existing global flags:
- --llm (instead of --workflow-llm)
- --tools (instead of --workflow-tools)
- --planning (instead of --workflow-planning)
- --memory (instead of --workflow-memory)
- --save (instead of --workflow-save)
- --verbose (instead of --workflow-verbose)

Only --workflow-var remains workflow-specific for variable substitution.
2025-12-16 19:09:52 +00:00
Mervin Praison 433c643f6c feat(cli): Add inline workflow support without .md template
Usage: praisonai 'prompt' --workflow 'step1:action1,step2:action2'

Example:
  praisonai 'What is AI?' --workflow 'Research:Research the topic,Summarize:Write a summary' --workflow-save

Features:
- Parse inline workflow steps from --workflow flag
- Sequential execution with context passing
- All workflow options work: --workflow-tools, --workflow-save, etc.
- No .md template file required
2025-12-16 19:05:20 +00:00
Mervin Praison 214119a063 feat(cli): Add complete workflow CLI options
- Add --workflow-llm for LLM model selection
- Add --workflow-tools for tools (comma-separated)
- Add --workflow-planning for planning mode
- Add --workflow-memory for memory support
- Add --workflow-stream for streaming output
- Add --workflow-verbose for verbose output
- Add --workflow-save to save output to file
- Show final output after workflow completion
- Save all step outputs to markdown file
- Update help text with all options
2025-12-16 19:01:57 +00:00
Mervin Praison 989a9f6fc5 Release v2.3.14 2025-12-16 18:50:59 +00:00
Mervin Praison cf276a5640 feat(workflows): Add context passing, per-step agents, async execution
## New Features:
- Context passing between workflow steps with {{previous_output}} and {{step_name_output}}
- Per-step agent configuration with role, goal, backstory, and tools
- Per-step tools support
- Async execution with aexecute() method
- Planning mode at workflow level
- Enhanced markdown parser for agent/tools blocks

## WorkflowStep Enhancements:
- agent_config: Optional[Dict] - Per-step agent configuration
- tools: Optional[List] - Per-step tools
- context_from: Optional[List[str]] - Specific steps to include context from
- retain_full_context: bool - Include all previous outputs vs only last
- output_variable: Optional[str] - Custom variable name for step output

## Workflow Enhancements:
- default_llm: Optional[str] - Default LLM for all steps
- planning: bool - Enable planning mode
- planning_llm: Optional[str] - LLM for planning
- memory_config: Optional[Dict] - Memory configuration

## Execute Method Enhancements:
- default_agent parameter (executor now optional)
- default_llm, memory, planning, stream, verbose parameters

## Tests:
- 74 new tests covering all features
2025-12-16 18:49:43 +00:00
Mervin Praison b5134ffb2f Add --final-agent flag for post-processing output with specialized agent 2025-12-16 16:40:22 +00:00
Mervin Praison 5664036712 Release v2.3.13 2025-12-16 16:33:03 +00:00
Mervin Praison 6c2ca64cbe Remove unused --compile-results flag 2025-12-16 16:32:42 +00:00
Mervin Praison 08c742287c Fix: Pass max_tokens as dict config to Agent 2025-12-16 16:27:29 +00:00
Mervin Praison 4ee32b8eb2 Improve planning mode: compile all step results into comprehensive final report 2025-12-16 16:22:44 +00:00
Mervin Praison 35f07e5653 Add --max-tokens flag and improve planning mode output compilation 2025-12-16 16:22:37 +00:00
Mervin Praison 6481aec376 Add --tools support for all agents including planning mode 2025-12-16 16:14:39 +00:00
Mervin Praison 98c846ef78 Improve: Dynamic tool instructions from docstrings instead of hardcoded search 2025-12-16 16:01:30 +00:00
Mervin Praison 6e4a9faaf8 Fix: Instruct PromptExpanderAgent to use tools for context gathering 2025-12-16 15:59:46 +00:00
Mervin Praison 05d62db355 Reorganize README.md by moving Prompt Expansion, Web Search/Fetch, and MCP sections after CLI Features table, adding comprehensive programmatic usage examples and feature comparison tables for better documentation structure and clarity. 2025-12-16 15:52:36 +00:00
Mervin Praison 375c8c9826 Fix CLI docs links to use /docs/cli/ path 2025-12-16 15:41:42 +00:00
Mervin Praison c6977c8221 Add CLI Features table with docs links 2025-12-16 15:19:29 +00:00
Mervin Praison d407c83cf3 Add comprehensive CLI feature documentation to README.md, including Guardrail, Metrics, Image Processing, Telemetry, MCP, Fast Context, Knowledge, Session, Tools, Handoff, Auto Memory, Todo, Router, Flow Display, and Prompt Expansion with usage examples and command options for each feature. 2025-12-16 15:06:41 +00:00
Mervin Praison 214add68d9 Release v2.3.12 2025-12-16 15:03:23 +00:00
Mervin Praison 6d2cb9676d Update README.md to consolidate and enhance the Supported Providers section, adding new AI providers and their corresponding example links for improved documentation and user guidance. 2025-12-16 11:54:00 +00:00
Mervin Praison c519cb1379 Add supported providers section to README.md, listing various AI providers with example links for each, enhancing documentation and usability. 2025-12-16 11:52:19 +00:00
Mervin Praison 356dc4909a Update README.md to refine feature table, enhancing clarity by renaming 'Automated AI Agents Creation' to 'Single Agent' and reorganizing agent types for better categorization. 2025-12-16 11:25:42 +00:00
Mervin Praison dc278ad07b Enhance README.md with new agent types and advanced features, including Image Generation, Data Analyst, and Finance Agents, along with updates to existing feature descriptions and examples. 2025-12-16 11:22:23 +00:00
Mervin Praison 5cc53eb4bb Add advanced features section to README.md, detailing new capabilities including Deep Research Agents, Query Rewriter Agent, and various MCP enhancements. 2025-12-16 11:13:38 +00:00
Mervin Praison b72576d086 Refactor feature table in README.md for improved clarity and consistency, updating formatting and links for AI agent capabilities. 2025-12-16 11:11:04 +00:00
Mervin Praison 30314b1573 Update README.md to include detailed feature table with example code and documentation links for each AI agent capability. 2025-12-16 11:05:51 +00:00
Mervin Praison f721bd5e9a Add Fast Context feature to README highlights 2025-12-16 10:52:37 +00:00
Mervin Praison d00ea3e3c3 Release v2.3.11 2025-12-16 10:45:36 +00:00
Mervin Praison 67dbd1007a Release v2.3.10 2025-12-16 09:54:57 +00:00
Mervin Praison cf2a5a135f workflow 2025-12-16 09:23:49 +00:00
Mervin Praison bc23d3a104 Release v2.3.9 2025-12-16 08:18:09 +00:00
Mervin Praison bb4e1d8b9e Release v2.3.8 2025-12-16 07:55:55 +00:00
Mervin Praison 69740baa7c Release v2.3.7 2025-12-16 07:46:40 +00:00
Mervin Praison 5035978a29 fix: resolve Mintlify parsing errors
- Fix corrupted/duplicated database service in docker-compose.dev.yml
- Fix MDX parsing error in tests/README.md (<1s -> under 1s)
2025-12-15 23:11:04 +00:00
Mervin Praison 4ddb043324 Release v2.3.7 2025-12-15 22:49:12 +00:00
Mervin Praison 337014f4db planning example 2025-12-15 22:25:09 +00:00
Mervin Praison 35c371b25e update 2025-12-15 22:22:42 +00:00
Mervin Praison bba75d9fdd Release v2.3.6 2025-12-15 22:16:57 +00:00
Mervin Praison bf8cd488da feat: add planning tools and reasoning mode for research-enabled plan creation
- Add planning_tools and planning_reasoning parameters to PraisonAIAgents
- Add RESEARCH_TOOLS list for safe planning research tools (web_search, read_file, etc.)
- Add tools, reasoning, and max_reasoning_steps parameters to PlanningAgent
- Add _get_agent() method to PlanningAgent for tool-enabled planning with Agent.chat()
- Update plan creation to use Agent with tools when available, fallback to bare LLM
- Add Planning
2025-12-15 22:07:59 +00:00
Mervin Praison 28905db46d g 2025-12-15 21:27:32 +00:00
Mervin Praison 3e7aa44dfa docs: simplify feature descriptions by removing tool comparisons
- Remove references to Cursor, Windsurf, Claude Code, Gemini CLI, Codex CLI, and Cascade from feature descriptions
- Keep feature descriptions focused on PraisonAI's own capabilities
- Update Planning Mode, Agent Memory, Rules & Instructions, Auto-Generated Memories, Workflows, and Hooks sections
2025-12-15 21:26:04 +00:00
Mervin Praison 2f7a65ab92 update 2025-12-15 21:25:41 +00:00
Mervin Praison e6e2379b02 update 2025-12-15 21:25:29 +00:00
Mervin Praison f31f9a04aa update 2025-12-15 21:23:46 +00:00
Mervin Praison 5a8adf295e Release v2.3.5 2025-12-15 21:04:45 +00:00
Mervin Praison 8dc243fd4f feat: Add Planning Mode - plan before execution like Cursor, Windsurf, Claude Code
- Add planning module with PlanningAgent, Plan, PlanStep, TodoList, TodoItem
- Add PlanStorage for persisting plans to .praison/plans/
- Add ApprovalCallback for plan approval flow
- Add plan_mode to Agent for read-only tool filtering
- Add planning, planning_llm, auto_approve_plan params to PraisonAIAgents
- Add 71 comprehensive tests for planning mode
- Update READMEs with Planning Mode documentation
- Bump version to 0.0.181
2025-12-15 17:51:08 +00:00
Mervin Praison 548b4afb88 Release v2.3.4 2025-12-15 16:39:58 +00:00
Mervin Praison ffa938b3df docs: add advanced rules features and new memory capabilities
- Add local override files support (PRAISON.local.md, CLAUDE.local.md) with higher priority
- Add @import syntax for including other files in rules (like Claude Code)
- Add git root discovery for monorepo support with fallback to subprocess
- Add auto-discovery of modular rules directories (.claude/rules/, .windsurf/rules/, .cursor/rules/)
- Add character limits (12000) for context window management with truncation
- Add AutoMemory for
2025-12-15 16:39:04 +00:00
Mervin Praison 8a9beed264 docs: add advanced memory features and rules management system
- Add session save/resume, context compression, and checkpointing (inspired by Gemini CLI)
- Add RulesManager for auto-discovery of instruction files (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules, .windsurfrules)
- Add slash commands for memory management (/memory show, /memory save, /memory compress, etc.)
- Add rules context injection into agent system prompts with activation modes (always, glob, manual, ai_decision)
- Add program
2025-12-15 16:17:25 +00:00
Mervin Praison daca5a1762 test: add multi-agent memory sharing and integration tests
- Add TestMultiAgentMemorySharing class with tests for shared/isolated memory between agents
- Test agents with same user_id share memory (short_term, long_term, entities)
- Test agents with different user_id have isolated memory
- Test memory context injection into system prompt
- Test memory display info shows correct counts
- Add TestMultiAgentMemoryIntegration class for LLM integration tests
- Test multi-agent memory sharing with OpenA
2025-12-15 15:00:16 +00:00
Mervin Praison b183ac5cbd Release v2.3.3 2025-12-15 14:55:30 +00:00
Mervin Praison 5f57e1d2f1 feat: add memory info display and improve memory integration with system prompts
- Add _display_memory_info() method to show memory stats in rich panel (long-term, short-term, entities, storage path)
- Disable system prompt caching when memory is enabled (dynamic context)
- Inject memory context into system prompt with "## Memory" section
- Display memory info on first chat when verbose=True
- Add integration tests for memory with OpenAI API (injection and persistence)
- Update README with zero
2025-12-15 14:52:09 +00:00
Mervin Praison 5114165944 feat: add zero-dependency file-based memory system for all agents
- Add FileMemory class with JSON-based persistent storage (no extra dependencies)
- Add _init_memory(), get_memory_context(), store_memory() methods to Agent class
- Support memory types: short_term, long_term, entity, episodic
- Add memory=True/False/"file"/"sqlite"/"chromadb"/"mem0" configuration options
- Add lazy import for Memory class to avoid dependency issues
- Update README with memory usage examples and provider comparison
2025-12-15 14:37:33 +00:00
Mervin Praison 389442ea04 feat: add Claude Memory Tool support for persistent cross-conversation memory
- Add claude_memory parameter to Agent and LLM classes
- Add ClaudeMemoryTool with file-based persistent memory in .praison/claude_memory/
- Add _supports_claude_memory(), _is_memory_tool_call(), _execute_memory_tool_call() methods
- Add automatic beta header injection for Anthropic models
- Add memory tool definition to completion params when enabled
- Add ClaudeMemoryTool to TOOL_MAPPINGS with class-level import
- Update
2025-12-15 13:48:35 +00:00
Mervin Praison 6d7cc9c3ba Release v2.3.2 2025-12-15 13:34:15 +00:00
Mervin Praison 690e4497cc feat: add --save support for direct prompts
- Save output to output/prompts/ folder with timestamped filename
- Works with all flags: --web-search, --expand-prompt, etc.

Usage:
  praisonai 'latest AI trends' --web-search --save
  praisonai 'write a poem' --expand-prompt --save
2025-12-15 13:33:28 +00:00
Mervin Praison 041f5f0b08 fix: add current date to PromptExpanderAgent for time-sensitive context
- Add datetime import and current_date to all expansion prompts
- Ensures expanded prompts reference the correct current date (e.g., December 15, 2025)
- Fixes issue where prompts defaulted to outdated year references
2025-12-15 13:26:13 +00:00
Mervin Praison bc0d9a6213 feat: add CLI flags for web-search, web-fetch, and prompt-caching
- Add --web-search flag for native web search (OpenAI, Gemini, Anthropic, xAI, Perplexity)
- Add --web-fetch flag for URL content retrieval (Anthropic only)
- Add --prompt-caching flag to reduce costs (OpenAI, Anthropic, Bedrock, Deepseek)
- Update README with CLI and programmatic usage examples

Usage:
  praisonai 'latest AI news' --web-search --llm openai/gpt-4o-search-preview
  praisonai 'summarize https://example.com' --web-fetch --llm anthropic/claude-sonnet-4-20250514
  praisonai 'analyze...' --prompt-caching --llm anthropic/claude-sonnet-4-20250514
2025-12-15 12:56:02 +00:00
Mervin Praison a4427fa135 Release v2.3.1 2025-12-15 12:45:22 +00:00
Mervin Praison 51e8c65c8c feat: refactor model capabilities to use LiteLLM helper functions
- Replace static model lists with LiteLLM's built-in capability checks (supports_response_schema, supports_function_calling, supports_parallel_function_calling, supports_web_search)
- Add supports_function_calling() and supports_parallel_function_calling() functions
- Keep static list for web_fetch (no LiteLLM helper available yet)
- Update documentation to reference LiteLLM as primary source
- Add Web Fetch feature to README features
2025-12-15 12:32:09 +00:00
Mervin Praison 285ed672c5 feat: add native web search and web fetch documentation to README
- Add Native Web Search section with supported providers (OpenAI, Anthropic, Gemini, xAI, Perplexity)
- Add Web Fetch section for Anthropic models with configuration options
- Add code examples for web_search and web_fetch parameters
- Document web_fetch options (max_uses, allowed_domains, citations)
2025-12-15 12:20:41 +00:00
Mervin Praison c03e51e337 feat: add native web fetch support for Anthropic Claude models
- Add web_fetch parameter to Agent and LLM classes
- Add model_capabilities.py with MODELS_SUPPORTING_WEB_FETCH list (Claude 3.5+, 4+)
- Add supports_web_fetch() function to check model capabilities
- Add web_fetch tool definition with configurable options (max_uses, allowed_domains, blocked_domains, citations, max_content_tokens)
- Add _model_supports_web_fetch() method to Agent class
- Add warning log for unsupported models when web_
2025-12-15 12:18:08 +00:00
Mervin Praison f3ba05f6aa feat: expand structured outputs support for OpenAI, Anthropic, and Gemini models
- Add comprehensive list of OpenAI models with structured outputs (gpt-4o-2024-08-06+, gpt-4.1+, gpt-5+, o-series)
- Add Anthropic Claude 4+ models with structured outputs support (Sonnet 4.5, Opus 4.1/4.5, Haiku 4.5)
- Add all Google Gemini models (2.5-pro, 2.5-flash, 2.0-flash, 1.5-pro/flash)
- Add auto-detection for newer model versions (gpt-4.1+, gpt-5+, o-series, Claude 4+, all Gemini)
- Add azure/ prefix support
2025-12-15 12:07:46 +00:00
Mervin Praison 9cea3edcd6 feat: add native web search support for OpenAI, Gemini, Anthropic, xAI, and Perplexity models
- Add web_search parameter to Agent and LLM classes
- Add model_capabilities.py with MODELS_SUPPORTING_WEB_SEARCH list
- Add supports_web_search() function to check model capabilities
- Add automatic DuckDuckGo fallback for unsupported models
- Add web_search_options to LiteLLM completion params
- Remove incompatible parameters (temperature, top_p, etc.) for web search models
- Update README with Native
2025-12-15 11:59:19 +00:00
Mervin Praison 02a3bd3597 chore: add uv cache clean before uv lock in release.py 2025-12-15 11:26:08 +00:00
Mervin Praison 128c77926d chore: add uv cache clean before uv lock in bump_and_release.py 2025-12-15 11:25:42 +00:00
Mervin Praison 3aa1b825e4 Release v2.3.0 2025-12-15 11:24:46 +00:00
Mervin Praison b4ee30d837 chore: bump praisonaiagents version to 0.0.170 2025-12-15 11:11:46 +00:00
Mervin Praison 825648aead docs: add PromptExpanderAgent to README 2025-12-15 11:11:04 +00:00
Mervin Praison 1532c31e72 feat: add PromptExpanderAgent for detailed prompt expansion
- Add PromptExpanderAgent class with expansion strategies (BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO)
- Add ExpandStrategy enum and ExpandResult dataclass
- Add CLI flags --expand-prompt and --expand-tools
- Add 20 unit tests for PromptExpanderAgent
- Export from praisonaiagents package

Usage:
  praisonai 'write a movie script' --expand-prompt
  praisonai 'AI blog' --expand-prompt --expand-tools tools.py
2025-12-15 11:09:25 +00:00
Mervin Praison b313fefd86 fix: QueryRewriterAgent preserves task intent instead of converting to questions 2025-12-15 10:57:53 +00:00
Mervin Praison 435e1afb55 test: add OPENAI_API_KEY environment variable to comprehensive test workflow and verify its presence 2025-12-15 10:47:29 +00:00
Mervin Praison 4cb3c0565a test: add skipif decorator for OPENAI_API_KEY check in CrewAI environment test 2025-12-15 10:42:00 +00:00
Mervin Praison a7634b66dc Release v2.2.99 2025-12-15 10:36:34 +00:00
Mervin Praison 3f0eaccbcb Release v2.2.98 2025-12-15 10:28:42 +00:00
Mervin Praison 47713d933a test: convert test assertions to pytest format and add TaskOutput descriptions
- Replace return True/False with pytest assertions in test_context_agent.py
- Add pytest.mark.skip decorators for unimplemented ContextAgent methods
- Add missing description parameter to TaskOutput instances in test_validation_feedback.py
2025-12-15 10:25:23 +00:00
Mervin Praison c82bfccd1d docs: add custom tools documentation with decorator, BaseTool class, and pip installable package examples 2025-12-15 10:20:11 +00:00
Mervin Praison ef7d1264e2 feat: add plugin system with tool registry and BaseTool support for external tool packages 2025-12-15 10:10:06 +00:00
Mervin Praison 2799304270 Release v2.2.97 2025-12-15 08:25:56 +00:00
Mervin Praison 4a85c135a6 Release v2.2.96 2025-12-15 07:57:25 +00:00
Mervin Praison cdb42a3f08 feat: add custom tools support to research command with file and built-in tool loading 2025-12-15 07:33:52 +00:00
Mervin Praison c8378118e7 docs: add query rewrite flag to research command and bump version to 2.2.94 2025-12-13 12:49:38 +00:00
Mervin Praison 0213764057 feat: add Query Rewriter Agent with multiple rewrite strategies and bump version to 0.0.166 2025-12-13 12:44:21 +00:00
Mervin Praison 2220114809 feat: add --save flag to research command for markdown output and bump version to 2.2.93 2025-12-13 11:58:36 +00:00
Mervin Praison 9fe4dbc172 chore: bump version to 2.2.92 and update praisonaiagents dependency to 0.0.165 2025-12-13 02:19:22 +00:00
Mervin Praison 180503fcd5 feat: add default research instructions to DeepResearchAgent and bump version to 0.0.165 2025-12-13 02:18:42 +00:00
Mervin Praison 0d8f936b19 chore: bump version to 2.2.91 and update praisonaiagents dependency to 0.0.164 2025-12-13 02:09:12 +00:00
Mervin Praison 8b53ebf5e3 docs: add Deep Research CLI documentation and bump version to 2.2.90 2025-12-13 01:44:52 +00:00
Mervin Praison 504c5a9759 chore: bump version to 2.2.89 and update praisonaiagents dependency to 0.0.163 2025-12-13 01:17:52 +00:00
Mervin Praison 8fef42fc03 feat: add Deep Research Agent support with OpenAI and Gemini integration 2025-12-13 01:15:07 +00:00
Mervin Praison 2f18cc1ea2 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-12-13 01:13:29 +00:00
Mervin Praison ff7969cdbf docs: rewrite README from MCP SSE implementation to comprehensive PraisonAI Agents documentation 2025-12-13 01:13:28 +00:00
Mervin Praison 5fa84dc3eb Merge pull request #1084 from Dhivya-Bharathy/feature/agentic-rag
feat: Add Agentic RAG Example to Cookbooks
2025-11-03 14:14:46 +00:00
Mervin Praison 4bf8b980ed Merge pull request #1085 from Dhivya-Bharathy/feat/agentic-rag-tools
feat: Add Agentic RAG Tools Implementation
2025-11-03 14:14:24 +00:00
Mervin Praison 53e0fd19ab feat: add async run support and example scripts for multi-turn conversations 2025-08-30 11:54:59 +01:00
Dhivya-Bharathy 0cb6307d3c Add agentic_rag_gpt5 example with GPT-5 integration 2025-08-29 13:11:08 +05:30
Dhivya adce94410b Add files via upload 2025-08-29 13:01:08 +05:30
Dhivya-Bharathy 42aec561b1 Add agentic RAG Python implementation to tools 2025-08-28 14:09:09 +05:30
Dhivya acc805768d Update PraisonAI_RecipeAgent.ipynb 2025-08-28 13:00:50 +05:30
Dhivya-Bharathy 6d9fa167e3 Add agentic_rag example to cookbooks 2025-08-28 06:43:41 +00:00
Mervin Praison 9e178b70e6 chore: bump PraisonAI to v2.2.88 and update dependencies across Dockerfiles and project files 2025-08-08 19:24:43 +01:00
Mervin Praison ed406973cd refactor: optimise ChatOpenAI instantiation by using a dictionary for parameters and enforce temperature for gpt-5 models 2025-08-08 19:17:45 +01:00
Mervin Praison f91918f4f6 chore: bump PraisonAI to v2.2.87, PraisonAI Agents to v0.0.161 and increase default temperature to 1.0 2025-08-08 13:44:29 +01:00
Mervin Praison ee21df9a6a chore: bump praisonai to v2.2.86 and praisonaiagents to v0.0.160 2025-08-08 12:18:30 +01:00
Mervin Praison c9159337fa refactor: replace all instances of gpt-5-mini with gpt-5-nano across codebase 2025-08-08 12:17:18 +01:00
Mervin Praison 2258685c32 chore: bump PraisonAI to v2.2.85 and PraisonAI Agents to v0.0.159 2025-08-08 08:20:25 +01:00
Mervin Praison 7210788135 refactor: replace gpt-4o model references with gpt-5-mini across codebase 2025-08-08 08:17:23 +01:00
Mervin Praison 3f58e3b1ad chore: bump PraisonAI to v2.2.84 and PraisonAI Agents to v0.0.158 across all files 2025-08-08 07:54:22 +01:00
Mervin Praison 561c32ddd5 refactor: update model name from gpt-4o-mini to gpt-5-nano across all files 2025-08-08 07:52:37 +01:00
Mervin Praison 79d934eec4 feat: bump praisonai to 2.2.83 and add xml-toolcall-agent implementation 2025-08-05 07:44:47 +01:00
Mervin Praison 144c7edc4a Merge pull request #1079 from MervinPraison/claude/issue-1077-20250805-0109
feat: make XML tool call parsing dynamic and configurable
2025-08-05 02:31:08 +01:00
Mervin Praison 4425e2b743 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-08-05 02:28:00 +01:00
Mervin Praison eb8dfc02cd feat: optimize OpenAIClient with lazy loading and tool caching 2025-08-05 02:27:59 +01:00
github-actions[bot]andMervin Praison 27b6193b90 fix: improve XML tool call parsing robustness and type handling
- Fix type inconsistency in xml_tool_format handling (now supports True/''true''/''True'')
- Simplify _is_qwen_provider() by removing redundant logic
- Add proper XML parsing with ElementTree as primary method
- Improve regex fallback pattern for nested JSON in XML tags
- Add graceful error handling for malformed XML
- Import xml.etree.ElementTree at module level for better performance

Co-authored-by: Mervin Praison <[email protected]>
2025-08-05 01:26:48 +00:00
github-actions[bot]andMervin Praison b0aa9dfe58 feat: make XML tool call parsing dynamic and configurable
- Add xml_tool_format configuration parameter (auto/true/false)
- Replace static Qwen detection with dynamic _supports_xml_tool_format() method
- Add fallback XML detection for any model outputting <tool_call> tags
- Maintain backward compatibility with existing Qwen auto-detection
- Support manual XML format enabling for any model

Fixes #1077

Co-authored-by: Mervin Praison <[email protected]>
2025-08-05 01:13:22 +00:00
Mervin Praison 89d4f52327 Merge pull request #1075 from MervinPraison/claude/issue-1074-20250731-1148
fix: Fix RAG integration tests to respect lazy loading pattern
2025-07-31 13:05:47 +01:00
github-actions[bot]andMervin Praison da545f2e49 fix: Fix RAG integration tests to respect lazy loading pattern
- Fixed test_agent_with_knowledge_config and test_ollama_rag_integration
- Tests now properly check for lazy loading behavior instead of expecting immediate knowledge availability
- Verifies knowledge sources are stored and manually triggers processing before checking knowledge availability
- Preserves performance optimization of lazy loading while ensuring correct test behavior
- All RAG integration tests now pass (11/11)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-31 11:53:01 +00:00
Mervin Praison e794992d7b feat: optimize LLM performance with caching and lazy loading 2025-07-31 12:39:37 +01:00
Mervin Praison a958162704 perf: optimize agent performance with lazy loading and caching strategies 2025-07-31 12:19:17 +01:00
Mervin Praison 3b47f7be7f chore: update MongoDB connection strings from localhost to remote cluster 2025-07-31 07:59:51 +01:00
Mervin Praison 0b8da8b4c4 Merge pull request #1072 from MervinPraison/claude/issue-1071-20250729-0039
fix: resolve MongoDB SearchIndexModel missing definition argument
2025-07-29 08:07:23 +01:00
github-actions[bot]andMervinPraison 092ea67732 fix: apply SearchIndexModel compatibility fix to memory.py and mongodb_tools.py
Extends the PyMongo 4.6+ compatibility fix from knowledge.py to other files
that also use create_search_index(). Applies the same backward-compatible
pattern using SearchIndexModel with graceful fallback for older PyMongo versions.

- memory.py: Fix _create_vector_search_indexes() method
- mongodb_tools.py: Fix create_vector_index() method

Maintains zero performance overhead and full backward compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2025-07-29 00:54:57 +00:00
github-actions[bot]andMervin Praison 5931ad00be fix: resolve MongoDB SearchIndexModel missing definition argument
- Import SearchIndexModel from pymongo.operations for PyMongo 4.6+ compatibility
- Use SearchIndexModel with definition parameter in _create_vector_index()
- Add backward compatibility fallback for older PyMongo versions
- Maintains zero performance overhead and preserves existing functionality

Fixes #1071

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-29 00:44:36 +00:00
Mervin Praison b7676cf6c3 update github actions 2025-07-29 01:38:33 +01:00
Mervin Praison 8ec4f5efa2 Merge pull request #1070 from MervinPraison/claude/issue-1069-20250728-2326
fix: resolve MongoDB vector search index creation error (missing embedding_model_name)
2025-07-29 01:33:58 +01:00
github-actions[bot]andMervin Praison f459c192d6 fix: initialize embedding model before MongoDB to resolve missing embedding_model_name attribute
Fixed initialization order in MongoDBMemory class where _create_vector_index()
was trying to access self.embedding_model_name before it was initialized.

- Moved _init_embedding_model() before _init_mongodb() in __init__
- Added explanatory comment for the dependency order
- Resolves AttributeError: ''MongoDBMemory'' object has no attribute ''embedding_model_name''
- Maintains full backward compatibility

Fixes #1069

Co-authored-by: Mervin Praison <[email protected]>
2025-07-28 23:31:01 +00:00
Mervin Praison 18b85aada0 chore: bump package versions and reorganize test files 2025-07-28 18:43:53 +01:00
Mervin Praison a3c77692fd Merge pull request #1068 from MervinPraison/claude/aiohttp-session-fix-v2
fix: comprehensive aiohttp session cleanup to resolve persistent warnings
2025-07-28 18:31:47 +01:00
github-actions[bot]andMervin Praison 4a06ee3626 perf: eliminate blocking timeout in close() method to restore zero-overhead cleanup
- Remove blocking future.result(timeout=2.0) that could block execution
- Restore non-blocking behavior with callback-based fallback cleanup
- Maintain reliability with async cleanup + force cleanup fallback
- Ensure zero performance impact on normal execution paths

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 20:05:52 +00:00
Mervin Praison 776e83100e Merge pull request #1067 from MervinPraison/claude/fix-token-tracking-metrics-20250726
fix: enable token tracking by passing metrics parameter from Agent to LLM
2025-07-26 21:00:43 +01:00
github-actions[bot]andMervin Praison f718d89ba4 test: add verification test for performance optimization
- Confirms zero method calls when metrics=False
- Verifies method still called when metrics=True
- Demonstrates performance benefit of optimization

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:40:17 +00:00
github-actions[bot]andMervin Praison 3469335d02 perf: optimize token tracking to eliminate overhead when metrics disabled
- Move metrics check to call sites instead of inside _track_token_usage()
- Eliminates function call overhead when metrics=False (default)
- Add performance test to verify zero overhead implementation
- Maintains full functionality when metrics=True

Performance impact:
- metrics=False (default): zero function call overhead
- metrics=True: unchanged functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:39:46 +00:00
Mervin Praison 929a6e733d chore: bump praisonai to v2.2.79 and praisonaiagents to v0.0.153 across all files 2025-07-26 20:38:11 +01:00
github-actions[bot]andMervin Praison 6caa825706 fix: comprehensive aiohttp session cleanup in MCP HTTP client
- Add global client registry with weakref tracking for reliable cleanup
- Implement multi-layer cleanup strategy: immediate, force, finalizer, and exit
- Add atexit handler to ensure session cleanup on program termination
- Implement direct connector closing for emergency cleanup scenarios
- Maintain zero performance impact with non-blocking operations
- Fix persistent ''Unclosed client session'' warnings in praisonaiagents

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:38:03 +00:00
Mervin Praison 4baf6288ed Merge pull request #1066 from MervinPraison/claude/issue-1065-20250726-1904
fix: properly close aiohttp sessions in MCP HTTP stream transport
2025-07-26 20:33:27 +01:00
github-actions[bot]andMervin Praison 65a23df7a2 fix: enable token tracking by passing metrics parameter from Agent to LLM
Fixes the persistent issue where Agent(metrics=True) showed 0 tokens
despite the LLM instance access fix in PR #1064.

Root Cause:
- Agent.metrics=True was stored but never passed to LLM constructor
- LLM class had token tracking capability but no way to enable it
- Token collector received no data because LLM didn''t track tokens

Solution:
- Pass metrics=self.metrics to all 4 LLM constructor calls in agent.py
- Add self.metrics property to LLM class from extra_settings
- Only track tokens when self.metrics=True in _track_token_usage()

Verified:
- All LLM creation patterns (string, dict, provider/model) work
- Agent(metrics=True) properly enables LLM token tracking
- Zero performance impact when metrics=False (default)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:25:50 +00:00
github-actions[bot]andMervin Praison ea0cb8b59a perf: optimize aiohttp session cleanup to eliminate execution overhead
- Remove flawed weakref finalizer that couldn''t run async code properly
- Make synchronous close() non-blocking to prevent 5-second delays
- Simplify __del__ methods to reduce garbage collection overhead
- Focus cleanup on proper async context manager usage
- Maintain backward compatibility while eliminating performance impact

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:23:09 +00:00
Mervin Praison d0d2e60618 feat: add API key validation and improved error handling for Tavily search integration 2025-07-26 20:21:34 +01:00
Mervin Praison 8eca3359cf Merge pull request #1064 from MervinPraison/claude/pr-1063-20250726-1818
fix: resolve zero token metrics by fixing agent LLM instance access
2025-07-26 20:17:56 +01:00
github-actions[bot]andMervin Praison 41272ddd24 fix: properly close aiohttp sessions in MCP HTTP stream transport
- Add weakref.finalize for reliable session cleanup during garbage collection
- Add explicit close() and aclose() methods for manual resource cleanup
- Add __del__ methods with proper error handling for both HTTPStreamTransport and HTTPStreamMCPClient
- Add double-close protection to prevent cleanup errors
- Preserve backward compatibility - no API changes, only additions

Fixes #1065

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:11:35 +00:00
Mervin Praison 47d8e54fa5 feat: add token tracking and langtrace integration modules with demo scripts 2025-07-26 20:09:18 +01:00
github-actions[bot]andMervin Praison 0d42787a86 perf: eliminate redundant getattr calls in token metrics collection
- Remove duplicate llm variable definitions in aexecute_task and execute_task
- Reuse existing llm variable instead of redefining with getattr calls
- Reduces function call overhead without changing functionality
- Addresses code duplication identified in PR review

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:08:58 +00:00
Mervin Praison 99a4b84e6a Merge pull request #1062 from MervinPraison/claude/issue-1059-20250726-1321
perf: optimize telemetry performance with thread pools and queue-based processing
2025-07-26 19:57:49 +01:00
github-actions[bot]andMervin Praison 1b70e295b4 feat: enable PostHog telemetry by default with actual event posting
- Change default behavior from performance_mode=True to performance_mode=False
- PostHog events are now actually posted by default instead of zero overhead mode
- Add PRAISONAI_PERFORMANCE_MODE=true environment variable for minimal overhead
- Create comprehensive PERFORMANCE_IMPACT.md documentation
- Performance impact: ~0.5-1.5ms per operation with async, non-blocking PostHog calls
- Memory overhead: +756KB one-time PostHog client initialization
- Maintains full backward compatibility with existing disable options

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 18:46:25 +00:00
github-actions[bot]andMervin Praison abc8d63b75 feat: enable PostHog telemetry by default with minimal performance impact
- Enable PostHog by default using performance_mode=True for zero overhead
- Add granular environment variable controls:
  - PRAISONAI_DISABLE_TELEMETRY=true (disable completely)
  - PRAISONAI_FULL_TELEMETRY=true (enable detailed tracking)
  - DO_NOT_TRACK=true (respects privacy standard)
- Maintain backward compatibility with existing disable flags
- Performance impact: <0.05ms overhead in default mode
- Preserves existing PRAISONAI_AUTO_INSTRUMENT behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 18:29:22 +00:00
github-actions[bot]andMervin Praison 10e58e033a fix: resolve zero token metrics by fixing agent LLM instance access
- Fixed 4 locations in agents.py where token tracking failed due to incorrect attribute access
- Use getattr pattern to check both ''llm'' and ''llm_instance'' attributes on agents
- Ensures proper agent name attribution for token tracking
- Zero performance impact - maintains existing execution flow
- Fixes issue where agents.run() with metrics=True showed 0 tokens

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 18:28:30 +00:00
Mervin Praison e36feed53e Merge pull request #1061 from MervinPraison/claude/performance-monitoring-disabled-by-default-20250726-1324
feat: make performance monitoring disabled by default
2025-07-26 15:22:42 +01:00
github-actions[bot]andMervin Praison f01b3f4251 optimize: achieve true zero overhead when performance monitoring is disabled
Key optimizations implemented:
- Extract environment checking into shared cached function
- Make PostHog imports lazy to eliminate import overhead
- Optimize constructors for immediate exit when disabled
- Reduce code duplication from 4x to single implementation
- Add caching for environment variable checks

Performance improvements:
- Zero PostHog import overhead when disabled
- ~50% reduction in constructor overhead via fast-path
- Eliminates repeated environment variable lookups
- Reduces memory footprint when monitoring disabled

All telemetry modules now achieve true zero overhead when
performance monitoring is disabled by default.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:21:56 +00:00
github-actions[bot]andMervin Praison e2ca69327c fix: critical performance issues - ensure zero overhead for existing users
### Critical Fixes Applied:

1. **Remove Auto-Instrumentation Overhead** (__init__.py)
   - Auto-instrumentation now opt-in only via PRAISONAI_AUTO_INSTRUMENT=true
   - Prevents telemetry overhead being added to ALL existing users by default
   - Ensures zero performance impact for existing code paths

2. **Fix NameError Bug** (integration.py:22)
   - Move _performance_mode_enabled definition before function definitions
   - Fixes enable_performance_mode() and disable_performance_mode() functions
   - Resolves critical runtime error identified by Cursor bot

3. **Enhanced Error Handling** (integration.py:82-86, 123-127)
   - Replace silent exception handling with structured logging
   - Use logging.debug() for non-disruptive debugging support
   - Maintains application stability while enabling troubleshooting

4. **Implement Performance Context Manager** (integration.py:129-142)
   - Complete previously incomplete _performance_mode_context() function
   - Provides temporary performance mode switching capability
   - Removes dead code identified in review

5. **Configurable Resource Cleanup** (integration.py:600-610)
   - Make shutdown timeout configurable via PRAISONAI_TELEMETRY_SHUTDOWN_TIMEOUT
   - Enhanced error logging for resource cleanup issues
   - Improves reliability across different deployment environments

### Performance Guarantee:
✅ Zero overhead for existing users (no auto-instrumentation)
✅ Telemetry is now truly opt-in only
✅ All existing APIs work identically
✅ No breaking changes to function signatures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:20:17 +00:00
Mervin Praison cc8994f19c Merge pull request #1063 from MervinPraison/claude/issue-1060-20250726-1321
fix: add run() method alias to PraisonAIAgents for consistent API
2025-07-26 15:18:43 +01:00
github-actions[bot]andMervin Praison 89277d14c4 clean: remove test files from repository
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:17:29 +00:00
github-actions[bot]andMervin Praison 9513173837 fix: remove redundant run() alias to prevent code duplication
- Remove line 1535 that created redundant run = start alias
- Keep proper run() method implementation with correct parameter handling
- Maintain full backward compatibility
- Zero performance overhead

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:17:18 +00:00
Mervin Praison 5b83af82db Merge branch 'main' into claude/issue-1059-20250726-1321 2025-07-26 15:12:51 +01:00
github-actions[bot]andMervin Praison 0539c337ab perf: optimize telemetry performance with thread pools and queue-based processing
- Replace per-call thread creation with shared ThreadPoolExecutor (2 workers)
- Implement queue-based batch processing for telemetry events
- Add performance_mode parameter for zero-overhead operation in critical scenarios
- Add non-blocking event queuing with overflow protection (drops events vs blocking)
- Use async PostHog mode by default in batch processing
- Add resource cleanup functions for proper shutdown
- Maintain 100% backward compatibility with existing APIs

Performance benefits:
- ~90% reduction in thread creation overhead under load
- Eliminates blocking on network calls during normal operation
- Memory-bounded telemetry storage prevents resource leaks
- Graceful degradation under high load
- Zero impact when performance_mode=True

Fixes #1059

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:29:41 +00:00
github-actions[bot]andMervin Praison c6977cf541 feat: make performance monitoring disabled by default
- NEW BEHAVIOR: Performance monitoring now DISABLED BY DEFAULT
- Requires explicit opt-in via PRAISONAI_PERFORMANCE_ENABLED=true
- Maintains backward compatibility with legacy disable flags
- Zero performance overhead when disabled (unchanged)

Environment Variables:
- PRAISONAI_PERFORMANCE_ENABLED=true (new: enables monitoring)
- PRAISONAI_TELEMETRY_ENABLED=true (new: enables telemetry)
- Legacy disable flags still work for backward compatibility

Files updated:
- telemetry.py: Modified _is_monitoring_disabled() logic
- performance_monitor.py: Updated fallback logic
- performance_utils.py: Updated fallback logic
- integration.py: Updated fallback logic
- README.md: Updated documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:27:33 +00:00
github-actions[bot]andMervin Praison b0e9eec33b fix: add run() method alias to PraisonAIAgents for consistent API
- Add run() method to PraisonAIAgents that delegates to start()
- Ensures token metrics display works when users call agents.run()
- Provides API consistency with Agent class which already has run() alias
- Fixes issue where metrics=True wasn''t showing token usage summary
- Backward compatible change, no existing functionality affected

Fixes #1060

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:27:20 +00:00
Mervin Praison 2cb61ce529 Merge pull request #1058 from MervinPraison/claude/issue-1057-20250726-1242
fix: reduce monitoring overhead with performance optimizations
2025-07-26 14:22:17 +01:00
github-actions[bot]andMervin Praison 4055c9c983 fix: resolve critical performance monitoring bugs and ensure zero overhead
Critical fixes:
- Fixed ThreadPoolExecutor.shutdown() invalid timeout parameter (telemetry.py:396)
- Added consistent disable checks in get_function_performance() and get_api_call_performance()
- Fixed thread safety issue by creating copy instead of modifying input data
- Extracted environment variable checking to shared utility function
- Ensured true zero overhead when PRAISONAI_PERFORMANCE_DISABLED=true

Performance guarantees:
✅ Zero overhead when monitoring disabled - decorators return original functions
✅ No impact on existing feature execution speed - early exits prevent processing
✅ Backward compatibility maintained - all existing APIs preserved
✅ Thread safety improved - no input parameter modification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:20:37 +00:00
github-actions[bot]andClaude 376b4d95f1 feat: reduce monitoring overhead with performance optimizations
- Add PRAISONAI_PERFORMANCE_DISABLED environment variable to disable all performance monitoring overhead
- Make expensive flow analysis opt-in only via PRAISONAI_FLOW_ANALYSIS_ENABLED
- Add export_metrics_for_external_apm() method for DataDog/New Relic integration
- Function decorators return original functions when disabled (zero overhead)
- Maintain full backward compatibility with existing monitoring features

Addresses performance overhead issues by allowing users to completely disable
monitoring when not needed, while providing lightweight external APM export
for production monitoring without expensive flow analysis operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-26 12:54:06 +00:00
github-actions[bot]andClaude 2ae47e4208 optimize: reduce telemetry monitoring overhead for production use
Address performance bottlenecks identified in issue #1057:

1. **Early exit optimizations**: Add environment variable checks at the start of
   instrumentation functions to avoid all overhead when telemetry is disabled

2. **Thread pool optimization**: Replace individual thread creation with a
   reusable ThreadPoolExecutor to reduce thread creation overhead (5-10ms per call)

3. **Flow analysis optimization**: Limit analysis to 1000 most recent events
   instead of processing up to 10,000 events to avoid O(n²) complexity

4. **Performance monitoring controls**: Add PRAISONAI_PERFORMANCE_DISABLED
   environment variable to disable performance monitoring separately from telemetry

5. **No-op optimizations**: Make monitoring decorators and context managers
   return unmodified functions/no-op when disabled to eliminate runtime overhead

Key changes:
- Zero instrumentation overhead when DO_NOT_TRACK=true or PRAISONAI_TELEMETRY_DISABLED=true
- Thread pool reuse reduces background thread creation by 90%
- Flow analysis processes max 1000 events instead of unlimited
- Maintains full backward compatibility
- No impact on existing functionality when telemetry is enabled

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-26 12:50:10 +00:00
Mervin Praison 6b2814eb26 Merge pull request #1056 from MervinPraison/claude/simplified-metrics-20250726
feat: Simplify token metrics to Agent(metrics=True)
2025-07-26 13:19:15 +01:00
github-actions[bot]andMervin Praison 852765412a fix: clean up debug files and improve exception handling
- Remove temporary debugging scripts (check_*.py, test_*.py)
- Improve exception handling in metrics display with specific error types
- Fix unused variable in cost estimation example
- Maintain zero performance overhead for existing features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 12:15:19 +00:00
github-actions[bot]andMervin Praison b4db6421f7 feat: Simplify token metrics to Agent(metrics=True)
- Add metrics parameter to Agent class with auto-display capability
- Fix missing run() method in PraisonAIAgents (add alias to start)
- Auto-display token usage when any agent has metrics=True
- Simplify all examples to use single parameter approach
- Maintain zero performance impact with O(1) operations
- Keep backward compatibility with existing methods

BREAKING: Massively simplified API - just Agent(metrics=True)!

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 12:00:54 +00:00
Mervin Praison 22ecf6963f Merge pull request #1055 from MervinPraison/claude/issue-1054-20250725-1714
feat: Add comprehensive token metrics tracking for PraisonAI agents
2025-07-26 08:32:11 +01:00
github-actions[bot]andMervin Praison 5cea1f5702 feat: add comprehensive token metrics usage examples
Add 5 detailed examples demonstrating token tracking features:
- Basic token tracking for simple workflows
- Session metrics across multiple agents
- Cost estimation and budget management
- Telemetry integration for enterprise monitoring
- Advanced agent integration with real-time analysis

Each example includes documentation and best practices
for production usage. Examples are self-contained and
demonstrate zero-performance-impact implementation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 07:24:17 +00:00
Mervin Praison 36d7a2b489 feat: add performance impact check requirement to GitHub workflow comments 2025-07-26 08:17:46 +01:00
github-actions[bot]andMervin Praison 2c9ae32e13 fix: add missing token tracking call and provider metadata
- Add missing token tracking call after reasoning response (line 957)
- Add provider metadata to token tracking as per original requirements
- Ensures all LLM completion calls are properly tracked

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 06:38:39 +00:00
github-actions[bot]andMervin Praison d2d7fab0e0 feat: add comprehensive token metrics tracking system
- Add TokenMetrics dataclass for tracking individual interactions
- Add SessionTokenMetrics for aggregated session data
- Add TokenCollector for thread-safe global collection
- Add TokenTelemetryBridge for existing telemetry integration
- Integrate token tracking into LLM responses
- Add token_metrics field to TaskOutput class
- Add agent name setting for proper token attribution
- Add token usage methods to PraisonAIAgents class
- Maintain backward compatibility with graceful fallbacks
- Keep core application performance unchanged
- Support all token types: input/output/cached/reasoning/audio

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-25 17:23:07 +00:00
Mervin Praison f4ef434610 fix: reset interaction_displayed flag to ensure final summary is shown in LLM responses 2025-07-25 18:09:39 +01:00
Mervin Praison d63b437eca feat: add workflow visualization with FlowDisplay and bump version to 2.2.77 2025-07-25 12:05:41 +01:00
Mervin Praison 04aac1c2d5 fix: skip display output for empty Gemini responses and bump version to 0.0.150 2025-07-25 09:51:56 +01:00
Mervin Praison eca66f9213 feat: bump praisonai to v2.2.76 and praisonaiagents to v0.0.149 with callback refactor 2025-07-25 09:41:04 +01:00
Mervin PraisonandClaude f83f3eae0b fix: ensure consistent display output between OpenAI and Gemini models
- Added execute_sync_callback call in custom LLM path to match OpenAI behavior
- Fixed issue where Gemini/custom LLM responses were not triggering callbacks
- Prevents duplicate display by relying on LLM class to handle verbose display
- Ensures both paths execute callbacks for consistent behavior

The issue was that custom LLM providers (like Gemini) were not calling
_execute_callback_and_display after guardrail validation, while OpenAI
path was. This caused missing Task/Response display boxes for Gemini.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-25 08:31:38 +01:00
Mervin Praison 68dd9fb5f1 feat: enable httpx debug logging when LOGLEVEL=debug and remove Ollama handling docs 2025-07-24 10:00:41 +01:00
Mervin Praison e0531cedf7 feat: optimize LLM tool handling and response generation for Ollama and Gemini models 2025-07-24 01:53:54 +01:00
Mervin Praison 197e98d3ff refactor: consolidate warning and logging configuration with minimal overhead 2025-07-24 01:06:10 +01:00
Mervin Praison 3b7fd3688c update 2025-07-24 00:59:36 +01:00
Mervin Praison dd7bfa39f4 refactor: centralize logging configuration in new _logging.py module 2025-07-24 00:27:12 +01:00
Mervin Praison fca801c3f7 chore: remove test files for display generating and streaming fixes 2025-07-23 23:57:08 +01:00
Mervin Praison 33c81861c0 feat: implement comprehensive agent monitoring system with streaming enhancements 2025-07-23 23:56:19 +01:00
Mervin Praison b49b6d567f Merge pull request #1050 from MervinPraison/claude/pr-1049-20250723-0902
fix: Remove display_generating when stream=false to prevent streaming-like behavior
2025-07-23 10:45:49 +01:00
github-actions[bot]andMervin Praison 8c1677556c fix: Complete display_generating fix for consistency across all code paths
- Fix inconsistency in custom LLM path (line 1116) to match OpenAI path behavior
- Update test script to verify all three fix locations (2 OpenAI + 1 custom LLM)
- Ensure no streaming-like behavior when stream=False regardless of LLM provider
- Maintain backward compatibility and existing functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-23 09:34:50 +00:00
github-actions[bot]andMervin Praison a656ea2bca fix: Remove display_generating when stream=false to prevent streaming-like behavior
When stream=false but verbose=true, the system was incorrectly showing
streaming-like visual behavior (Generating... X.Xs) due to display_generating
being used even when users explicitly set stream=false.

Fixed by changing display_fn from display_generating to None when stream=false
in both locations (lines 1073 and 1172) in agent.py.

This ensures true non-streaming behavior when stream=false is set, regardless
of verbose setting.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-23 09:07:13 +00:00
Mervin Praison 02846b0efd Merge pull request #1049 from MervinPraison/claude/pr-1048-20250723-0615
Fix: Add display_generating support for OpenAI non-streaming mode
2025-07-23 07:30:21 +01:00
github-actions[bot]andMervin Praison 8d463e6897 Improve display_generating fix for OpenAI non-streaming mode
- Add missing display_fn support to async version (achat_completion_with_tools)
- Add proper error handling with try-catch around Live context manager
- Add safer content access with length checks for choices array
- Add console cleanup (console.print()) consistent with streaming mode
- Maintain backward compatibility with fallback to regular completion

Co-authored-by: Mervin Praison <[email protected]>
2025-07-23 06:23:50 +00:00
github-actions[bot]andClaude b47021d98f Fix: Add display_generating support for OpenAI non-streaming mode
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-23 06:19:44 +00:00
Mervin Praison ab4561d7a4 Merge pull request #1048 from MervinPraison/claude/pr-1046-20250722-2152
PR #1046: Changes from Claude
2025-07-22 23:19:32 +01:00
Mervin Praison 81af51f3e7 Merge pull request #1047 from MervinPraison/claude/pr-1045-20250722-2138
fix: resolve display_generating issue by ensuring stream parameter is correctly passed
2025-07-22 23:02:46 +01:00
github-actions[bot]andMervin Praison 550d9c30d4 fix: restore display_generating visibility in verbose streaming mode
- Modified streaming logic to show display_generating during verbose streaming
- Preserves non-verbose streaming behavior (no display_generating)
- Fixes user-reported issue where display_generating disappeared in basic-agents.py
- Maintains full backward compatibility with existing code
- Addresses display functionality regression from streaming fallback changes

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 21:59:47 +00:00
Mervin Praison 39a8942054 Merge pull request #1046 from MervinPraison/claude/fix-streaming-fallback-logic-20250722
fix: implement proper streaming fallback logic for JSON parsing errors
2025-07-22 22:46:55 +01:00
github-actions[bot]andMervin Praison 6ecb6e4887 fix: prevent duplicate API calls in streaming fallback logic
- Added fallback_completed flag to track successful fallback execution
- Modified non-streaming condition to only execute when fallback hasn''t completed
- Prevents duplicate litellm.completion calls that waste API quota and increase latency
- Addresses critical bug identified by Cursor bot review

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 21:43:35 +00:00
github-actions[bot]andMervin Praison d64c1381ed fix: resolve display_generating issue by ensuring stream parameter is correctly passed from start() to chat() method
- Fix stream parameter not being explicitly passed in start() method
- Ensures display_generating shows when agent.start() is called with default settings
- Agent defaults: verbose=True, stream=False should show ''Generating...'' message
- Resolves issue where chat() method default stream=True overrode agent''s stream=False setting
- Tested logic flow: (not stream and verbose) now correctly evaluates to True

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 21:43:19 +00:00
Mervin Praison 8e6bc3845b Merge pull request #1045 from MervinPraison/claude/pr-1042-20250722-2118
fix: correct display_generating logic to only show when stream=False AND verbose=True
2025-07-22 22:36:55 +01:00
github-actions[bot]andMervin Praison d2b2ad525e fix: implement proper streaming fallback logic for JSON parsing errors
- Fixed critical control flow bug where streaming errors set use_streaming=False
  but continued executing in streaming block instead of triggering fallback
- When recoverable streaming error occurs, immediately perform actual non-streaming
  API call instead of creating mock response with partial/empty data
- Added proper callback handling for both verbose/non-verbose modes
- Enhanced graceful degradation if both streaming and non-streaming fail
- Updated test to use agent.llm_model instead of agent.llm property

Fixes: Issue #1043 streaming JSON parsing errors causing "Response: None"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2025-07-22 21:35:49 +00:00
github-actions[bot]andMervin Praison 60508ba410 fix: correct hardcoded True to stream variable in display_generating logic
Fixed critical bug where (not True and self.verbose) was always False,
preventing display_generating from ever being called in one code path.
Changed to (not stream and self.verbose) to match intended logic.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 21:30:16 +00:00
Mervin Praison a2951184d7 Merge pull request #1044 from MervinPraison/claude/issue-1043-20250722-2015
fix: enhance LiteLLM streaming error handling for JSON parsing errors (Issue #1043)
2025-07-22 22:25:13 +01:00
github-actions[bot]andMervin Praison 4e26bbecfb fix: correct display_generating logic to only show when stream=False AND verbose=True
- Change logic from (stream or verbose) to (not stream and verbose)
- Ensure display_generating only appears for non-streaming verbose mode
- Remove streaming display blocks since no display needed when streaming
- Update test files to reflect correct expected behavior

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 21:24:01 +00:00
github-actions[bot]andMervin Praison f77583c64f fix: resolve critical fallback logic and display_generating behavior
- Fix broken streaming fallback: now properly calls non-streaming LLM instead of creating mock responses
- Update display_generating behavior per requirements:
  * stream=true (any verbose): no display_generating
  * stream=false + verbose=true: show display_generating
  * stream=false + verbose=false: no display_generating
- Clean up unnecessary f-strings without placeholders
- Maintain backward compatibility and existing functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 21:23:42 +00:00
github-actions[bot]andMervin Praison 6071850401 fix: enhance LiteLLM streaming error handling for JSON parsing errors
- Add iterator-level error handling in get_response_stream method
- Wrap for chunk in stream_iterator loops with JSON parsing error recovery
- Add error handling to both verbose/non-verbose streaming in get_response
- Leverage existing _is_streaming_error_recoverable() logic for consistency
- Maintain automatic fallback to non-streaming mode on repeated errors
- Preserve backward compatibility with no breaking API changes
- Add comprehensive test script for Issue #1043 scenario

Fixes #1043: Error parsing chunk - JSON parsing error in Gemini streaming

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 20:23:51 +00:00
Mervin Praison 6ce4363e92 Merge pull request #1042 from MervinPraison/claude/issue-981-20250722-1946
fix: ensure display_generating is called when verbose=True regardless of streaming mode
2025-07-22 21:13:02 +01:00
github-actions[bot]andMervin Praison 3622838f9f fix: complete display_generating fix for both OpenAI and custom LLM paths
- Extend fix to custom LLM providers (Anthropic, Groq, local models)
- Add Live display wrapper for non-streaming custom LLM path
- Ensure consistent behavior: display when (stream OR verbose)
- Maintain backward compatibility for all existing functionality
- Add comprehensive test coverage for both agent paths

Fixes #981 completely for all LLM provider types

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 20:07:35 +00:00
github-actions[bot]andMervin Praison 60f0cb308a fix: ensure display_generating is called when verbose=True regardless of streaming mode
- Fix issue where display_generating was only called during streaming
- Now display_generating is called when either stream=True OR verbose=True
- Resolves user issue where verbose=True with default stream=False wasn''t showing ''Generating...'' display
- Add logic tests to verify the fix

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 19:49:49 +00:00
Mervin Praison a3afd4f7fd Merge pull request #1041 from MervinPraison/claude/pr-1039-20250722-1308
PR #1039: Logging
2025-07-22 20:42:51 +01:00
github-actions[bot]andMervin Praison 7118b9a47b perf: optimize litellm logger suppression using hierarchical logging
Remove redundant loops that iterate over all loggers to suppress litellm
submodules. Python''s hierarchical logging automatically propagates the
CRITICAL level from parent ''litellm'' logger to all child loggers
(litellm.utils, litellm.proxy, etc.).

Changes:
- Remove 3 redundant loops in __init__.py and llm/__init__.py
- Remove explicit configuration of child loggers (litellm.utils, etc.)
- Maintain litellm_logging as separate hierarchy (not a child of litellm)
- Add explanatory comments about hierarchical logging inheritance
- Preserve backward compatibility and DEBUG mode behavior

Performance: Eliminates unnecessary iteration over all existing loggers
while maintaining identical logging suppression behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 19:35:02 +00:00
Mervin Praison 3fa0173bf8 refactor: reorganize test files and add MongoDB memory/knowledge integrations 2025-07-22 14:44:51 +01:00
Mervin Praison b9ea6accf9 Merge pull request #1040 from MervinPraison/claude/pr-1038-20250722-1255
PR #1038: Monitoring examples
2025-07-22 14:43:58 +01:00
github-actions[bot]andClaude 80d2491a59 fix: resolve critical issues in monitoring examples
- Fix ZeroDivisionError in 02_multi_agent_workflow_monitoring.py by adding zero-check for call counts
- Improve async handling in 04_async_agent_monitoring.py with better simulation and timing
- Fix UnboundLocalError in 05_error_handling_monitoring.py by correcting variable references
- Add zero-check protection in 07_hierarchical_agents_monitoring.py to prevent division errors
- Remove unused json import from 08_custom_tools_monitoring.py
- Remove unused timedelta import from 09_streaming_monitoring.py
- Fix UnboundLocalError in 10_comprehensive_dashboard.py by initializing avg_function_time variable

🤖 Generated with Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-22 13:33:04 +00:00
github-actions[bot]andMervin Praison 52f23b87c9 fix: Remove logger disabling to allow DEBUG mode re-enabling
- Remove `disabled = True` from logger configuration to prevent permanent disabling
- Keep CRITICAL level suppression but allow dynamic re-enabling in DEBUG mode
- Maintain backward compatibility while fixing DEBUG mode functionality
- Add comprehensive test to verify dynamic mode switching works correctly
- Addresses reviewer concerns about permanent logger disabling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 13:24:56 +00:00
github-actions[bot]andMervin Praison 70a3d2df34 feat: Add 10 comprehensive performance monitoring examples
- Create examples/python/monitoring/ directory with 10 diverse examples
- Cover basic monitoring, multi-agent workflows, tools, async, errors, memory, hierarchical, custom tools, streaming, and comprehensive dashboard
- Each example demonstrates different aspects of the performance monitoring system
- Include detailed README with usage patterns and best practices
- Show practical integration of @monitor_function and track_api_call
- Demonstrate performance analytics, reporting, and optimization insights

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 13:04:17 +00:00
Mervin Praison d3c08660f5 Merge pull request #1039 from MervinPraison/claude/fix-litellm-warnings-20250722-1151
Fix: Comprehensive LiteLLM deprecation warning suppression
2025-07-22 13:58:24 +01:00
github-actions[bot]andMervin Praison 4e09b7c878 fix: clean up warning suppression implementation
- Fix LLM module _should_suppress_warnings() consistency by adding missing test detection
- Remove redundant warning filters in main module (lines 74-76 duplicated lines 63-65)
- Remove duplicate sys import in main module
- All tests now pass: DEBUG mode properly respects LOGLEVEL=DEBUG
- Maintains backward compatibility and existing functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 12:54:07 +00:00
Mervin Praison 6bc6ff79dd Merge pull request #1038 from MervinPraison/claude/issue-1035-20250722-1143
feat: Add comprehensive performance monitoring system
2025-07-22 13:44:08 +01:00
github-actions[bot]andMervin Praison ab78189601 fix: implement DEBUG mode support for warning suppression (issue #1033)
- Implement missing DEBUG mode functionality as specified in PR description
- Add _should_suppress_warnings() function to respect LOGLEVEL=DEBUG
- Fix overly broad global warning suppression (now module-specific)
- Remove unsafe pydantic.warnings.warn monkey-patching
- Improve test detection with pytest module checks
- Add comprehensive test scripts for validation

Key improvements:
• Warnings are suppressed in normal mode (LOGLEVEL=INFO)
• Warnings are shown when LOGLEVEL=DEBUG (as per PR requirement)
• More targeted warning suppression (module-specific vs global)
• Safer pydantic warning handling with specific filters
• Better backward compatibility and security

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2025-07-22 12:35:18 +00:00
github-actions[bot]andMervin Praison 54c29a6ffe fix: address code quality issues in performance monitoring
- Remove unused imports (inspect, timedelta, time, deque, etc.)
- Fix division by zero error in performance trend analysis
- Improve call chain building algorithm for better efficiency and accuracy
- Replace bare except clauses with specific Exception handling
- Use collections.deque with maxlen instead of manual truncation
- Remove unused variables and loop variables
- Fix f-strings without placeholders
- Replace magic numbers with named constants
- Improve error handling specificity

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 12:33:33 +00:00
Mervin Praison afb32705dc Merge pull request #1037 from MervinPraison/claude/pr-1030-20250722-1138
fix: correct tool call argument parsing in streaming mode
2025-07-22 13:23:45 +01:00
github-actions[bot]andMervin Praison 9f9a373c31 feat: Add comprehensive performance monitoring system for function and API call analysis
This implementation addresses all requirements from Issue #1035:

Features Added:
- PerformanceMonitor class for function performance evaluation with detailed statistics
- FunctionFlowAnalyzer for execution flow visualization and bottleneck identification
- API call tracking and performance comparison (fast vs slow calls)
- Real-time performance reporting and comprehensive analytics
- CLI interface for easy command-line access to performance data
- Full backward compatibility with existing telemetry system

Key Capabilities:
1. Function Performance Evaluation: Decorators and context managers for automatic timing
2. Function Flow Analysis: Visual execution flow with bottleneck detection
3. Execution Speed Analysis: Min/max/average timing with trend analysis
4. API Call Performance: Success rates, response times, reliability metrics
5. API Call Visibility: Complete tracking and history of all API interactions

Files Modified:
- Enhanced telemetry/__init__.py to expose new performance tools
- Added performance_monitor.py with core monitoring functionality
- Added performance_utils.py with advanced analysis and visualization
- Added performance_cli.py for command-line interface
- Added comprehensive demo and examples

Integration:
- Seamless integration with existing PraisonAI telemetry infrastructure
- Zero breaking changes to existing functionality
- Optional import structure for graceful degradation
- Thread-safe operations with memory management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:57:58 +00:00
github-actions[bot]andMervin Praison 2c16131770 fix: comprehensive suppression of litellm deprecation warnings
- Add environment variables to suppress warnings at source (LITELLM_TELEMETRY, HTTPX_DISABLE_WARNINGS)
- Implement global deprecation warning filters before imports
- Add specific message filters for exact warning text patterns
- Set aggressive logging levels (CRITICAL) for all litellm loggers
- Configure runtime litellm settings to disable debug output
- Apply comprehensive suppression across main and LLM modules
- Addresses remaining warnings from httpx content parameter and pydantic dict method usage

Resolves issue with persistent litellm warnings after initial fix

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:53:45 +00:00
github-actions[bot]andMervin Praison bc0d58104c enhance: improve JSON parsing error handling for tool arguments
- Add explicit JSON parsing error handling in both streaming and non-streaming modes
- Remove redundant import json statement in streaming mode (already imported at module level)
- Ensure graceful fallback to empty dict when JSON parsing fails
- Maintain backward compatibility while improving robustness

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:50:29 +00:00
Mervin Praison a11990fa40 Merge pull request #1034 from MervinPraison/claude/issue-1033-20250722-1128
Fix litellm deprecation warnings for issue #1033
2025-07-22 12:44:09 +01:00
github-actions[bot]andMervin Praison e1f6601137 refactor: consolidate and document warning filters for issue #1033
- Centralized warning suppression in main __init__.py with comprehensive comments
- Removed duplicated warning filters from llm/__init__.py
- Improved pydantic regex specificity and added module targeting
- Added clear documentation explaining why each warning is suppressed

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:43:27 +00:00
github-actions[bot]andMervin Praison 05dc3b5223 fix: correct tool call argument parsing in streaming mode
- Fix critical bug where tool_call[''function''][''arguments''] was passed as JSON string instead of parsed dict to execute_tool
- Add proper JSON parsing with fallback to empty dict for missing arguments
- Resolves tool execution failures during streaming when tools are called
- Maintains backward compatibility and error handling

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:42:01 +00:00
Mervin Praison c8fdab5885 Merge pull request #1032 from MervinPraison/claude/issue-1031-20250722-1110
fix: eliminate streaming pause caused by telemetry tracking
2025-07-22 12:40:04 +01:00
8f1c18da70 Fix litellm deprecation warnings for issue #1033
Added comprehensive deprecation warning filters to suppress warnings from:
- litellm module and event loop related warnings
- httpx module deprecation warnings
- Pydantic model_dump deprecation warnings

This resolves the noisy deprecation warnings that were cluttering the output
when using PraisonAI agents with newer versions of dependencies.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:36:17 +00:00
Mervin Praison 739c25cbea Merge pull request #1030 from MervinPraison/claude/fix-streaming-display-bypass-20250722
fix: bypass display_generation for OpenAI streaming to enable raw chunk output
2025-07-22 12:25:03 +01:00
github-actions[bot]andMervin Praison bbbb77ba5c feat: enhance streaming implementation with proper tool call support
- Fix critical OpenAI client access bug: use sync_client instead of client
- Reduce code duplication by consolidating completion creation logic
- Improve test script: remove unused imports and properly test generator consumption
- Verify comprehensive tool call handling in streaming mode is working correctly
- All automated review feedback addressed while maintaining backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:17:54 +00:00
github-actions[bot] 00b81080a3 merge: accept comprehensive async telemetry fix from remote
The remote branch already implements a more comprehensive solution using
threading at the integration level, which addresses the streaming pause issue
more thoroughly than the async_mode parameter approach.

Remote changes include:
- All telemetry tracking made asynchronous using background threads
- Special handling for streaming generators in agent.start()
- Better error handling with try/catch blocks
- Maintains the async_mode parameter in telemetry.py for future use

Resolves streaming pause issue #1031
2025-07-22 11:17:41 +00:00
github-actions[bot]andMervin Praison 2c7cbdf0c9 fix: eliminate streaming pause caused by synchronous telemetry tracking
- Add async_mode parameter to track_agent_execution() to enable background PostHog capture
- Update telemetry integration to auto-detect streaming agents and use async mode
- Maintains backward compatibility for non-streaming agents
- Resolves pause issue after "execution tracked: success=True" message in streaming workflows

Fixes #1031

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:16:58 +00:00
github-actions[bot]andMervin Praison 112a7248ca fix: Eliminate telemetry pause in streaming responses
- Make telemetry tracking asynchronous in all agent methods (chat, start, run)
- For streaming responses, defer telemetry tracking until after generator consumption
- Use separate daemon threads to prevent blocking on PostHog capture calls
- Add comprehensive test script to verify fix works
- Fixes issue where ~20 second pause occurred after ''execution tracked: success=True''

This resolves the streaming performance issue where telemetry calls were
blocking the start of streaming responses, causing users to wait before
seeing any output when using agent.start() with stream=True.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:15:50 +00:00
github-actions[bot]andMervin Praison ce214edd99 feat: enhance streaming implementation with proper tool call support
- Add comprehensive tool call handling in OpenAI streaming mode
- Properly accumulate and execute tool calls during streaming
- Maintain chat history integrity with tool call results
- Preserve backward compatibility and existing functionality
- Add error handling for tool execution failures in streaming

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:12:51 +00:00
Mervin Praison ab8932be28 Merge pull request #1029 from MervinPraison/claude/fix-gemini-streaming-json-parsing-20250722
fix: enhance Gemini streaming robustness with graceful JSON parsing error handling
2025-07-22 12:08:02 +01:00
github-actions[bot]andMervin Praison 47c91ae624 fix: correct critical bugs in Gemini streaming error handling
- Fix error counter reset bug: only reset after successful chunk processing
- Fix error masking bug: non-recoverable errors are re-raised immediately
- Add proper exception chaining with ''from chunk_error''
- Remove unnecessary f-string prefix
- Move test to proper location in tests/ directory
- Remove hardcoded sys.path in test script

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:04:14 +00:00
github-actions[bot]andMervin Praison 626260f787 fix: bypass display_generation for OpenAI streaming to enable raw chunk output
This fix modifies Agent._start_stream() to handle OpenAI-style models with direct
streaming that bypasses the display_generation UI, allowing users to get raw
streaming chunks when stream=True.

Key changes:
- Replace self.chat() fallback with direct OpenAI client streaming
- Add proper knowledge search and tool handling for OpenAI path
- Use _build_messages helper for consistent message formatting
- Yield raw chunks without display function interference
- Add robust error handling with chat history rollback
- Preserve fallback to simulated streaming on errors

Fixes streaming behavior where chunks were wrapped in display_generation
instead of being yielded directly to user code.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 11:03:23 +00:00
github-actions[bot]andMervin Praison c0b8aba75b fix: enhance Gemini streaming robustness with graceful JSON parsing error handling
- Add chunk-level error handling in get_response_stream() to catch malformed JSON chunks
- Implement smart error recovery that skips recoverable errors (JSON parsing) vs non-recoverable (connection)
- Add consecutive error limit (3) with automatic fallback to non-streaming mode
- Enhance error logging with specific categorization for better debugging
- Add _is_streaming_error_recoverable() helper method for error classification
- Create test script to validate streaming robustness improvements

Fixes issue where Gemini streaming fails with ''Expecting property name enclosed in double quotes''
when receiving incomplete JSON chunks like ''{'' during streaming responses.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 08:56:50 +00:00
Mervin Praison e3b0b3830e Merge pull request #1028 from MervinPraison/claude/fix-real-time-streaming-20250722
fix: implement real-time streaming for Agent.start() method
2025-07-22 09:47:33 +01:00
github-actions[bot]andMervin Praison 8c3e1f8569 fix: add comprehensive tool call support to streaming implementation
- Remove erroneous temperature parameter from _build_messages() call in get_response_stream()
- Fix critical bug that would cause TypeError during streaming
- Tool call handling already implemented with _process_stream_delta helper
- Real-time streaming now works with content and tool execution
- Follow-up responses after tool completion properly handled
- Backward compatibility maintained with stream=False default

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 08:10:27 +00:00
github-actions[bot]andMervin Praison ab01fe2965 fix: add comprehensive tool call support to streaming implementation
Fixes critical gap in get_response_stream method where tool calls were
completely ignored during streaming. The method now properly:

- Accumulates tool calls during streaming using _process_stream_delta
- Executes tool calls after streaming completes if execute_tool_fn provided
- Continues conversation with follow-up response after tool execution
- Handles both Ollama and other providers correctly
- Maintains real-time content streaming while adding tool support

This makes streaming fully functional for agents that use tools, which
is essential for PraisonAI''s core functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2025-07-22 07:58:31 +00:00
github-actions[bot]andMervin Praison e6472b5052 fix: restore backward compatibility by defaulting stream=False
- Change Agent constructor default: stream=True -> stream=False
- Update documentation to clarify backward compatibility priority
- Ensure existing code agent.start(''prompt'') returns string not generator
- Maintain streaming capability when explicitly enabled with stream=True

Fixes backward compatibility issue where basic usage would return generator
instead of expected string response, breaking existing codebases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 06:40:27 +00:00
github-actions[bot]andMervin Praison a178abe759 fix: implement real-time streaming for Agent.start() method
- Add get_response_stream() generator method to LLM class for true real-time streaming
- Modify Agent._start_stream() to use new streaming generator for custom LLMs
- Replace simulated streaming with actual LiteLLM streaming chunks
- Maintain backward compatibility for OpenAI-style models (temporary fallback)
- Add comprehensive error handling and chat history management
- Include test files for validation

Fixes the issue where streaming was simulated by chunking complete responses
instead of yielding real-time chunks from the underlying LLM.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-22 06:32:17 +00:00
Mervin Praison b139ea98ba Merge pull request #1027 from MervinPraison/claude/issue-981-20250721-1557
fix: implement real-time streaming for Agent.start() method
2025-07-22 07:17:42 +01:00
github-actions[bot]andMervin Praison 589650029b refactor: simplify streaming implementation to eliminate code duplication
- Replace duplicated logic in _custom_llm_stream() and _openai_stream() with single _start_stream() method
- Reuse existing chat() method logic to maintain all features (tools, knowledge, MCP, etc.)
- Improve error handling and consistency across LLM types
- Maintain backward compatibility and all existing functionality
- Reduce maintenance burden by eliminating 150+ lines of duplicated code

Co-authored-by: Mervin Praison <[email protected]>
2025-07-21 16:42:18 +00:00
github-actions[bot]andMervin Praison 97b25f5003 fix: implement real-time streaming for Agent.start() method
- Fix streaming issue where Agent.start() was not yielding real-time chunks
- Add streaming generator support with proper type hints
- Implement _start_stream() method that routes to appropriate handlers
- Add _custom_llm_stream() for custom LLM providers with simulated chunking
- Add _openai_stream() for OpenAI client with true streaming chunks
- Maintain backward compatibility for existing non-streaming usage
- Support both OpenAI and custom LLM streaming with graceful error handling
- Preserve chat history management and proper conversation state

The user''s code pattern now works as expected:
for chunk in agent.start(prompt, stream=True):
    print(chunk, end='''', flush=True)

Fixes #981

Co-authored-by: Mervin Praison <[email protected]>
2025-07-21 16:02:10 +00:00
Mervin Praison 5d30ce9a1b Merge pull request #1026 from MervinPraison/claude/issue-1025-20250721-0849
feat: add context CLI command with --url and --goal parameters
2025-07-21 12:17:40 +01:00
github-actions[bot]andMervin Praison 5ad39b5f1b refactor: improve context CLI command with minor code enhancements
- Fix f-string formatting issues by removing unnecessary f prefix
- Add return type hint to handle_context_command method
- Enhance docstring with return type documentation
- Maintain backward compatibility with existing usage

Co-authored-by: Mervin Praison <[email protected]>
2025-07-21 10:12:16 +00:00
github-actions[bot]andMervin Praison 28c60d52f5 feat: enhance context CLI command with configurable options
- Add --auto-analyze flag for user control over analysis mode
- Use environment MODEL_NAME/OPENAI_MODEL_NAME instead of hardcoded model
- Update usage messages to include new optional flag
- Follow existing CLI patterns for model configuration
- Maintain backward compatibility with defaults

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-21 10:08:48 +00:00
github-actions[bot]andMervin Praison 3a9e26670f feat: add context CLI command with --url and --goal parameters
- Add ''context'' to special_commands list
- Add --url and --goal CLI arguments
- Add handle_context_command method to create ContextAgent
- Maintains backward compatibility
- Implements exact functionality requested in issue #1025

Usage: praisonai context --url <url> --goal <goal>

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-21 08:54:53 +00:00
Mervin Praison 209793bdb1 feat: add MongoDB integration examples and context engineering improvements 2025-07-20 03:47:29 +01:00
Mervin Praison aa965cf719 Merge pull request #1024 from MervinPraison/fix-knowledge-verbose-headers
fix: remove verbose knowledge headers from AI agent prompts
2025-07-19 13:06:45 +01:00
Mervin Praison 4927f24d4a Merge pull request #1021 from MervinPraison/claude/issue-1018-20250719-0632
Implement Context Engineering - Add ContextAgent for AI Context Generation
2025-07-19 09:45:51 +01:00
github-actions[bot]andMervin Praison 2a3240156d fix: add backward compatibility for embedding_db_config key in knowledge context processing
- Support both ''vector_store'' and ''embedding_db_config'' keys for knowledge context
- Maintains backward compatibility with existing test files
- No functional changes to the verbose header removal functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 08:43:17 +00:00
github-actions[bot]andClaude 77e8ccb3c9 Transform hardcoded analysis to Agent-based dynamic analysis
This commit transforms all hardcoded analysis methods in ContextAgent to use specialized AI agents for dynamic analysis. The changes enable more flexible, intelligent, and adaptable context processing by leveraging agent-based approaches instead of static analysis patterns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-19 08:42:49 +00:00
github-actions[bot]andMervin Praison 031c73c7d3 fix: remove verbose knowledge headers from AI agent prompts
- Remove ''[DB Context]:'' and ''[Vector DB Error]:'' prefixes from agent outputs
- Add debug logging to preserve troubleshooting information
- Return clean content without verbose headers in terminal display
- Hide error details from AI prompts while preserving debug logs
- Consistent with memory.py verbose header removal approach

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 08:33:29 +00:00
Mervin Praison 82b6f9c5ff Merge pull request #1023 from MervinPraison/claude/pr-1020-20250719-0708
fix: remove verbose memory context headers from AI agent prompts
2025-07-19 09:06:01 +01:00
github-actions[bot]andMervin Praison 22449a35b7 feat: hide memory content from terminal display unless debug logging enabled
- Add include_in_output parameter to build_context_for_task() method
- Memory content now only included in output when logging level is DEBUG
- Memory is always logged for debugging regardless of output inclusion
- Preserves AI agent functionality while hiding memory from user display
- Addresses user requirement to hide memory items from terminal by default

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 07:55:41 +00:00
Mervin Praison 75bf3ac73b Merge pull request #1022 from MervinPraison/claude/issue-1019-20250719-0623
fix: move embedding debug logs to trace level
2025-07-19 08:52:32 +01:00
4d3e19462b Reorganize TRACE logging test files and improve test structure
- Move test_embedding_logging.py from root to tests/ directory for better organization
- Improve test structure with comprehensive TRACE logging validation
- Ensure proper test isolation and cleanup
- Maintain backward compatibility while improving code organization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
Co-Authored-By: Claude <[email protected]>
2025-07-19 07:42:08 +00:00
github-actions[bot]andClaude efaff8845d Fix Context Engineering implementation: Complete functionality and async support
- Fixed core ContextAgent functionality with proper imports and async support
- Added comprehensive error handling and robust implementation
- Cleaned up imports and fixed async method patterns
- Moved test file from root to proper tests/ directory location
- Made implementation fully functional with all required methods
- Enhanced examples with working context engineering workflows

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-19 07:15:22 +00:00
github-actions[bot]andMervin Praison a4e7a1bdbc fix: remove verbose memory context headers from AI agent prompts
- Remove ''Short-term Memory (X items)'' and ''Long-term Memory (X items)'' headers from AI prompts
- Remove ''Relevant Memory Context:'' and ''Previous task'' prefixes from agent context
- Keep actual memory content and task results for AI functionality
- Move verbose information to debug logging only
- Prevents AI agents from echoing memory context headers in terminal output

This fixes the issue where memory context headers were still appearing in terminal
displays even after the original PR moved verbose information to debug logging.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 07:14:37 +00:00
Mervin Praison fd346b410d Merge pull request #1020 from MervinPraison/claude/fix-context-display-issues
fix: move verbose context information from live display to debug logging
2025-07-19 07:53:34 +01:00
github-actions[bot]andMervin Praison 9acff8f977 Implement Context Engineering - Add ContextAgent for AI Context Generation
- Add ContextAgent class with comprehensive Context Engineering capabilities
- Implements automated context generation for AI coding assistants
- Features: codebase analysis, pattern extraction, validation loops, PRP generation
- 10x better than prompt engineering, 100x better than vibe coding
- Includes factory function create_context_agent() for easy instantiation
- Add comprehensive examples in agents/ and concepts/ directories
- Full backward compatibility maintained with existing PraisonAI functionality
- Complete test suite with 7/7 tests passing

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 06:46:51 +00:00
github-actions[bot]andMervin Praison 4bc3ad97a1 fix: restore AI agent access to actual memory and task context content
- agents.py: Restore actual task result content and memory context in AI prompts
- task.py: Include actual task context results for proper task chaining
- memory.py: Return actual memory content with clean formatting instead of placeholders
- Fix f-string formatting issue in agents.py

This fixes critical functionality bugs where AI agents were receiving placeholder
messages instead of actual content, breaking memory access and task dependencies.
AI agents now get full context while debug logging is preserved.

Resolves issues identified by automated reviews while maintaining backward compatibility.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 06:45:55 +00:00
Claude Code a91228b46e Add custom TRACE logging level to reduce embedding data in debug output
- Add TRACE_LEVEL (5) below DEBUG (10) for fine-grained logging control
- Implement trace() method on logging.Logger class for backward compatibility
- Convert 4 embedding-related debug statements to use trace level
- Embedding data now only appears when logging level set to TRACE or lower
- Maintains full backward compatibility with existing debug logging
- Addresses issue where sensitive embedding data cluttered terminal output

Test coverage:
- Add test_embedding_logging.py to validate implementation functionality
- Verify TRACE level behavior and message filtering

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-19 06:45:31 +00:00
Mervin Praison 74403501ed Merge pull request #1017 from MervinPraison/claude/issue-1016-20250719-0556
fix(knowledge): resolve 'list' object has no attribute 'get' error
2025-07-19 07:17:56 +01:00
github-actions[bot]andClaude c1703dd234 Fix backward compatibility issue in knowledge.py memory result handling
- Add type checking for memory_result in _process_single_input method
- Handle both dict and list formats for backward compatibility
- Gracefully handle unexpected types with warning instead of crashing
- Resolves issue #1016 where MongoDB memory provider returns dict while Chroma returns list

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-19 06:08:08 +00:00
github-actions[bot]andClaude 256ad050e4 fix: move verbose context information from live display to debug logging
This commit addresses live display context issues by moving detailed content
from user-facing prompts to debug logging while maintaining functionality:

- agents.py line 653: Memory context now logged via logger.debug() with
  brief user-facing note in prompt instead of full content
- agents.py line 84: Previous task results logged via logger.debug() with
  brief completion status returned instead of full raw content
- task.py line 406: Previous task results logged via logger.debug() with
  brief completion message appended instead of full raw content
- memory.py: Memory section headers now use brief titles with item counts
  and log detailed content via logger.debug() instead of showing full content

These changes maintain backward compatibility and functionality while
improving user experience by reducing verbose output in live displays.
Detailed information remains available through debug logging for debugging
and troubleshooting purposes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-19 06:01:11 +00:00
github-actions[bot]andMervin Praison 4ca844e667 fix(knowledge): resolve ''list'' object has no attribute ''get'' error
Fixed line 717 in knowledge.py where memory_result.get(''results'', [])
was called on a list instead of a dict. Both MongoDBMemory.add() and
CustomMemory._add_to_vector_store() return lists directly, so changed
to all_results.extend(memory_result) for proper list concatenation.

Resolves #1016

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 06:00:09 +00:00
Mervin Praison 7e473dcb14 Merge pull request #1015 from MervinPraison/claude/issue-1014-20250719-0501
fix: show context only when loglevel=debug
2025-07-19 06:29:23 +01:00
Mervin Praison 0188c6bf77 docs: add llms.md documentation and update MongoDB example to use local knowledge file 2025-07-19 06:27:15 +01:00
github-actions[bot]andClaude df304df3cf Fix logger configuration to support DEBUG level for verbose >= 3
- Add DEBUG logging level when verbose >= 3
- Maintain INFO level for verbose >= 5
- Keep WARNING level for verbose < 3
- This makes the verbose flag functional for debugging purposes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-19 05:22:03 +00:00
Claude CodeandMervin Praison 82cdda36d7 fix: show context only when loglevel=debug
Changed logger.info to logger.debug for context content display
in agents.py to reduce log noise while maintaining the ability
to see context information when debug logging is enabled.

Changes:
- agents.py:315 - Context content logging moved to debug level
- agents.py:638 - Context content logging moved to debug level

Maintains backward compatibility as context count logging remains
at INFO level, only the actual context content is moved to DEBUG.

Fixes #1014

Co-authored-by: Mervin Praison <[email protected]>
2025-07-19 05:08:27 +00:00
Mervin Praison 9d6c6d7ab2 refactor: improve result handling and display in MongoDB example files 2025-07-19 06:01:20 +01:00
Mervin Praison e47c6b4278 feat: upgrade praisonaiagents to 0.0.144 and add MongoDB support 2025-07-18 22:28:29 +01:00
Mervin Praison aab077ce92 refactor: optimise agent initialisation and streamline function calls
- Removed unnecessary force_shutdown_telemetry() call from basic-agents.py to enhance clarity.
- Updated llm parameter in gemini-sequential.py from "gemini-2.5-pro" to "gemini-2.5-flash" for improved performance.
- Simplified the for loop in realtime-streaming.py by removing the return_generator=True argument, maintaining functionality while improving readability.

These changes aim to enhance code efficiency and maintainability without altering existing functionality.
2025-07-18 22:17:02 +01:00
Mervin Praison 6d717d59b1 Merge pull request #1013 from MervinPraison/claude/issue-1011-20250718-1758
fix: prevent PostHog shutdown errors during interpreter shutdown
2025-07-18 22:12:19 +01:00
github-actions[bot]andMervin Praison 07cc581c04 refactor: remove duplicate threading import in _is_interpreter_shutting_down method
- Remove redundant ''import threading'' since threading is already imported at module level
- Addresses reviewer feedback on code duplication
- Maintains all functionality while improving code cleanliness

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 20:59:52 +00:00
github-actions[bot]andMervin Praison 283282d98b refactor: improve telemetry shutdown error handling and reduce code duplication
- Add centralized _SHUTDOWN_ERROR_PHRASES constant for consistent error detection
- Create _is_shutdown_related_error() helper method to eliminate code duplication
- Remove duplicate import threading in _is_interpreter_shutting_down()
- Remove redundant _posthog = None assignment handled by finally block
- Ensure all shutdown error detection uses consistent phrase list

Addresses reviewer feedback on duplicate imports, inconsistent error handling,
and code duplication while maintaining full backward compatibility.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 20:54:58 +00:00
github-actions[bot]andMervin Praison c231d625c3 fix: prevent PostHog shutdown errors during interpreter shutdown
- Add interpreter shutdown detection using sys.is_finalizing() and thread tests
- Skip PostHog operations when interpreter is shutting down to prevent:
  - cannot schedule new futures after interpreter shutdown errors
  - can''t register atexit after shutdown errors
  - Event loop and threading errors during shutdown
- Enhanced error handling with specific shutdown error message filtering
- Apply shutdown prevention to flush, thread cleanup, and shutdown operations
- Maintain full backward compatibility with existing API
- Add comprehensive debug logging for shutdown scenarios

Fixes issue #1011 where PostHog telemetry was causing shutdown errors
when force_shutdown_telemetry() was called during interpreter shutdown.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 18:03:08 +00:00
Mervin Praison d1b4ab0d95 Merge pull request #1010 from MervinPraison/claude/issue-1009-20250718-1740
fix: prevent telemetry shutdown from hanging indefinitely
2025-07-18 18:56:25 +01:00
github-actions[bot]andMervin Praison c0d5eec2a7 fix: enhance telemetry shutdown robustness and prevent critical issues
- Add thread safety with shutdown locks to prevent concurrent shutdown calls
- Fix double thread pool shutdown issue that could cause undefined behavior
- Implement memory leak prevention with bounded metrics storage (max 1000 entries)
- Replace unsafe daemon threads with ThreadPoolExecutor for better control
- Increase flush timeout from 2s to 5s for improved reliability
- Add comprehensive error handling with proper logging levels
- Split shutdown logic into maintainable helper methods
- Maintain full backward compatibility with existing API

These changes address critical thread safety issues while preserving all
existing functionality and ensuring reliable telemetry shutdown behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 17:53:46 +00:00
github-actions[bot]andMervin Praison 94f7edaae4 fix: prevent telemetry shutdown from hanging indefinitely
- Added timeout-based flush operation in MinimalTelemetry.shutdown()
- Replaced blocking PostHog flush with threaded timeout approach
- Prevents indefinite blocking during program termination
- Maintains backward compatibility and data integrity
- Fixes issue where PostHog queue.join() would hang on exit

Resolves #1009

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 17:43:38 +00:00
Mervin Praison 6607b6279e refactor: streamline chat method by consolidating logging and error handling
- Simplified logging of parameters in debug mode for better clarity.
- Enhanced error handling during LLM calls and reflections to ensure robust rollback mechanisms.
- Improved structure for handling knowledge search and prompt normalization.
- Reduced code duplication by integrating common functionalities into streamlined processes.
2025-07-18 18:32:34 +01:00
Mervin Praison d1cf53c543 Merge pull request #998 from MervinPraison/claude/pr-996-20250718-1439
Fix: Correct indentation in chat method try-finally block
2025-07-18 18:22:55 +01:00
Mervin Praison 4dcc72a02b Merge branch 'main' into claude/pr-996-20250718-1439 2025-07-18 18:22:19 +01:00
Mervin Praison d2a70c45ab Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-18 18:11:56 +01:00
Mervin Praison a3cfaaabec refactor: reorganize test files into src directory and add telemetry cleanup 2025-07-18 18:11:06 +01:00
Mervin Praison 4743ba20be Merge pull request #1006 from MervinPraison/revert-1005-claude/pr-1002-20250718-1556
Revert "PR #1002: Changes from Claude"
2025-07-18 17:36:26 +01:00
Mervin Praison 81d4042578 Revert "PR #1002: Changes from Claude" 2025-07-18 17:36:18 +01:00
Mervin Praison 9a6b156b6e Merge pull request #1005 from MervinPraison/claude/pr-1002-20250718-1556
PR #1002: Changes from Claude
2025-07-18 17:35:55 +01:00
github-actions[bot]andMervin Praison fbbee806d1 Refactor telemetry cleanup to use try...finally pattern
- Replace 13 scattered _cleanup_telemetry() calls with single try...finally block
- Ensure cleanup happens on ALL exit paths regardless of success/failure
- Standardize test tolerances to 2 threads across all test files
- Improve test error messages to show specific thread details
- Maintain backward compatibility and all existing functionality
- Reduce code duplication by 95% in chat method

🤖 Generated with Claude Code

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 16:32:22 +00:00
Mervin Praison 2241ecbdde Merge pull request #1004 from MervinPraison/claude/issue-1003-20250718-1604
Fix: Agent.start() now auto-consumes generator for better UX
2025-07-18 17:14:00 +01:00
github-actions[bot]andMervin Praison 0501a85b9e Fix: Agent.start() now auto-consumes generator for better UX
- Modified Agent.start() method to automatically consume the generator by default
- Added return_generator=True parameter for backwards compatibility
- Made MCP import optional to prevent import errors
- Updated examples to demonstrate new behavior
- Fixes issue where basic-agents.py would stop without producing output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 16:13:19 +00:00
github-actions[bot]andMervin Praison c5c728e148 Fix: Enhance telemetry cleanup to prevent agent termination hang
- Added comprehensive telemetry cleanup calls in agent.py at all return points
- Ensures proper cleanup after guardrail validation failures
- Prevents hanging during agent termination by forcing telemetry shutdown
- Added test files to validate telemetry cleanup functionality
- Addresses hanging issues in async agent execution flows

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2025-07-18 16:04:37 +00:00
Mervin Praison 6d4c1d71fb Merge pull request #1002 from MervinPraison/claude/pr-999-20250718-1529
Fix: Add comprehensive telemetry cleanup to prevent agent termination hang
2025-07-18 16:47:38 +01:00
Mervin Praison 31435c454f Merge pull request #1001 from MervinPraison/claude/pr-997-20250718-1454
Fix: Add telemetry cleanup to execute() and aexecute() methods to prevent hanging
2025-07-18 16:46:47 +01:00
github-actions[bot]andMervin Praison 00e722aae1 Fix: Add comprehensive telemetry cleanup to prevent agent termination hang
- Fixed 7 missing telemetry cleanup calls in agent.py
- Added cleanup to all return paths in chat() and achat() methods
- Added cleanup to custom LLM guardrail validation paths
- Added cleanup to reasoning content validation paths
- Added cleanup to exception handlers in achat() method
- Ensures proper termination of telemetry threads
- Prevents hanging after agent task completion
- Maintains full backward compatibility
- Comprehensive testing shows all agents now terminate properly

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 15:40:17 +00:00
Mervin Praison 76a65b3667 Merge pull request #1000 from MervinPraison/claude/fix-telemetry-termination-20250718
Fix: Comprehensive telemetry cleanup to prevent agent termination hang
2025-07-18 16:30:42 +01:00
github-actions[bot]andMervin Praison cd5459d4dc Fix: Comprehensive telemetry cleanup to prevent agent termination hang
This commit addresses the critical issue where PraisonAI agents would not
terminate properly after completing their tasks, requiring manual interruption.

Root Cause: PostHog telemetry client running in async mode creates
background threads that persist after standard shutdown() calls.

Solution:
- Enhanced telemetry shutdown mechanism with comprehensive thread cleanup
- Added force_shutdown_telemetry() function for robust cleanup
- Implemented timeout-based thread termination with proper error handling
- Updated agent._cleanup_telemetry() to use the new robust cleanup method

Impact:
- Agents now terminate cleanly without hanging
- Maintains full backward compatibility
- Comprehensive thread cleanup prevents resource leaks
- Timeout mechanism prevents infinite waiting

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 15:27:44 +00:00
Mervin Praison 326390863f Merge pull request #999 from MervinPraison/claude/issue-987-20250718-1504
Fix: Resolve agent termination issue by adding comprehensive telemetry cleanup
2025-07-18 16:18:33 +01:00
github-actions[bot]andMervin Praison d1e6706427 Fix: Resolve agent termination issue by adding comprehensive telemetry cleanup
- Added _cleanup_telemetry() calls to all return paths in chat() and achat() methods
- Ensures proper program termination without requiring Ctrl+C
- Maintains full backward compatibility with existing APIs
- Addresses syntax error concerns by implementing clean, error-free code
- Added test script to verify the fix works correctly

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 15:16:38 +00:00
github-actions[bot]andMervin Praison 7f0f8d5ed9 Fix: Add telemetry cleanup to execute() and aexecute() methods to prevent hanging
- Add try-finally blocks to execute() and aexecute() methods
- Ensures telemetry cleanup happens for all public entry points
- Prevents programs from hanging due to PostHog background threads
- Maintains backward compatibility
- Addresses critical gaps identified in PR reviews

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 14:57:09 +00:00
github-actions[bot]andMervin Praison 556d1298f1 Fix: Correct indentation in chat method try-finally block
- Fixed syntax error at line 1197 where code was outside try block
- Properly indented all main logic to be inside try block
- Ensures telemetry cleanup finally block executes correctly
- Maintains backward compatibility
- No breaking changes

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 14:49:41 +00:00
Mervin Praison 48acfce433 Merge pull request #994 from MervinPraison/claude/issue-992-20250718-1345
feat: integrate MongoDB as memory and knowledge provider
2025-07-18 15:44:44 +01:00
Mervin Praison 1ddcafbaa4 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-18 15:43:11 +01:00
Mervin Praison eb2073fe77 Enhance workflow configurations by adding a timeout of 15 minutes to all job definitions in the CI/CD pipeline. This change aims to improve resource management and prevent long-running jobs from hanging indefinitely. 2025-07-18 15:43:10 +01:00
Mervin Praison 732e4e6c75 Merge pull request #997 from MervinPraison/revert-996-claude/pr-990-20250718-1429
Revert "Fix: Comprehensive telemetry cleanup to prevent agent termination issues"
2025-07-18 15:39:49 +01:00
Mervin Praison 7f01facb36 Revert "Fix: Comprehensive telemetry cleanup to prevent agent termination issues" 2025-07-18 15:39:39 +01:00
Mervin Praison b2cc7ebfd9 Merge pull request #996 from MervinPraison/claude/pr-990-20250718-1429
Fix: Comprehensive telemetry cleanup to prevent agent termination issues
2025-07-18 15:38:31 +01:00
github-actions[bot]andMervin Praison 3c51b6f644 Fix: Comprehensive telemetry cleanup to prevent agent termination issues
- Added telemetry cleanup to all agent entry points (chat, achat, execute, aexecute)
- Fixed streaming issue by adding cleanup to _start_stream method
- Removed duplicate cleanup from convenience methods
- Ensures proper program termination regardless of which method is used

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 14:36:46 +00:00
Mervin Praison 44f02cdf43 Merge pull request #990 from MervinPraison/claude/issue-987-20250718-1031
Fix: Resolve agent termination issue by properly cleaning up telemetry system
2025-07-18 15:24:30 +01:00
Mervin Praison 55668c9510 Merge branch 'main' into claude/issue-987-20250718-1031 2025-07-18 15:24:03 +01:00
github-actions[bot]andMervin Praison 28e95388f9 fix: resolve MongoDB integration issues
- Fix ID generation consistency between MongoDB and SQLite storage
- Fix inconsistent error handling in memory operations
- Fix security issue with hardcoded API key placeholders in examples
- Fix unused imports in mongodb_tools.py
- Fix pymongo version to >= 4.6.3 to address security vulnerabilities
- Improve datetime import organization
- Ensure consistent storage order for better reliability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 14:18:53 +00:00
github-actions[bot]andMervin Praison 663150a0ee fix: resolve MongoDB integration issues
- Fix memory record citation duplication (lines 861, 880, 933 in memory.py)
- Make vector dimensions configurable based on embedding model
- Add _get_embedding_dimensions method for proper dimension detection
- Support multiple embedding models (text-embedding-3-small, 3-large, ada-002)
- Improve citation format to use record IDs instead of duplicating text

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 14:13:14 +00:00
github-actions[bot]andMervin Praison 225ce7b9f2 feat: integrate MongoDB as memory and knowledge provider
Add comprehensive MongoDB integration for PraisonAI agents including:

**Memory Provider**:
- MongoDB as persistent memory storage option
- Vector search capabilities with Atlas Vector Search
- Support for both key-value and vector operations
- Quality scoring and filtering
- User-specific memory isolation
- Graceful fallback to existing SQLite/ChromaDB

**Knowledge Store**:
- MongoDB as vector store for knowledge base
- Document processing with embeddings
- Vector similarity search for knowledge retrieval
- Chunking and metadata management
- Compatible with existing Mem0/ChromaDB workflow

**Tools Integration**:
- Complete MongoDB tools suite (CRUD operations)
- Vector search and text search capabilities
- Collection management and indexing
- Production-ready connection handling
- Error handling and logging

**Examples**:
- Memory provider example with persistent storage
- Knowledge store example with vector search
- Tools integration example with database operations
- Comprehensive business scenario simulation
- Complete documentation and best practices

**Technical Details**:
- Optional dependency: pip install ''praisonaiagents[mongodb]''
- Backward compatibility maintained
- Supports both local MongoDB and Atlas
- Configurable connection pooling and timeouts
- Comprehensive error handling

Resolves #992

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2025-07-18 14:02:34 +00:00
Mervin Praison b2cacb243f Merge pull request #991 from MervinPraison/claude/issue-981-20250718-1032
fix: implement real-time streaming for Agent.start() method
2025-07-18 15:01:30 +01:00
github-actions[bot]andMervin Praison 9e25572c84 fix: resolve critical issues in streaming implementation
- Fix chat_history_length initialization bug in both streaming methods
- Add safe array access checks for chunk.choices in OpenAI client
- Add JSON parsing error handling for malformed tool arguments
- Remove unused imports and variables
- Update test files to use mock LLM instead of real APIs
- Ensure robust error handling throughout streaming pipeline

These fixes address all critical issues identified by code review bots
while maintaining backward compatibility and streaming functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 13:53:45 +00:00
Mervin Praison 801aedc00a Merge pull request #989 from MervinPraison/claude/issue-988-20250718-1318
fix: Add tool usage time tracking to MCP execution
2025-07-18 14:50:48 +01:00
github-actions[bot]andMervin Praison f18103f66b fix: Add thread safety and fix initialization timeout bug in tool timing
- Add thread locks to MCPToolRunner._tool_timings and MinimalTelemetry._metrics
- Fix initialization timeout bug where telemetry tracking was bypassed
- Move timing measurement after initialization check for accuracy
- Ensure telemetry is captured for all tool execution outcomes

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 13:48:22 +00:00
Mervin Praison a75745729b Merge pull request #986 from MervinPraison/claude/issue-985-20250717-1851
fix: resolve vertex_ai parameter compatibility issue for image generation
2025-07-18 14:29:00 +01:00
github-actions[bot]andMervin Praison 2bc61a1d55 fix: Add tool usage time tracking to MCP execution
- Enhanced telemetry.track_tool_usage() to accept execution_time parameter
- Added timing instrumentation to MCPToolRunner.call_tool() method
- Tool usage timing is now captured and stored in telemetry metrics
- Maintains backward compatibility with no breaking changes
- Addresses issue #988 where tool usage time was always 0

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 13:24:36 +00:00
github-actions[bot]andMervin Praison a3877c34e5 improve: enhance image agent parameter filtering robustness
- Replace overly broad exception handling with specific exceptions
- Consolidate duplicated gemini parameter filtering logic
- Add debug logging for provider detection failures
- Improve code readability with better variable separation
- Maintain backward compatibility and safety mechanisms

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 10:42:15 +00:00
github-actions[bot]andMervin Praison ff1022bdb6 fix: implement real-time streaming for Agent.start() method
- Add streaming generator support to Agent.start() method
- Implement _start_stream() method for streaming logic
- Add _chat_stream() method to route streaming to appropriate handlers
- Add _custom_llm_stream() for custom LLM streaming support
- Add _openai_stream() for OpenAI client streaming support
- Add chat_completion_with_tools_stream() method to OpenAI client
- Maintain backward compatibility for existing code
- Add proper error handling and chat history management

Fixes #981

Co-authored-by: Mervin Praison <[email protected]>
2025-07-18 10:40:49 +00:00
github-actions[bot]andClaude 22e9904aef fix: resolve agent termination issue by properly cleaning up telemetry system
- Add proper cleanup in Agent.start() and Agent.astart() methods using try-finally blocks
- Implement _cleanup_telemetry() method to ensure telemetry system shutdown
- Prevent hanging after agent execution by properly shutting down background threads
- Add test files to verify the termination fix works correctly

Fixes #987

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-18 10:36:19 +00:00
Mervin Praison e5b7f7b740 Merge pull request #983 from Dhivya-Bharathy/models-providers-reorganization
feat: Add comprehensive provider examples for all major LiteLLM providers with clean API structure
2025-07-18 11:30:39 +01:00
github-actions[bot]andMervin Praison 3a137fb71e fix: resolve vertex_ai parameter compatibility issue for image generation
- Add provider-aware parameter filtering for image generation
- Filter out unsupported ''style'' parameter for vertex_ai models
- Maintain backward compatibility for other providers (OpenAI, Gemini)
- Add drop_params=True safety mechanism
- Resolves litellm.UnsupportedParamsError for gemini-2.0-flash-preview-image-generation

Co-authored-by: Mervin Praison <[email protected]>
2025-07-17 19:01:41 +00:00
Dhivya-Bharathy 8e09f5e4b4 Add comprehensive model examples with 5 agents per model: Llama, Claude, GPT 2025-07-17 13:46:49 +05:30
Dhivya-Bharathy 82e6673488 Add 3 more provider examples: Moonshot AI, Databricks, AI21 2025-07-17 13:17:30 +05:30
Dhivya-Bharathy dd9b24597a Add comprehensive provider examples for all major LiteLLM providers 2025-07-17 13:01:08 +05:30
Mervin Praison dbd6062edf chore: bump praisonai to v2.2.70 and praisonaiagents to v0.0.142 across all files 2025-07-17 01:31:56 +01:00
Mervin Praison 7fc615ff70 Merge pull request #974 from MervinPraison/claude/pr-965-20250716-2356
fix: make TelemetryCollector.stop() consistent with shutdown behavior
2025-07-17 01:24:26 +01:00
Mervin Praison fabac466f9 Merge pull request #966 from MervinPraison/claude/issue-964-20250716-2340
fix: improve Ollama sequential tool execution to prevent redundant calls
2025-07-17 01:22:11 +01:00
github-actions[bot]andMervin Praison 8d98f27f9c fix: correct Ollama early stopping logic placement for sequential tool execution
Fixes critical issues identified in PR review:
- Move early stopping logic from inside ''if tool_calls:'' block to ''else:'' block
- Fix logic placement in both sync and async execution paths
- Remove unreachable code in _generate_ollama_tool_summary()
- Ensure early stopping triggers correctly when Ollama returns empty responses after tool execution

This ensures the fix properly handles the Ollama edge case where it returns
empty responses after successful tool execution, preventing infinite loops
while allowing proper sequential tool calls.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-17 00:02:48 +00:00
github-actions[bot]andMervin Praison cf0af4999d fix: make TelemetryCollector.stop() consistent with shutdown behavior
Ensures TelemetryCollector.stop() calls shutdown() instead of just flush()
for consistency with the main atexit handler and proper PostHog session cleanup.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-17 00:01:42 +00:00
github-actions[bot]andMervin Praison f6ecd3b4db fix: improve Ollama early stopping logic to allow proper sequential tool execution
- Only trigger early stopping when no new tool calls are present in current response
- Prevents premature termination during sequential tool calls like get_stock_price -> multiply
- Maintains backward compatibility while fixing issue #964
- Applied to both sync and async execution paths

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:56:48 +00:00
Mervin Praison a348d186c3 Merge pull request #965 from MervinPraison/claude/issue-963-20250716-2334
fix: properly shutdown telemetry aiohttp sessions to prevent ImportError during Python shutdown
2025-07-17 00:54:16 +01:00
Mervin Praison 30c0f2458f Merge pull request #961 from MervinPraison/claude/issue-958-20250716-2304
fix: ensure consistent Task/Response formatting across all LLM providers
2025-07-17 00:53:53 +01:00
Mervin Praison 668d61344f Merge branch 'main' into claude/issue-958-20250716-2304 2025-07-17 00:47:55 +01:00
github-actions[bot]andMervin Praison e8e9625f22 fix: improve Ollama sequential tool execution to prevent redundant calls
- Add early stopping logic for Ollama after first successful tool execution
- Enhance tool summary generation to create more natural, OpenAI-like responses
- Apply fix to both sync and async execution paths
- Prevent multiple tool calls when execution is complete
- Maintains full backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:47:43 +00:00
Mervin Praison cc721ba0db feat: upgrade praisonai to v2.2.69 and add realtime streaming support 2025-07-17 00:45:38 +01:00
Mervin Praison 07a30ab33d Merge pull request #962 from MervinPraison/claude/issue-956-20250716-2316
fix: enable real-time streaming regardless of verbose setting
2025-07-17 00:41:34 +01:00
github-actions[bot]andMervin Praison 92978fdb1c fix: properly shutdown telemetry aiohttp sessions to prevent ImportError during Python shutdown
- Change atexit handler from flush() to shutdown() in telemetry/__init__.py
- This ensures PostHog aiohttp sessions are properly closed before Python shutdown
- Prevents ''ImportError: sys.meta_path is None, Python is likely shutting down'' error
- Maintains backward compatibility with existing functionality

Fixes #963

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:40:40 +00:00
github-actions[bot]andMervin Praison 15a307dd4e fix: complete streaming fix for all LLM providers and improve console handling
- Fix custom LLM streaming (Gemini/Vertex AI) in llm.py by removing verbose condition
- Improve console parameter consistency when streaming is enabled
- Ensures streaming works for stream=True regardless of verbose setting
- Maintains full backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:38:27 +00:00
Mervin Praison 053ad043b8 Merge pull request #960 from MervinPraison/claude/issue-940-20250716-2252
fix: accumulate tool results across iterations in Ollama sequential execution
2025-07-17 00:35:49 +01:00
github-actions[bot]andMervin Praison 6e664995e8 fix: add missing flag reset in async achat method for consistent display behavior
- Added _final_display_shown = False reset in achat() method to match chat() method
- Ensures proper display flag management for both sync and async agent interactions
- Maintains consistency across all agent conversation entry points

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:32:12 +00:00
github-actions[bot]andMervin Praison ccb1bccf0f chore: remove unused custom_display_fn from agent.py
- Removed unused custom_display_fn function that was defined but never called
- Cleanup after streaming fix to avoid confusion
- No functional changes, streaming fix remains intact

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:31:38 +00:00
Mervin Praison 94c8fc21e6 Merge pull request #959 from MervinPraison/claude/issue-947-20250716-2244
fix: resolve task_name undefined error in async execution
2025-07-17 00:29:30 +01:00
github-actions[bot]andMervin Praison 48575b4ee0 fix: ensure callback execution in all achat() paths
- Enhanced _chat_completion method signature to accept task metadata parameters
- Updated all calls to _chat_completion to pass task context
- Fixed NameError where task_name, task_description, task_id were undefined
- Updated _apply_guardrail_with_retry to propagate task metadata
- Ensures complete task metadata propagation in sync chat execution path

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:28:05 +00:00
github-actions[bot]andMervin Praison 2ce7136d0c refactor: improve Ollama sequential fix with better test and deduplication
- Enhanced test file with comprehensive behavioral validation
- Added proper module import handling and mock-based testing
- Extracted duplicated logic into _handle_ollama_sequential_logic helper
- Eliminated 18-line code duplication between sync and async methods
- Improved maintainability while preserving backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:27:36 +00:00
github-actions[bot]andMervin Praison 3bea2ffb10 fix: enable real-time streaming regardless of verbose setting
- Remove dependency on verbose=True for streaming display function
- Allow stream=True to work with verbose=False for real-time output
- Maintain backward compatibility with existing verbose=True usage
- Fixes issue where Gemini/Google Vertex AI streaming was buffered

Resolves #956

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:22:35 +00:00
Mervin Praison fcbd915a0e docs: move star history section above feature roadmap for better visibility 2025-07-17 00:21:52 +01:00
github-actions[bot]andMervin Praison ae7eb29684 fix: ensure callback execution in all achat() paths
Adds missing callback execution to tool-based responses and JSON/Pydantic
output paths in the achat() method to ensure consistent task metadata
propagation across all execution flows.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:19:57 +00:00
Mervin Praison c5ec1ffea0 refactor: move test files to src/praisonai-agents directory for better organization 2025-07-17 00:19:56 +01:00
Mervin Praison aad5f286e2 chore: bump PraisonAI to v2.2.68 and PraisonAI Agents to v0.0.140 2025-07-17 00:19:32 +01:00
github-actions[bot]andMervin Praison 1aa20de337 fix: ensure consistent Task/Response formatting across all LLM providers
- Modified display condition to show formatted output for both OpenAI and custom LLM providers (like Gemini)
- Added _final_display_shown flag to prevent duplicate displays within same execution
- Reset flag at start of each chat() call for new conversations
- Maintains backward compatibility and existing verbose control behavior

Fixes #958

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:15:08 +00:00
Mervin Praison 3bc185d15d Merge pull request #957 from MervinPraison/claude/comprehensive-task-name-fix-20250716
fix: comprehensive task_name undefined error resolution
2025-07-17 00:14:20 +01:00
github-actions[bot]andMervin Praison 6b8a7110f2 refactor: simplify redundant hasattr checks and fix test formatting
- Remove redundant hasattr checks in agent.py as getattr handles missing attributes
- Fix unnecessary f-string prefixes in test file
- Remove unused variable assignment in test

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:08:04 +00:00
Mervin Praison 5ab0f245c5 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-17 00:03:23 +01:00
Mervin Praison 5baa3f9b96 fix: update LLM model in Ollama sequential agent from qwen3 to llama3.2 for improved performance 2025-07-17 00:03:04 +01:00
github-actions[bot]andMervin Praison 28c6d026f7 fix: resolve task_name undefined error in async execution
Addresses issue #947 where task_name undefined errors occurred during async parallel task execution.

Key Changes:
- Enhanced Agent.achat() method to accept task context parameters (task_name, task_description, task_id)
- Updated aexecute_task() to pass task metadata when calling agent.achat()
- Added callback execution to both async execution paths in achat() method
- Updated callback system to properly propagate task context

Root Cause: Async execution path was missing task metadata propagation to LLM callbacks.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 23:00:34 +00:00
github-actions[bot]andMervin Praison 802716e5ec fix: comprehensive task_name undefined error resolution
- Add task_name, task_description, task_id parameters to achat method signature
- Update all achat call sites in agents.py to pass task parameters where available
- Provide fallback None values for API handler contexts without task context
- Fix Agent.aexecute to extract task info when available
- Resolves NameError: name ''task_name'' is not defined in parallel agent execution

Fixes persistent errors in agentic parallelization workflows where callbacks
expect task context parameters but they were not being passed correctly through
the async execution chain.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 22:58:16 +00:00
github-actions[bot]andMervin Praison 9eaa2731da fix: accumulate tool results across iterations in Ollama sequential execution
- After successful tool execution, give Ollama LLM explicit prompt for final answer
- Only generate tool summary if LLM fails to respond to explicit prompt
- Prevents premature tool summary generation after sequential execution
- Applied to both sync and async tool execution loops
- Preserves infinite loop prevention while enabling natural responses

Fixes #940

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 22:56:02 +00:00
Mervin Praison 0d3e1632a3 Merge pull request #949 from Dhivya-Bharathy/models-providers-reorganization
Reorganize models and providers structure with comprehensive examples
2025-07-16 23:45:08 +01:00
Mervin Praison da14b1d8e9 Merge pull request #955 from MervinPraison/claude/pr-953-20250716-1258
fix: resolve Ollama infinite loop issue with minimal changes
2025-07-16 16:02:48 +01:00
Mervin Praison c0679f4528 Merge pull request #954 from MervinPraison/claude/issue-940-20250716-1247
fix: prevent premature termination in Ollama sequential tool execution
2025-07-16 15:18:42 +01:00
github-actions[bot]andMervin Praison 930555d921 fix: accumulate tool results across iterations in Ollama sequential execution
- Replace hardcoded iteration threshold (3) with class constant OLLAMA_SUMMARY_ITERATION_THRESHOLD
- Add proper constant definition for better maintainability and readability
- Applied consistently to both sync and async methods
- Addresses reviewer feedback about magic numbers
- Ensures proper tool result accumulation across iterations

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 13:24:35 +00:00
Mervin Praison 859fb6a263 chore: bump praisonai to v2.2.67 and praisonaiagents to v0.0.138 across all files 2025-07-16 14:16:30 +01:00
github-actions[bot]andMervin Praison f154dba804 fix: accumulate tool results across iterations in Ollama sequential execution
- Add accumulated_tool_results list to store tool results across all iterations
- Prevents loss of tool execution history when generating summaries
- Applied to both sync (get_response) and async (get_response_async) methods
- Maintains backward compatibility with existing functionality
- Fixes issue where only current iteration''s tool results were available to summary generation

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 13:15:14 +00:00
Mervin Praison fb2a16126f Merge pull request #952 from MervinPraison/claude/issue-947-20250716-1205
fix: resolve task_name undefined error in LLM callback execution
2025-07-16 14:14:52 +01:00
Mervin Praison 77ab361d64 refactor: reorganize test files and update package versions to 2.2.66 2025-07-16 14:12:45 +01:00
Mervin Praison a276a610a0 Merge pull request #951 from MervinPraison/claude/issue-950-20250716-1207
feat: Enable imports from PraisonAI package for issue #950
2025-07-16 14:08:34 +01:00
github-actions[bot] ddb547f6a5 cleanup: remove debug test files 2025-07-16 13:08:03 +00:00
github-actions[bot]andMervin Praison 24437b40d9 fix: resolve Ollama infinite loop issue with minimal changes
- Remove redundant length check in _generate_ollama_tool_summary
- Simplify verbose conditional checks in both sync and async methods
- Add safety checks to prevent infinite loops after 5 iterations
- Maintain backward compatibility with other LLM providers
- Add comprehensive test suite to validate fixes

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 13:07:39 +00:00
Dhivya-Bharathy 582049f759 Update model examples to use new clean format with praisonaiagents.Agent 2025-07-16 18:32:35 +05:30
github-actions[bot]andMervin Praison e8f4eff173 refactor: Use dynamic approach for praisonaiagents imports
- Replace manual symbol list with dynamic import using
- Use  for automatic maintenance
- Remove manual tracking of imported symbols
- Reduce code from 49 to 17 lines
- Future-proof: automatically inherits new exports from praisonaiagents

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:56:29 +00:00
github-actions[bot]andMervin Praison e1b93000be fix: prevent premature termination in Ollama sequential tool execution
- Modified tool execution logic to allow at least 3 iterations before triggering summary generation
- This prevents Ollama from prematurely terminating when sequential tool calls are needed
- Applied fix to both conversation() and reasoning() methods in LLM class
- Resolves issue where Ollama would generate tool summaries too early, blocking proper tool chaining

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
2025-07-16 12:51:13 +00:00
Mervin Praison 464cc128db Merge pull request #953 from MervinPraison/revert-945-claude/issue-940-20250716-0711
Revert "fix: prevent premature termination in Ollama sequential tool execution"
2025-07-16 13:46:12 +01:00
Mervin Praison f44bb7fa39 Revert "fix: prevent premature termination in Ollama sequential tool execution" 2025-07-16 13:46:01 +01:00
Mervin Praison 5b70f4b34d Merge pull request #945 from MervinPraison/claude/issue-940-20250716-0711
fix: prevent premature termination in Ollama sequential tool execution
2025-07-16 13:45:16 +01:00
github-actions[bot]andMervin Praison 5514f17346 fix: Resolve unconditional __all__ list issue causing import errors
- Fixed critical bug where __all__ list included symbols from praisonaiagents
  even when import failed due to missing dependencies
- Implemented dynamic __all__ construction based on successfully imported symbols
- Maintained backward compatibility while fixing the cursor review issue
- Added comprehensive test files to verify fix and backward compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:38:33 +00:00
github-actions[bot]andMervin Praison 318ececfb4 fix: correct function name in test_fix_verification.py
- Fixed unused variable 'results' in test_fix_verification.py
- Maintained test functionality while removing static analysis warning

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:35:26 +00:00
github-actions[bot]andMervin Praison 83afc0891f fix: correct function name in test_fix_verification.py
- Changed register_callback to register_display_callback
- Ensures test runs correctly and validates the fix

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:29:42 +00:00
github-actions[bot]andMervin Praison 8e7323c484 refactor: replace hardcoded patterns with dynamic tool usage detection
- Replace hardcoded acknowledgment_patterns and status_patterns with intelligent context analysis
- Implement _analyze_tool_chain_context() for dynamic tool execution pattern detection
- Add _assess_response_quality() for content-based response evaluation
- Replace iteration_count >= 5 threshold with _should_generate_tool_summary() dynamic logic
- Improve tool chain completion detection with confidence scoring
- Increase safety fallback threshold from 5 to 7 iterations
- Maintain backward compatibility with existing providers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:28:18 +00:00
Dhivya-Bharathy 8dd6494a59 Update all provider examples to use new clean format with praisonaiagents.Agent 2025-07-16 17:54:50 +05:30
github-actions[bot]andMervin Praison 857238a82a fix: resolve task_name undefined error in LLM callback execution
- Fixed 6 direct execute_sync_callback calls missing task-related parameters
- Added agent_name, agent_role, agent_tools, task_name, task_description, task_id
- Ensures consistent callback parameter passing between verbose and non-verbose modes
- Prevents infinite loop errors when callbacks expect task_name parameter
- Maintains backward compatibility with existing functionality

Fixes #947

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:21:27 +00:00
github-actions[bot]andMervin Praison 658a2397fc feat: Enable imports from PraisonAI package for issue #950
This change allows users to import from the main PraisonAI package instead of
just from praisonaiagents, while maintaining full backward compatibility.

Changes:
- Modified src/praisonai/praisonai/__init__.py to re-export all classes from praisonaiagents
- Added comprehensive __all__ list for proper exports
- Maintained backward compatibility - all existing imports continue to work

New usage patterns now supported:
- from praisonai import Agent, Task, PraisonAIAgents
- from praisonai import Tools, Memory, Knowledge, etc.

Backward compatibility maintained:
- from praisonaiagents import Agent, Task, PraisonAIAgents (still works)

Tests added:
- test_import_conversion.py: Comprehensive test suite
- test_issue_950.py: Specific test for the issue requirements

Resolves #950

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 12:14:45 +00:00
Dhivya-Bharathy 1ab09fa259 Reorganize models and providers structure - Move Kimi2 agents to models/kimi with kimi_ prefix - Move Grok4 agents to models/grok with grok_ prefix - Create 10 new Groq agents in models/groq with groq_ prefix - Add provider examples for OpenAI, Anthropic, Google, DeepSeek, Mistral, Cohere, xAI - Remove README files as requested 2025-07-16 16:35:00 +05:30
Dhivya-Bharathy f7f4a6c0bf Add 10 new agents to Kimi2_Intelligent_Agents (aerospace, bioinformatics, blockchain, energy, IoT, metaverse, nanotechnology, quantum AI, quantum computing, robotics) 2025-07-16 15:02:46 +05:30
github-actions[bot]andMervin Praison a743f4b68c fix: prevent premature termination in Ollama sequential tool execution
- Added iteration count threshold (>=5) before generating Ollama tool summary
- Prevents premature termination after first tool call in sequential execution
- Maintains infinite loop prevention for truly stuck scenarios
- Applied fix to both sync and async methods in llm.py
- Preserves backward compatibility with other LLM providers

Fixes issue where Ollama would terminate after first tool call instead of
continuing with sequential execution (e.g., get_stock_price -> multiply)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-16 07:28:09 +00:00
Mervin Praison 77b7c3b1ce Merge pull request #944 from MervinPraison/claude/fix-ollama-response-overwrite-20250715-2344
fix: prevent Ollama tool summary from being overwritten by empty response
2025-07-16 01:08:51 +01:00
Mervin Praison 48c65a742c Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-16 00:56:06 +01:00
Mervin Praison 35295ad167 refactor: move test files to src/praisonai-agents directory 2025-07-16 00:56:05 +01:00
Mervin Praison 1a6078d7eb Delete test_ollama_response_fix.py 2025-07-16 00:50:14 +01:00
github-actions[bot]andMervin Praison fbd4c53796 fix: prevent Ollama tool summary from being overwritten by empty response
- Add condition to check if final_response_text is already set before overwriting
- Fix applies to both sync (get_response) and async (get_response_async) methods
- Prevents tool summary from being lost when Ollama returns empty response after tool execution
- Maintains backward compatibility for non-Ollama providers
- Resolves issue where agent.start() returns None despite successful tool execution

Fixes the remaining issue from PR #943 where tool summary was generated but overwritten

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 23:48:51 +00:00
Mervin Praison 55e70d521e Merge pull request #942 from MervinPraison/claude/issue-939-20250715-2248
feat: Add 7 comprehensive examples for advanced PraisonAI agent features
2025-07-16 00:47:52 +01:00
github-actions[bot]andMervin Praison d4023c0484 feat: Organize advanced examples into appropriate folders
- Move callback systems to general/
- Move memory examples to memory/
- Move state management to stateful/
- Move hierarchical agents to agents/
- Move guardrails to guardrails/
- Move self-reflection to concepts/

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 23:46:29 +00:00
Mervin Praison d88200e258 Merge pull request #943 from MervinPraison/claude/issue-940-20250715-2304
fix: Resolve Ollama infinite tool call loops by improving response handling
2025-07-16 00:35:29 +01:00
github-actions[bot]andMervin Praison beac0b47a2 refactor: eliminate code duplication and improve test quality in Ollama fix
- Extract duplicated Ollama tool summary logic into _generate_ollama_tool_summary() helper method
- Replace magic number 10 with OLLAMA_MIN_RESPONSE_LENGTH constant
- Fix test_tool_summary_generation() to call production code instead of reimplementing logic
- Add comprehensive test scenarios for different response types and provider types
- Maintain backward compatibility and fix functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 23:26:15 +00:00
github-actions[bot]andClaude 6d6c44e7ca fix: Convert advanced examples to flat format with minimal code
Simplified all 7 advanced examples to follow flat format requirements:
- Removed 20+ custom classes across all examples
- Reduced total lines from 2,829 to 514 (82% reduction)
- Limited to 1-2 agents max per example
- Focused on core functionality demonstration
- Maintained advanced feature examples while making them accessible

Changes per file:
- advanced-callback-systems.py: 404→59 lines, removed 3 classes
- advanced-graph-memory-integration.py: 226→75 lines, reduced to 1 agent
- advanced-memory-search-optimization.py: 568→76 lines, removed 4 classes
- advanced-state-management-patterns.py: 437→80 lines, removed 3 classes
- autoagents-hierarchical-generation.py: 158→73 lines, removed custom class
- production-guardrails-patterns.py: 480→65 lines, removed 5 classes
- self-reflection-optimization-patterns.py: 556→46 lines, removed 4 classes

All examples now follow the established flat format pattern with simple,
direct agent/task creation and minimal code complexity.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
2025-07-15 23:22:16 +00:00
Mervin Praison 1cd838f691 chore: bump praisonai version to 2.2.65 and add autogen-v4 dependencies 2025-07-16 00:12:42 +01:00
Mervin Praison 319944e012 Merge pull request #941 from MervinPraison/claude/issue-938-20250715-2246
fix: Ensure agent names are valid Python identifiers for AutoGen v0.4
2025-07-16 00:10:52 +01:00
github-actions[bot]andMervin Praison b53162aa9e fix: Improve sanitization to preserve double underscores
- Fixed aggressive underscore collapsing that broke dunder names like __init__
- Now only collapses 5+ consecutive underscores instead of any consecutive underscores
- Preserves trailing underscores in double underscore patterns (__name__)
- Handles edge case where purely invalid characters become single underscore
- All 15 test cases now pass including magic method names
- Maintains backward compatibility for AutoGen v0.2, CrewAI, PraisonAI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 23:09:41 +00:00
github-actions[bot]andClaude 7d42e31e0a feat: Add comprehensive examples for advanced PraisonAI agent features
Added 7 new example files demonstrating advanced functionality:
- autoagents-hierarchical-generation.py: Hierarchical agent generation patterns
- advanced-graph-memory-integration.py: Graph-based memory systems
- advanced-callback-systems.py: Custom callback implementations
- production-guardrails-patterns.py: Production safety and guardrails
- advanced-state-management-patterns.py: Complex state handling
- advanced-memory-search-optimization.py: Memory search optimizations
- self-reflection-optimization-patterns.py: Self-improvement patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-15 23:09:07 +00:00
github-actions[bot]andMervin Praison 9c96a838a8 fix: Resolve Ollama infinite tool call loops by improving response handling
- Add special handling for Ollama models in both sync and async tool execution loops
- When Ollama returns empty/minimal response after tool execution, generate summary from tool results
- Prevents infinite loops while maintaining functionality for other LLM providers
- Add comprehensive test suite to validate fix and ensure backward compatibility
- Fixes issue where Ollama models would repeat tool calls indefinitely

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 23:08:01 +00:00
github-actions[bot]andMervin Praison 52c249fde0 fix: Ensure agent names are valid Python identifiers for AutoGen v0.4
AutoGen v0.4 requires agent names to be valid Python identifiers,
but role names like ''Narrative Designer'' contain spaces which are invalid.

- Added sanitize_agent_name_for_autogen_v4() function to convert any
  string to a valid Python identifier
- Applied sanitization only in AutoGen v0.4 code path for backward compatibility
- AutoGen v0.2 and other frameworks remain unchanged
- Handles spaces, special characters, Python keywords, and edge cases

Resolves issue where ''Narrative Designer'' role causes error:
''The agent name must be a valid Python identifier''

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 22:51:54 +00:00
Mervin Praison 7607df753f Merge pull request #937 from MervinPraison/claude/issue-934-20250715_165720
fix: Replace deprecated Pydantic .dict() with .model_dump() in example files
2025-07-15 22:04:30 +01:00
Mervin Praison 8fa181bc55 Merge pull request #936 from MervinPraison/claude/issue-935-20250715_170032
feat: Add AutoGen v0.4 support with backward compatibility
2025-07-15 22:03:55 +01:00
github-actions[bot]andMervin Praison ccbf0ebebb fix: Ensure backward compatibility for Pydantic v1/v2 in hasattr checks
- Fix inconsistent hasattr checks in ZeroScript_AI_TestExecutor.ipynb
- Update fix_notebook.py to handle both method call and hasattr replacement
- Add comprehensive backward compatibility test suite
- Ensure Pydantic v1 models fallback to str() when model_dump() unavailable

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 17:19:41 +00:00
Mervin Praison d3f0c217ca feat: update default model from gpt-4o to gpt-4o-mini and bump version to 2.2.64 2025-07-15 18:09:57 +01:00
github-actions[bot]andMervin Praison 6995a446e1 feat: Add AutoGen v0.4 support with backward compatibility
- Add optional dependency ''autogen-v4'' with autogen-agentchat>=0.4.0, autogen-ext[openai]>=0.4.0, autogen-core>=0.4.0
- Implement async _run_autogen_v4() method with RoundRobinGroupChat for parallel multi-agent execution
- Add AUTOGEN_VERSION environment variable for version control (auto/v0.2/v0.4)
- Maintain full backward compatibility with existing v0.2 implementation
- Auto-detect available versions with intelligent fallback logic
- Simplify tool integration for v0.4 (single AssistantAgent vs dual-agent pattern)
- Add proper termination conditions and error handling for v0.4

Resolves #935

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 17:08:28 +00:00
github-actions[bot]andMervin Praison 72c70ce050 fix: Replace deprecated Pydantic .dict() with .model_dump() in example files
- Fixed examples/python/api/secondary-market-research-api.py:443
- Fixed examples/python/concepts/reasoning-extraction.py:34
- Fixed ZeroScript_AI_TestExecutor.ipynb notebook
- Added test script to verify fixes work correctly
- Maintains backward compatibility with Pydantic v2
- Resolves PydanticDeprecatedSince20 warnings

Resolves #934

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 17:07:16 +00:00
Mervin Praison 6a13d2b971 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-15 17:57:12 +01:00
Mervin PraisonandMervin Praison fdc747a9c9 fix: Enhance session memory persistence and improve chat history management
- Improved session memory persistence for agent chat history
- Optimised methods for saving and restoring agent chat histories
- Ensured compatibility with existing code while enhancing functionality
- Addressed issues related to chat history loss during session transitions

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 17:57:11 +01:00
Mervin Praison f381b93ae9 Merge pull request #933 from MervinPraison/claude/issue-931-20250715_160543
feat: add comprehensive examples for missing PraisonAI features
2025-07-15 17:52:35 +01:00
Mervin Praison 9c44945123 chore: update numpy and scipy version constraints in dependency files 2025-07-15 17:50:01 +01:00
Mervin Praison a19748902d Merge pull request #932 from MervinPraison/claude/issue-930-20250715_141043
fix: Add session memory persistence for agent chat history
2025-07-15 17:48:02 +01:00
Mervin Praison fa1061a7aa Rename SESSION_MEMORY_FIX_REVIEW.md to examples/python/session/SESSION_MEMORY_FIX_REVIEW.md 2025-07-15 17:47:26 +01:00
github-actions[bot]andClaude 775d97671f fix: Fix session memory persistence by disabling embeddings and correcting search queries
- Fixed session memory persistence issue where state was not being restored correctly
- Disabled embeddings in default memory config to avoid OpenAI API key requirement
- Changed search queries from metadata-based to content-based for SQLite compatibility
- Fixed search query from "type:session_state" to "Session state:" to match stored content
- Fixed agent chat history search from "type:agent_chat_history" to "Agent chat history for"
- Session state persistence now works correctly across session save/restore cycles
- Agent chat history persistence now works correctly across session save/restore cycles
- Maintains backward compatibility with existing code
- Fixes #930

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <[email protected]>
2025-07-15 16:31:10 +00:00
github-actions[bot]andMervin Praison 6c4f4d981d fix: Add missing increment_state method and improve chat history persistence
- Fix f-string issues on lines 275, 300 (remove unnecessary f prefixes)
- Fix chat history initialization to always set agent.chat_history even if empty
- Fix critical data loss bug in _save_agent_chat_histories method
- Now prioritizes live agent history but falls back to restored history
- Prevents chat history loss when agents aren''t re-instantiated after restore

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 16:19:19 +00:00
github-actions[bot]andMervin Praison 72395efd32 feat: add comprehensive examples for missing PraisonAI features
- Add hierarchical process orchestration examples
- Add RouterAgent cost optimization patterns
- Add advanced knowledge management with semantic chunking
- Add comprehensive guardrails with validation workflows
- Add advanced task management with conditional execution
- Add session management with persistence and recovery
- Add production telemetry with OpenTelemetry integration
- Add advanced workflow patterns with decision trees

Resolves #931: Create missing examples where features exist

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 16:16:49 +00:00
efa29de346 fix: Add missing increment_state method and improve chat history persistence
- Add increment_state method (lines 356-359) for numeric state management
- Fix empty chat history save condition to track agent existence properly
- Improve robustness by checking agent is not None before accessing chat_history
- Enhance memory persistence by saving even empty chat histories to track agent state

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Mervin Praison <[email protected]>
Co-Authored-By: Claude <[email protected]>
2025-07-15 16:13:36 +00:00
github-actions[bot]andMervin Praison 75462584b3 fix: Add session memory persistence for agent chat history
- Agent chat history now persists across session save/restore cycles
- Added _agents dictionary to track agent instances and chat histories
- Enhanced Agent() method to restore chat history in restored sessions
- Added helper methods for saving/restoring agent chat histories
- Modified save_state() to automatically save agent chat histories
- Modified restore_state() to automatically restore agent chat histories
- Backward compatible - existing code continues to work unchanged
- Fixes #930

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 14:31:24 +00:00
Mervin Praison d352adbdac chore: bump praisonai to v2.2.62 and praisonaiagents to v0.0.135 across all files 2025-07-15 15:11:32 +01:00
Mervin Praison 68664fdd55 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-15 15:04:19 +01:00
Mervin Praison bcda52cc44 chore: bump praisonai version from 2.2.60 to 2.2.61 across Docker and deployment files 2025-07-15 15:04:17 +01:00
Mervin Praison 4888dfb993 Merge pull request #928 from MervinPraison/claude/issue-926-20250715_112808
refactor: inline Gemini internal tools detection logic
2025-07-15 14:36:45 +01:00
github-actions[bot]andMervin Praison c5a3fc89cc refactor: inline Gemini internal tools detection logic
- Remove import dependency on is_gemini_internal_tool helper function
- Inline logic directly in llm.py and openai_client.py
- Maintain identical functionality and debug logging
- Handle valid tools: googleSearch, urlContext, codeExecution
- Properly skip unknown tools with appropriate logging
- Preserve backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 11:33:22 +00:00
Mervin Praison ca33559d4c Merge pull request #922 from MervinPraison/claude/issue-918-20250715_061404
fix: resolve Ollama sequential tool calling argument mixing issue
2025-07-15 12:24:28 +01:00
Mervin Praison b02449dfdb chore: bump praisonai to v2.2.60 and praisonaiagents to v0.0.134 2025-07-15 09:55:35 +01:00
Mervin Praison c4c0c1c146 Merge pull request #923 from MervinPraison/claude/issue-919-20250715_061529
fix: Add support for Gemini internal tools in tool formatting
2025-07-15 09:52:47 +01:00
Mervin Praison aa2d7e4c31 Merge pull request #924 from Dhivya-Bharathy/kimi2-agents-final
Add Kimi2_Intelligent_Agents: 10 specialized AI agents
2025-07-15 09:51:35 +01:00
Dhivya-Bharathy b339c5b3aa Add Kimi2_Intelligent_Agents: 10 specialized AI agents 2025-07-15 12:57:48 +05:30
github-actions[bot]andMervin Praison e535f98f4e refactor: optimize Gemini tools handling with shared utilities
- Extract GEMINI_INTERNAL_TOOLS constant to eliminate loop recreation
- Create shared is_gemini_internal_tool() utility function
- Remove code duplication between llm.py and openai_client.py
- Improve maintainability and performance based on reviewer feedback

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 06:40:42 +00:00
Mervin Praison bc349ad09f feat: restrict review comments to PRs only and update Claude bot instructions 2025-07-15 07:38:32 +01:00
Mervin Praison 5b8da1180e chore: clarify Claude review instructions to specify branch context 2025-07-15 07:29:21 +01:00
github-actions[bot]andMervin Praison 8f6d8f0a48 fix: Add support for Gemini internal tools in tool formatting
- Add explicit handling for Gemini internal tools (googleSearch, urlContext, codeExecution)
- Update docstrings to document new capability
- Resolves issue where Gemini internal tools were skipped with ''unsupported type'' error
- Maintains backward compatibility with existing tool formats

Closes #919

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 06:23:32 +00:00
github-actions[bot]andMervin Praison 3730b4d094 fix: resolve Ollama sequential tool calling argument mixing issue
- Add parameter validation method _validate_and_filter_ollama_arguments()
- Filter invalid parameters before tool execution for Ollama providers
- Prevent functions from receiving unexpected keyword arguments
- Add comprehensive test suite for validation functionality
- Maintain backward compatibility and graceful error handling

Fixes #918: Ollama sequential failing 3

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-15 06:21:08 +00:00
Mervin Praison 7f3810ed98 chore: add gh tool permission and update claude review comment with PR creation request 2025-07-15 07:19:48 +01:00
Mervin Praison c84a59ab4d feat: implement PostHog event tracking in telemetry module 2025-07-15 07:13:38 +01:00
Mervin Praison c6a6bfa827 Merge pull request #917 from MervinPraison/claude/issue-867-20250714_201010
feat: Add Gemini internal tools examples
2025-07-14 22:22:48 +01:00
github-actions[bot]andMervin Praison a604cd9584 fix: Replace eval() with safe AST-based expression evaluator and remove unused imports
- Replace insecure eval() usage with ast-based safe expression evaluator in README and combined examples
- Remove unused os imports from all Python example files
- Update comments to show import os inline for API key setup
- Addresses security vulnerabilities identified in code review

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 20:38:04 +00:00
github-actions[bot]andMervin Praison cb043da19c feat: Add Gemini internal tools examples
- Add Google Search tool example (gemini-google-search.py)
- Add URL Context tool example (gemini-url-context.py)
- Add Code Execution tool example (gemini-code-execution.py)
- Add combined tools example (gemini-internal-tools-combined.py)
- Add comprehensive documentation (README_GEMINI_INTERNAL_TOOLS.md)

These examples demonstrate how to use Gemini''s built-in internal tools
through PraisonAI''s existing tool system without any code changes.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 20:17:41 +00:00
Mervin Praison 7b41444aad refactor: move test files into src/praisonai-agents directory for better organization 2025-07-14 21:13:34 +01:00
Mervin Praison 7c8b77063f chore: bump praisonai to v2.2.58 and praisonaiagents to v0.0.132 across all files 2025-07-14 21:12:31 +01:00
Mervin Praison 59eb8d6356 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-14 21:07:47 +01:00
Mervin Praison 89bddc31c6 feat: add allowed tools configuration for Claude GitHub action workflow 2025-07-14 21:07:45 +01:00
Mervin Praison e6e908298b Merge pull request #916 from MervinPraison/claude/issue-878-20250714_190400
Fix: resolve duplicate callback execution in LLM interaction handling
2025-07-14 20:53:39 +01:00
Mervin Praison 2b3509c1d1 Delete reproduce_issue_878.py 2025-07-14 20:52:36 +01:00
Mervin Praison 6e8029055a Delete ISSUE_878_REPRODUCTION_GUIDE.md 2025-07-14 20:52:15 +01:00
Mervin Praison d2c9e8825a Merge pull request #915 from MervinPraison/claude/issue-911-20250714_190025
fix: add execute and aexecute methods to Agent class
2025-07-14 20:44:41 +01:00
Mervin Praison cd9816e218 Merge pull request #914 from MervinPraison/claude/issue-901-20250714_143624
Issue #901: Fix self-reflection with tools
2025-07-14 20:43:29 +01:00
Mervin Praison d400149075 chore: update claude review request message to include follow-up action 2025-07-14 20:42:15 +01:00
Mervin Praison 73b08e6b76 feat: add PR creation permissions and request in auto-issue workflow 2025-07-14 20:32:59 +01:00
github-actions[bot]andClaude 19c3a1f6a7 fix: address code review issues in test files
- Add missing sys.path setup to test_self_reflection_with_tools_verification.py
- Remove unnecessary f-string prefixes from print statements
- Add missing newlines at end of files for PEP 8 compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-14 19:24:12 +00:00
71a7968318 fix: resolve duplicate callback execution in LLM interaction handling
- Fixed duplicate callback issue in src/praisonai-agents/praisonaiagents/llm/llm.py where callbacks were executed multiple times
- Added callback_executed flag to track and prevent duplicate callback invocations
- Ensured callbacks are only executed once per interaction, either through display_interaction or direct execute_sync_callback calls
- Improved generation_time consistency by calculating once and reusing the value
- Added comprehensive test files and reproduction scripts to verify the fix
- Added ISSUE_878_REPRODUCTION_GUIDE.md documenting the issue and solution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Mervin Praison <[email protected]>
2025-07-14 19:15:39 +00:00
Mervin Praison 1b258229c1 Merge pull request #913 from MervinPraison/claude/issue-906-20250714_175631
fix: Add callback execution to synchronous display functions
2025-07-14 20:12:26 +01:00
github-actions[bot]andMervin Praison d0e09f51f3 fix: Ensure consistent callback execution across all display functions
- Fix async functions to use execute_callback() instead of direct async_display_callbacks access
- Add missing execute_sync_callback() calls to sync display functions (instruction, tool_call, error, generating)
- Ensures both sync and async callbacks are triggered consistently for all display types
- Maintains backward compatibility through existing parameter filtering

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 19:04:19 +00:00
github-actions[bot]andMervin Praison 5adc862ead fix: add execute and aexecute methods to Agent class for backward compatibility
Resolves AttributeError: type object ''Agent'' has no attribute ''execute''

- Added execute(task, context=None) method that delegates to chat()
- Added aexecute(task, context=None) method that delegates to achat()
- Both methods handle task objects with description attribute or string inputs
- Maintains complete backward compatibility with existing code
- Fixes issue #911

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 19:03:24 +00:00
Mervin Praison 856db54334 Merge pull request #912 from MervinPraison/claude/issue-904-20250714_171858
Fix issue #904: Loop task callback inheritance and enhanced metadata support
2025-07-14 19:58:26 +01:00
github-actions[bot]andMervin Praison f94e5bb3d6 fix: Add callback execution to synchronous display functions
Fixes the duplicate callback issue by:

- Adding execute_sync_callback calls to display_interaction and display_self_reflection
- Fixing test to patch the correct function location
- Ensuring backward compatibility by maintaining existing function signatures
- Adding comprehensive tests for callback system verification

This ensures that callbacks are called exactly once per LLM response while maintaining full backward compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 18:06:08 +00:00
Mervin Praison 1cece603ec Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-14 18:59:38 +01:00
Mervin Praison 9e2bbb9bbb refactor: update tool imports in test files from calculator to evaluate for improved clarity and consistency 2025-07-14 18:59:36 +01:00
Mervin Praison 35b4cff7f7 Merge pull request #910 from MervinPraison/claude/issue-905-20250714_163222
fix: resolve litellm.BadRequestError with unrecognized output_json/output_pydantic parameters
2025-07-14 18:44:18 +01:00
Mervin Praison a094d1ff30 Merge pull request #908 from MervinPraison/claude/issue-907-20250714_165230
fix: add string LLM support to LLMGuardrail for Gemini models
2025-07-14 18:43:11 +01:00
Mervin Praison 000bdf3418 refactor: move test files to src/praisonai-agents and bump version to 2.2.57 2025-07-14 18:40:18 +01:00
github-actions[bot]andMervin Praison 826ff56fc5 refactor: simplify LLMGuardrail string handling and consolidate imports
- Remove redundant if/else logic in string LLM initialization
- Consolidate duplicate LLM imports using _get_llm_class helper
- Maintain all functionality while improving code clarity
- Addresses code review feedback for cleaner, more maintainable code

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 17:31:52 +00:00
github-actions[bot]andClaude 4bd0195d5d Fix issue #904: Loop task callback inheritance and enhanced metadata support
- Add callback inheritance in all 6 locations where loop tasks create subtasks in process.py
- Implement enhanced callback metadata support in task.py with run_context tracking
- Ensure backward compatibility with existing callback implementations
- Maintain proper callback chain for nested loop executions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-14 17:28:28 +00:00
Mervin Praison 812abec2eb Merge pull request #897 from MervinPraison/claude/issue-896-20250714_104106
feat: enhance callbacks with agent and task context (fixes #896)
2025-07-14 18:27:25 +01:00
github-actions[bot]andMervin Praison e58f6deb4b fix: resolve critical runtime issues in callback enhancement
- Fix undefined variables in llm.py response() and aresponse() methods
  by adding missing parameters to method signatures
- Fix backward compatibility by adding signature checking to callbacks
  in display_interaction(), execute_callback(), and execute_sync_callback()
- Ensure consistent parameter propagation in agent.py get_response calls
- Legacy callbacks now work without TypeError, new callbacks get full context

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 17:21:11 +00:00
Mervin Praison f23680c121 Merge pull request #903 from MervinPraison/claude/issue-899-20250714_122107
fix: exclude response_format parameter for Gemini image models
2025-07-14 18:01:38 +01:00
Mervin Praison e569400260 Merge pull request #902 from MervinPraison/claude/issue-901-20250714_140528
Issue #901: Changes from Claude
2025-07-14 17:57:58 +01:00
github-actions[bot]andMervin Praison 75c4d8432c fix: add string LLM support to LLMGuardrail for Gemini models
- Add _initialize_llm method to convert string identifiers to LLM instances
- Update __init__ to handle string LLM identifiers like ''gemini/gemini-2.5-flash-lite-preview-06-17''
- Maintain backward compatibility with existing LLM instances, dict configs, and None values
- Use same LLM initialization logic as Agent class for consistency
- Fixes issue #907 where LLMGuardrail failed with ''Unsupported LLM type'' error

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 16:57:24 +00:00
Mervin Praison 6249d14d3f Merge pull request #895 from MervinPraison/claude/issue-893-20250714_084251
fix: resolve Ollama sequential tool calling redundant execution issue
2025-07-14 17:55:05 +01:00
github-actions[bot]andMervin Praison 32537a227e fix: resolve litellm.BadRequestError with unrecognized output_json/output_pydantic parameters
- Fixed bug in _build_completion_params method where output_json and output_pydantic
  parameters were conditionally removed only when not None
- These custom parameters are now always removed before LiteLLM calls to prevent
  "Unrecognized request arguments supplied" errors
- Maintains backward compatibility and preserves all existing functionality
- Addresses issue #905

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 16:43:03 +00:00
Mervin Praison f83ffcdafe Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-14 17:27:52 +01:00
Mervin Praison 519aebd271 chore: bump praisonai to v2.2.56 and praisonaiagents to v0.0.130 across all files 2025-07-14 17:27:51 +01:00
github-actions[bot]andMervin Praison fb4ecf1893 fix: Address reviewer feedback on self-reflection test files
- Move test files from src/praisonai-agents/ to tests/ directory per repository guidelines
- Replace print statements and return values with proper assert statements
- Fix f-string issues without placeholders
- Add comprehensive exception handling for test failures
- Create improved test structure following repository patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 14:55:27 +00:00
github-actions[bot]andMervin Praison 5a4cbf8aeb fix: improve robustness of Gemini model detection in ImageAgent
- Use self.llm_model property instead of self.llm for more robust model name resolution
- Handles all LLM configuration types (strings, dicts, custom instances, base_url configs)
- Fixes potential AttributeError when self.llm is not set
- Maintains backward compatibility for all existing configurations

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 14:54:16 +00:00
github-actions[bot]andMervin Praison 885a73f697 fix: add intelligent final answer detection to async method
Apply the same intelligent final answer detection logic that was added to the sync method (get_response) to the async method (get_response_async). This ensures consistent behavior between sync and async methods when detecting substantive final answers alongside tool calls.

The fix prevents redundant tool execution loops in async contexts by checking if the LLM provides substantive content (>10 characters) after tool execution, breaking the loop when appropriate.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 14:48:03 +00:00
Mervin Praison 9336f15e67 Merge pull request #900 from Dhivya-Bharathy/add-Notion_Workspace_Assistant
feat: Add Notion_Workspace_Assistant notebook
2025-07-14 15:47:31 +01:00
Mervin Praison 6d55cfa87e Merge branch 'main' into claude/issue-896-20250714_104106 2025-07-14 15:46:44 +01:00
Mervin Praison 0b431b1fe1 Merge pull request #894 from MervinPraison/claude/issue-876-20250714_062122
fix: handle single function as tools parameter to prevent iteration error
2025-07-14 15:43:51 +01:00
github-actions[bot]andMervin Praison e252f86ac9 fix: self-reflection now works with tools
- Fixed issue where self-reflection failed when tools were present
- Added tools=formatted_tools parameter to reflection regeneration calls
- Ensures tools remain available throughout the reflection process
- Maintains backward compatibility with existing code
- Resolves issue #901

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 14:43:12 +00:00
Mervin Praison ed395de6f3 Merge pull request #898 from Dhivya-Bharathy/add-Natural_Language_Codebase
Add Natural_Language_Codebase notebook
2025-07-14 15:42:26 +01:00
Mervin Praison 633469d12e Merge pull request #886 from MervinPraison/claude/issue-877-20250714_005101
fix: ensure callbacks work regardless of verbose setting
2025-07-14 15:41:40 +01:00
Mervin Praison c5c57dff26 Merge pull request #891 from MervinPraison/claude/issue-870-20250714_062116
feat: add support for Gemini embedding models
2025-07-14 15:40:47 +01:00
Mervin Praison 573b9efcc1 Rename docs/gemini-embeddings.md to examples/python/memory/gemini-embeddings.md 2025-07-14 15:40:21 +01:00
Mervin Praison dc4e51ac81 Merge pull request #883 from MervinPraison/claude/issue-872-20250714_005257
fix: enable true parallel execution for async tasks in sequential mode
2025-07-14 15:38:00 +01:00
Mervin Praison 08e211c693 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-14 15:33:32 +01:00
Mervin Praison abd8021925 chore: increase GitHub action comment delay from 20s to 30s 2025-07-14 15:33:32 +01:00
Mervin Praison 8a6c4eec7f Rename examples/python/tools/searxng-search.py to examples/python/tools/searxng/searxng-search.py 2025-07-14 15:31:47 +01:00
Mervin Praison 4e77a6a019 Rename examples/python/tools/trafilatura_example.py to examples/python/tools/trafilatura/trafilatura_example.py 2025-07-14 15:31:03 +01:00
Mervin Praison 41e33c09e0 Rename examples/python/tools/custom_trafilatura_tools.py to examples/python/tools/trafilatura/custom_trafilatura_tools.py 2025-07-14 15:30:54 +01:00
Mervin Praison 96f00e2172 Merge pull request #881 from MervinPraison/claude/issue-869-20250713_205041
feat: integrate Trafilatura for high-quality URL content extraction
2025-07-14 15:29:39 +01:00
github-actions[bot]andMervin Praison e858cebed9 fix: Enable self-reflection with tools in LLM class
- Fixed issue where self-reflection was not working when tools were present
- Added tools=formatted_tools parameter to completion calls during reflection regeneration
- Self-reflection now maintains tool access throughout the reflection process
- Backward compatibility maintained, no existing features removed
- Resolves issue #901

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 14:17:28 +00:00
Dhivya-Bharathy cca79bd9fc Add Notion_Workspace_Assistant notebook 2025-07-14 12:56:32 +00:00
github-actions[bot]andMervin Praison 4ffbc1b52a fix: exclude response_format parameter for Gemini image models
- Add detection logic to identify Gemini models (case-insensitive)
- Exclude response_format parameter for Gemini models to prevent litellm.UnsupportedParamsError
- Maintain backward compatibility for non-Gemini models
- Fixes #899

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 12:24:35 +00:00
DhivyaBharathy b948151a14 Update Natural_Language_Codebase.ipynb 2025-07-14 17:51:41 +05:30
Dhivya-Bharathy 11eee70d9a Add Natural_Language_Codebase notebook 2025-07-14 12:18:39 +00:00
github-actions[bot]andClaude da6a2c1c04 fix: improve tools parameter backward compatibility handling
Refactor tools parameter initialization to better handle falsy values while
maintaining single function support. Changed from explicit None check to
using ''tools or []'' pattern, which properly handles all falsy values
(None, False, 0, "", etc.) without breaking existing functionality.

This resolves backward compatibility regression where falsy values other
than None were not handled correctly in the tools parameter.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-14 11:59:51 +00:00
Mervin Praison 731268df5c Merge branch 'main' into claude/issue-877-20250714_005101 2025-07-14 12:55:28 +01:00
github-actions[bot]andMervin Praison d60021cb40 refactor: move Trafilatura from core to custom tool example
- Remove Trafilatura from core praisonaiagents package
- Create custom tool implementation in examples/python/tools/
- Update example to demonstrate custom tool usage with agents
- Remove dependencies from pyproject.toml
- Remove from tools __init__.py and README.md
- Keep all functionality as standalone custom tool

This change follows the request to not integrate into core package
but provide as custom tool example instead.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 11:55:10 +00:00
Mervin Praison 75894f26c1 Merge pull request #884 from MervinPraison/claude/issue-874-20250714_005622
fix: prevent infinite loop in parallel task execution
2025-07-14 12:52:35 +01:00
Mervin Praison c53e09480a Rename test_async_sequential.py to src/praisonai-agents/test_async_sequential.py 2025-07-14 12:51:46 +01:00
2ef506fa8a feat: enhance callbacks with agent and task context (fixes #896)
- Add agent_name, agent_role, agent_tools, task_name, task_description, task_id to callbacks
- Update display_interaction() and adisplay_interaction() to accept new parameters
- Enhance LLM.get_response() to accept and pass task context
- Modify Agent.chat() to accept task parameters
- Update task execution in agents.py to pass task information
- Maintain backward compatibility with existing callbacks
- Add test scripts to verify functionality

Co-authored-by: Mervin Praison <[email protected]>

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-14 10:53:46 +00:00
Mervin Praison 7ce783e59b Merge branch 'main' into claude/issue-893-20250714_084251 2025-07-14 11:11:05 +01:00
Mervin Praison 95ffd0c53f chore: bump PraisonAI to 2.2.55 and PraisonAI Agents to 0.0.129 across all files 2025-07-14 11:09:35 +01:00
Mervin Praison e1c90bf569 Merge pull request #880 from MervinPraison/claude/issue-866-20250713_204435
feat: Add multi-provider/multi-model support with intelligent routing
2025-07-14 11:07:02 +01:00
Mervin Praison 5fbd8aa783 Merge pull request #892 from MervinPraison/claude/pr-879-20250714_063758
fix: Improve Ollama sequential tool calling handling
2025-07-14 11:02:12 +01:00
381c86de79 fix: resolve callback duplication and validation timing issues
- Add callback_executed tracking in llm.py to prevent duplicate callbacks
- Fix validation timing in agent.py for output_json/output_pydantic flows
- Ensure guardrail validation runs even for JSON outputs
- Improve interaction display logic to avoid redundant callbacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Mervin Praison <[email protected]>
2025-07-14 08:52:55 +00:00
github-actions[bot]andClaude 35250e429e fix: clean up redundant conditionals and improve tool execution logic in llm.py
- Remove redundant conditional expressions that were causing unnecessary repetition
- Add intelligent final answer detection after tool execution
- Prevent unnecessary tool execution loops when LLM provides substantive response

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-14 08:51:02 +00:00
github-actions[bot]andClaude 3027937057 fix: prevent event loop blocking and refactor async task handling
- Replace deprecated asyncio.get_event_loop() with asyncio.get_running_loop()
- Fix event loop blocking issues in API and MCP server implementations
- Improve async handling consistency across the codebase

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-14 08:50:15 +00:00
github-actions[bot]andMervin Praison d79443868f refactor: Rename MultiModelAgent to RouterAgent for better clarity
- Renamed MultiModelAgent class to RouterAgent throughout codebase
- Updated multi_model_agent.py -> router_agent.py
- Updated all imports, exports, and references in:
  - src/praisonai-agents/praisonaiagents/agent/__init__.py
  - examples/python/agents/multi-provider-agent.py
  - examples/python/agents/MULTI_PROVIDER_README.md
  - src/praisonai-agents/test_multi_provider.py
- RouterAgent better reflects the primary purpose of intelligent model routing
- Maintains all existing functionality and backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 08:50:14 +00:00
github-actions[bot]andMervin Praison 6705e753e8 fix: Remove hardcoded regex logic from Ollama tool calling
- Remove explicitly prohibited hardcoded regex patterns
- Move import re to top of file (PEP 8 compliance)
- Extract duplicated message-building logic into helper method
- Define prompt constants at class level for maintainability
- Simplify tool result formatting without numeric extraction
- Maintain backward compatibility and existing functionality

Fixes code quality issues identified by automated review tools
while ensuring compliance with explicit PR requirements.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 08:49:03 +00:00
Mervin Praison b4d1532512 ci: prevent bot accounts from triggering Claude workflow action 2025-07-14 08:51:51 +01:00
Mervin Praison 4b5d3b2eda ci: remove max_turns limit from Claude code review workflow 2025-07-14 08:50:09 +01:00
Mervin Praison a1d4f3ee43 feat: add repository checkout step with fetch history in Claude workflow 2025-07-14 08:23:09 +01:00
Mervin Praison b5e930ff2e Merge pull request #889 from MervinPraison/claude/issue-873-20250714_005616
fix: use LLM abstraction instead of hardcoded OpenAI in hierarchical process
2025-07-14 08:13:08 +01:00
Mervin Praison 1a6a14f8f2 Merge pull request #887 from MervinPraison/claude/issue-878-20250714_005448
fix: prevent duplicate callback invocations in LLM response generation
2025-07-14 08:11:52 +01:00
Mervin Praison ca69de4c6a Merge pull request #885 from MervinPraison/claude/issue-875-20250714_005802
fix: Support GuardrailResult return type in guardrail functions (#875)
2025-07-14 08:09:05 +01:00
Mervin Praison 9b3d36e6d7 ci: remove redundant repository checkout step from Claude workflow 2025-07-14 08:07:07 +01:00
Mervin Praison a9359a0785 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-14 08:05:10 +01:00
Mervin Praison 4cb016c3ca feat: add Gemini structured output agent and enhance Claude workflow checkout 2025-07-14 08:05:08 +01:00
Mervin Praison d2e4776884 Merge pull request #888 from MervinPraison/claude/issue-871-20250714_005124
feat: Add Gemini structured output support
2025-07-14 07:52:18 +01:00
claude[bot]andMervin Praison 193b82aeba fix: Improve Ollama sequential tool calling handling
- Extract numeric values from tool results for better clarity
- Add explicit prompting for final answers after tool execution
- Handle empty initial responses from Ollama with retry logic
- Fix duplicate strip calls in response handling

This improves Ollama's ability to:
1. Understand numeric values from tool results
2. Generate proper final answers instead of returning None
3. Avoid getting stuck in infinite loops

Fixes the issue where Ollama was unable to properly chain tool calls
for sequential operations like getting a stock price and multiplying it.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:42:14 +00:00
claude[bot]andMervin Praison 029de283c4 refactor: extract duplicate workflow completion logic into helper method
- Created _check_all_tasks_completed() helper method to eliminate code duplication
- Both async and sync workflow methods now use the same completion check logic
- No functional changes, pure refactoring for better maintainability

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:40:00 +00:00
Mervin Praison 26376a77af Merge pull request #890 from Dhivya-Bharathy/grok4-agents-batch-upload
feat: Add 10 Grok4 Intelligent Agent Examples
2025-07-14 07:31:17 +01:00
claude[bot]andMervin Praison 7cb580bb12 fix: handle single function as tools parameter to prevent iteration error
- Fix LLM._log_llm_config to properly check if tools is a list/tuple before iterating
- Fix Agent.__init__ to wrap single callable tools in a list automatically
- Resolves "'function' object is not iterable" error when using LLMGuardrail
- Maintains full backward compatibility

Fixes #876

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:30:54 +00:00
claude[bot]andMervin Praison 06b458cc54 test: add test script for async task parallel execution
- Tests that async tasks run in parallel in sequential mode
- Verifies sync tasks wait for async tasks to complete
- Measures execution times to confirm parallel execution
- Helps validate the async task execution fix

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:28:30 +00:00
claude[bot]andMervin Praison e29c2fbe90 fix: prevent event loop blocking and refactor async task handling
- Use run_in_executor for sync tasks in both sequential and hierarchical processes
- Refactor duplicated async task gathering logic into flush_async_tasks helper
- Update to asyncio.get_running_loop() from deprecated get_event_loop()
- Maintains backward compatibility while fixing performance issues

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:28:21 +00:00
claude[bot]andMervin Praison 76032be618 feat: add support for Gemini embedding models
- Extract embedding model from embedder configuration in Memory class
- Replace hardcoded "text-embedding-3-small" with configurable model
- Support any embedding model available through LiteLLM
- Maintain backward compatibility (defaults to OpenAI model)
- Add documentation and examples for Gemini embeddings
- Update memory_example.py to show configuration options

Fixes #870

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:27:18 +00:00
claude[bot]andMervin Praison 80f5ba940b fix: address code review issues for Trafilatura integration
- Fix asyncio blocking by using asyncio.to_thread() for all synchronous calls in async functions
- Remove dead code: module-level __call__ function that would never be invoked
- Replace global variable with module-level trafilatura import for cleaner code
- Remove unused json import in test file
- Improve error detection from fragile string check to robust pattern
- Add clarifying comments about safe circular imports due to lazy loading

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:26:49 +00:00
devops-vestradata 65791781e2 Add 10 grok4 intelligent agent files 2025-07-14 11:56:23 +05:30
claude[bot]andMervin Praison ee66154b73 fix: ensure interaction_displayed flag prevents all duplicate callbacks
- Added missing interaction_displayed checks to reasoning steps display
- Added missing checks to self-reflection display logic
- Ensured flag is set after each display interaction
- Fixed both sync and async methods
- Added comprehensive test to verify the fix

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:24:34 +00:00
claude[bot]andMervin Praison 0dc51060d8 fix: resolve callback duplication and validation timing issues
- Remove callback execution from display functions to prevent duplication when verbose=True
- Add missing callback execution after streaming completes when verbose=False
- Move callbacks to execute AFTER guardrail validation to prevent inconsistent state
- Add _execute_callback_and_display helper method to reduce code duplication
- Ensure callbacks work consistently regardless of verbose setting

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:23:51 +00:00
claude[bot]andMervin Praison 2daae1f464 fix: Address critical issues with Gemini structured output implementation
- Add hasattr check before calling model_json_schema() to prevent AttributeError
- Centralize Gemini model detection logic with new _is_gemini_model() method
- Fix critical bug: Always remove output_json/output_pydantic from params before passing to litellm
- Fix model recognition to handle provider-prefixed models (e.g., 'google/gemini-1.5-pro')
- Ensure backward compatibility for all existing models

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:23:29 +00:00
claude[bot]andMervin Praison 81bcda0440 fix: correct LLM interface usage and improve code quality
- Remove duplicate output_json=True when using output_pydantic
- Add helper methods to reduce code duplication
- Improve test file to use proper assertions instead of sys.exit()
- Add unit tests for the new helper methods
- Fix TypeError handling in JSON parsing

This ensures the hierarchical workflow works correctly with all LLM providers.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:23:13 +00:00
claude[bot]andMervin Praison e269cc7bf2 fix: Improve guardrail validation and add missing type hints
- Fixed critical bug: validation now properly checks for GuardrailResult type instead of accepting any class with the same name
- Added missing TaskOutput type hints in example file
- Refactored conditional logic for better readability
- Maintains full backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 06:21:30 +00:00
Mervin Praison 66e5dfcb41 refactor: update Claude GitHub Action with simplified OAuth authentication and improved triggers 2025-07-14 03:08:02 +01:00
Mervin Praison ae3e69a286 feat: exclude @gemini triage command from issue review workflow 2025-07-14 02:48:11 +01:00
Mervin Praison 40ea6fe1aa ci: simplify Gemini trigger command from '@gemini review' to '@gemini' 2025-07-14 02:46:58 +01:00
Mervin Praison e30a7564be Merge pull request #879 from MervinPraison/claude/issue-854-20250713_205120
fix: Implement Ollama sequential tool calling fix
2025-07-14 02:20:07 +01:00
claude[bot]andMervin Praison fbd0a736f0 fix: Fix critical issues in multi-provider implementation
- Changed TaskComplexity from string Enum to IntEnum for proper ordering comparisons
- Fixed manual routing logic to use llm_model property correctly
- Removed private attribute access by storing api_key and base_url locally
- Improved context size estimation from char count to token approximation
- Removed unused imports (Callable, TaskComplexity, ModelProfile)
- Fixed unnecessary f-string in error message
- Added TODO for token tracking implementation
- Fixed inconsistent model names in documentation

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:16:18 +00:00
claude[bot]andMervin Praison eea9f757af fix: use LLM abstraction instead of hardcoded OpenAI in hierarchical process
- Replace direct OpenAI client instantiation with LLM class
- Support all LLM providers (Gemini, Anthropic, etc.) in manager tasks
- Remove unused OpenAI imports from process.py
- Fix issue #873 where hierarchical workflow required OpenAI API key

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:08:57 +00:00
claude[bot]andMervin Praison 02a8f075a6 fix: prevent duplicate callback invocations in LLM response generation
- Add interaction_displayed flag to track display_interaction calls
- Prevent duplicate callbacks in both sync and async get_response methods
- Fix addresses issue where callbacks fired twice for single task execution
- Maintain backward compatibility with no API changes

Fixes #878

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:08:54 +00:00
claude[bot]andMervin Praison 57c39653d6 feat: Add Gemini structured output support
- Add Gemini models to MODELS_SUPPORTING_STRUCTURED_OUTPUTS
- Implement native Gemini structured output using response_schema
- Maintain backward compatibility for OpenAI and other models
- Update _build_messages to skip prompt modification for Gemini
- Add response_mime_type and response_schema parameters for Gemini
- Pass output_json/output_pydantic through all completion calls

Fixes #871

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:06:59 +00:00
claude[bot]andMervin Praison 2f21d0f907 fix: Support GuardrailResult return type in guardrail functions (#875)
- Modified task.py to accept both GuardrailResult and Tuple[bool, Any] return types
- Updated _process_guardrail to handle GuardrailResult directly without conversion
- Added comprehensive test cases for both return types
- Updated documentation with GuardrailResult examples
- Maintains backward compatibility with existing Tuple[bool, Any] guardrails

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:05:39 +00:00
claude[bot]andMervin Praison e0caaf8421 fix: enable true parallel execution for async tasks in sequential mode
Previously, async tasks in sequential mode were awaited one-by-one, defeating 
the purpose of async execution. This fix collects async tasks and runs them 
in parallel using asyncio.gather(), ensuring:

- Async tasks run concurrently as intended
- Sync tasks still execute in order after async tasks complete
- Proper task completion and dependency handling

Fixes #872

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:05:27 +00:00
claude[bot]andMervin Praison 4bc35c3b6e test: add test scripts for callback fix verification
- test_callback_fix.py: Simple test to verify callbacks work with verbose=False
- test_issue_877.py: Comprehensive test reproducing the exact issue scenario
- Both tests verify that callbacks are executed regardless of verbose setting

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:05:20 +00:00
claude[bot]andMervin Praison 4fd9b863a6 fix: ensure callbacks work regardless of verbose setting
- Added execute_sync_callback helper function to trigger callbacks without display
- Updated LLM class to always execute interaction callbacks when responses are generated
- Updated Agent class to ensure callbacks work for direct OpenAI client usage
- Maintains backward compatibility - display output still controlled by verbose flag
- Fixes issue #877 where callbacks only worked when verbose=True

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:05:13 +00:00
claude[bot]andMervin Praison fc02392ddb fix: prevent infinite loop in parallel task execution by exiting workflow when all tasks complete
When all tasks are completed and workflow_finished is set to True, the workflow now immediately exits to prevent tasks from being reset to "not started" state. This fixes the issue where parallel tasks would repeat in a loop and the aggregator task would never run.

Fixes #874

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 01:03:39 +00:00
claude[bot]andMervin Praison 4564639f18 enhance: Improve Ollama provider detection
- Add check for "ollama" in base_url for custom configurations
- Support detection of custom Ollama ports beyond 11434
- More robust detection for various deployment scenarios

Co-authored-by: Mervin Praison <[email protected]>
2025-07-14 00:58:57 +00:00
claude[bot]andMervin Praison 16598104ab feat: integrate Trafilatura for high-quality URL content extraction
- Add trafilatura_tools.py with extract_content, extract_metadata, extract_text_only, and compare_extraction functions
- Register Trafilatura tools in __init__.py for easy imports
- Add trafilatura and newspaper3k as optional [web] dependencies
- Include comprehensive URL validation to prevent SSRF attacks
- Update tools README with Trafilatura documentation
- Add detailed example file showing various usage patterns
- Create test script for verification
- Maintain backward compatibility with existing URL extraction tools

Resolves #869

Co-authored-by: Mervin Praison <[email protected]>
2025-07-13 21:05:30 +00:00
claude[bot]andMervin Praison b5d13a2b7f fix: Implement Ollama sequential tool calling fix
Modified conversation format for Ollama to handle tool results properly:
- Assistant messages no longer include 'tool_calls' field for Ollama
- Tool results are passed as user messages with natural language format
- Prevents infinite loop of repeated tool calls

This allows Ollama to properly execute sequential tool calls as intended.

Fixes #854

Co-authored-by: Mervin Praison <[email protected]>
2025-07-13 20:55:34 +00:00
claude[bot]andMervin Praison 4622bcda43 feat: Add multi-provider/multi-model support with intelligent routing
- Add ModelRouter for intelligent model selection based on task complexity
- Create MultiModelAgent class supporting multiple models per agent
- Implement routing strategies: auto, cost-optimized, performance-optimized
- Add pre-configured profiles for 8+ popular models
- Include usage tracking and cost estimation
- Maintain full backward compatibility
- Add comprehensive examples and documentation

Fixes #866

Co-authored-by: Mervin Praison <[email protected]>
2025-07-13 20:53:06 +00:00
Mervin Praison 31bae3a231 chore: bump PraisonAI to 2.2.54 and update Gemini workflows 2025-07-13 21:49:21 +01:00
Mervin Praison 466bcfedd7 Merge pull request #863 from MervinPraison/gemini/issue-862-fix-async-loop
Fix #862: Agent gets stuck in infinite loop when running multiple async tasks
2025-07-13 20:46:57 +01:00
Mervin Praison c24bf80314 Merge pull request #858 from MervinPraison/gemini/issue-854-fix-ollama-sequential-1690000000
Fix #854: Ollama sequential still failing
2025-07-13 20:46:21 +01:00
Mervin Praison c36b3aee6e Merge pull request #865 from MervinPraison/gemini/issue-864-fix-parallel-task-loop
Fix #864: Fix parallel task loop
2025-07-13 20:45:55 +01:00
Mervin Praison 08512ba6d3 Merge pull request #861 from MervinPraison/gemini/issue-860-fix-hierarchical-llm-fallback
Fix #860: Hierarchical Process LLM Fallback
2025-07-13 20:43:53 +01:00
claude[bot]andMervin Praison 63ebfc0b54 fix: Complete removal of Ollama special handling for async method
This completes the fix for issue #854 by removing the Ollama special
handling from the async method (get_response_async) to match the sync
method fix. Also removes the now-unused _handle_ollama_model method.

The special handling was causing infinite loops in sequential tool
calling. By removing it, Ollama models now work correctly through
the standard litellm interface.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-13 19:21:40 +00:00
claude[bot]andMervin Praison b29269071d fix: properly handle parallel task reset logic to prevent infinite loops
- Uncommented the task reset logic that was causing issue #864
- Added check for async_execution to prevent resetting parallel tasks
- Preserves backward compatibility for non-parallel tasks that need rerun
- Fixes infinite loop issue while maintaining existing functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-13 19:14:59 +00:00
Gemini Bot b6a86bf348 Gemini: [Issue #864] Fix parallel task loop 2025-07-13 12:49:40 +00:00
Gemini Bot 02ba71be3d Gemini: [Issue #862] Fix infinite loop in async workflow 2025-07-13 12:17:37 +00:00
Gemini Bot e60f1c1aa1 Gemini: [Issue #860] Fix hierarchical process LLM fallback 2025-07-13 11:31:08 +00:00
Mervin Praison 450f237805 feat: add description field to TaskOutput in validation feedback tests 2025-07-13 01:17:26 +01:00
Mervin Praison 66e53fc82e refactor: move validation test files to src directory and update LLM model references 2025-07-13 01:09:52 +01:00
Mervin Praison 7e6ee5f9f2 chore: enhance variable handling in PR review workflow for improved clarity 2025-07-13 01:04:41 +01:00
Mervin Praison b669b9815d fix: correct variable interpolation syntax in PR review workflow 2025-07-13 00:50:39 +01:00
Mervin Praison 6d89cd603e chore: remove debug workflow trigger step from Gemini PR review action 2025-07-13 00:44:38 +01:00
Mervin Praison 6e955b5941 feat: restrict Gemini PR review to repo owners, members and collaborators 2025-07-13 00:34:48 +01:00
Mervin Praison 87a67b5f5d refactor: improve PR checkout logic in Gemini review workflow using dedicated step 2025-07-13 00:25:08 +01:00
Mervin Praison baec9cd0a4 fix: update checkout ref to handle both PR and issue comment triggers 2025-07-13 00:23:16 +01:00
Mervin Praison e144dc497d feat: allow all users to trigger Gemini PR review and add debug logging 2025-07-13 00:19:06 +01:00
Gemini Bot 8a77ab0ab5 Gemini: [Issue #854] Fix Ollama sequential tool calling loop 2025-07-12 23:10:23 +00:00
Mervin Praison 0034b5c964 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-13 00:04:14 +01:00
Mervin Praison 543c627374 feat: expand GitHub Actions permissions to include PR list and granular git commands 2025-07-13 00:04:13 +01:00
Mervin Praison 93154adf9e Merge pull request #857 from MervinPraison/gemini/issue-854-fix-ollama-sequential-fail
Fix #854: Ollama sequential tool calling failing
2025-07-13 00:03:55 +01:00
Gemini Bot 3ab2462d96 Gemini: [Issue #854] Fix Ollama sequential tool calling loop 2025-07-12 23:00:05 +00:00
Mervin Praison aecf65a130 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-12 23:52:47 +01:00
Mervin Praison 0a453d30a2 chore: add .gemini and issue_details.json to gitignore 2025-07-12 23:52:46 +01:00
Mervin Praison 354a2c717b Merge pull request #856 from MervinPraison/gemini/issue-854-fix-ollama-sequential
Fix #854: Ollama sequential tool calling failing
2025-07-12 23:52:38 +01:00
Mervin Praison 62514fbef4 Delete issue_details.json 2025-07-12 23:51:43 +01:00
Mervin Praison f3c77a2e8b Delete .gemini/settings.json 2025-07-12 23:51:32 +01:00
Gemini Bot 50dde4fa02 Gemini: [Issue #854] Fix Ollama sequential tool calling 2025-07-12 22:45:09 +00:00
Mervin Praison bbc4530329 chore: bump version to 2.2.53 and update dependencies across package files 2025-07-12 23:43:01 +01:00
Mervin Praison aab975bec7 Merge pull request #851 from MervinPraison/claude/issue-846-20250712_220811
fix: handle None response_text in Ollama sequential tool calls
2025-07-12 23:28:38 +01:00
Mervin Praison 50c50fa567 Merge pull request #849 from MervinPraison/claude/issue-845-20250712_183232
fix: enable sequential tool execution in OpenAI client
2025-07-12 23:27:54 +01:00
claude[bot]andMervin Praison 68f280634a refactor: remove dead code from sequential tool execution logic
- Remove unused should_continue variable and related logic
- Simplify code by removing special handling for sequentialthinking tool
- Add clear comments explaining the sequential execution behavior

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 22:16:05 +00:00
Mervin Praison 346488fbec Delete test_sequential_fix.py 2025-07-12 23:15:10 +01:00
claude[bot]andMervin Praison 57b5a1fd8d fix: handle None response_text in Ollama sequential tool calls
- Add None checks before calling .strip() on response_text
- Fixes 'NoneType' object has no attribute 'strip' error with Ollama models
- Applied pattern: response_text.strip() if response_text else ""
- Fixed 14 locations where .strip() was called without None checks
- Ensures backward compatibility by returning empty string instead of None

Fixes issue #846

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 22:11:55 +00:00
claude[bot]andMervin Praison d75a5bb728 test: add assertions to test_sequential_fix.py for automated testing
- Add proper assertions to verify sequential tool execution results
- Improve multiply function docstring with complete Args and Returns sections
- Add success message when all assertions pass

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 22:10:09 +00:00
Mervin Praison 519ecc025a feat: update allowed commands in GitHub workflow files for Gemini reviews 2025-07-12 21:21:23 +01:00
Mervin Praison 8290b95132 refactor: update issue review prompt with clearer instructions and dynamic commands 2025-07-12 21:01:13 +01:00
Mervin Praison 3d95e1ff0e feat: add read_file permission to Gemini PR review workflow 2025-07-12 20:55:41 +01:00
Mervin Praison 74405d1bbe feat: add read_file permission to Gemini issue review workflow 2025-07-12 20:54:59 +01:00
Mervin Praison d307c3857c feat: add environment variables for Gemini CLI action in GitHub workflow 2025-07-12 20:54:31 +01:00
Mervin Praison fbe5dddaae chore: disable telemetry in GitHub workflow configurations 2025-07-12 20:45:20 +01:00
Mervin Praison 7e4108918d fix: move GH_TOKEN to local env scope in GitHub workflow 2025-07-12 20:40:04 +01:00
Mervin Praison da7e38100e feat: add GitHub workflow for automated issue review using Gemini AI 2025-07-12 20:36:37 +01:00
Mervin Praison 848459b816 feat: add edit, web-fetch, web-search and memoryTool permissions while removing telemetry setup 2025-07-12 20:35:19 +01:00
Mervin Praison cd63845398 feat: add git command to allowed shell commands in PR review workflow 2025-07-12 20:31:18 +01:00
Mervin Praison 7827427dc0 feat: move Gemini PR review action to dedicated directory with configuration 2025-07-12 20:16:47 +01:00
Mervin Praison 0e378d0754 feat: add GitHub workflows for Gemini issue triage and PR review automation 2025-07-12 20:03:05 +01:00
Mervin Praison 206022eb9c refactor: simplify auto-comment workflows by removing multi-agent review requirement 2025-07-12 19:48:23 +01:00
Mervin Praison 901ba8074d Delete test_sequential_fix.py 2025-07-12 19:40:42 +01:00
claude[bot]andMervin Praison 953ee6e7bd fix: enable sequential tool execution in OpenAI client
Removes premature loop termination after tool execution to allow
sequential tool calls. The model can now see tool results and make
additional tool calls as needed.

Fixes #845

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 18:36:00 +00:00
Mervin Praison 181d7e1ede feat: bump PraisonAI to v2.2.52 and add sequential agent examples for OpenAI/Ollama 2025-07-12 19:12:05 +01:00
Mervin Praison 4039878422 Merge pull request #842 from MervinPraison/claude/issue-839-20250712_075350
fix: allow agents to continue with sequential tool calls
2025-07-12 19:04:25 +01:00
Mervin Praison 461eba18d5 Delete src/praisonai/tests/unit/test_sequential_tool_calling.py 2025-07-12 19:03:44 +01:00
claude[bot]andMervin Praison 331a1de610 test: add comprehensive test suite for sequential tool calling
This test file validates the fix for issue #839, ensuring agents can:
- Execute multiple tools in sequence
- Pass results between tool calls
- Return final combined results without empty responses

Tests include:
- Sequential execution of 2 and 3 tools
- Multiple agents with sequential tools
- Mocked LLM responses
- Edge case prevention for empty responses

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 18:00:27 +00:00
claude[bot]andMervin Praison 91632eb5e4 fix: correct Ollama return statement and variable reference for sequential tool calling
- Replace early return with loop continuation in Ollama handling to match async behavior
- Fix variable reference from reasoning_content to stored_reasoning_content
- Ensures agents can perform sequential tool calls as intended

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 17:54:53 +00:00
Mervin Praison ad46225483 Rename src/praisonai/tests/unit/test_fix_comprehensive.py to src/praisonai-agents/tests/test_fix_comprehensive.py 2025-07-12 18:50:30 +01:00
Mervin Praison 9af6758eb6 Delete test_fix.py 2025-07-12 18:48:37 +01:00
Mervin Praison aac67a6572 Rename test_fix_comprehensive.py to src/praisonai/tests/unit/test_fix_comprehensive.py 2025-07-12 18:47:35 +01:00
claude[bot]andMervin Praison 2ceff9bfae fix: correct indentation error in async streaming code
Fixed SyntaxError caused by incorrect indentation in the async version of get_response_async method. The if/else blocks for streaming vs non-streaming approaches now have proper indentation.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 17:41:09 +00:00
claude[bot]andMervin Praison 3b7af02bea fix: correct indentation error in async streaming code
Fixed IndentationError at line 1325 where the async for loop was not properly
indented under the if verbose: block. Also corrected the indentation of the
else block for non-verbose streaming.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 17:33:23 +00:00
Mervin Praison 1ee7cfa2ef Merge pull request #844 from MervinPraison/claude/issue-840-20250712_172354
docs: add OLLAMA_HANDLING.md to explain ollama_handled flag usage
2025-07-12 18:32:16 +01:00
claude[bot]andMervin Praison b01bd41574 fix: add sequential tool calling support to async get_response_async method
- Add while loop structure with max_iterations and iteration_count
- Replace return statements with loop continuation after tool execution
- Store reasoning content across iterations for proper display
- Update final response handling to use stored values from iterations
- Ensure async behavior matches sync version for issue #839

This resolves the inconsistency where async agents would return empty
responses after first tool call instead of continuing with additional
required tool calls.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 17:27:37 +00:00
claude[bot]andMervin Praison 6570e445b8 docs: add OLLAMA_HANDLING.md to explain ollama_handled flag usage
Add documentation to clarify that ollama handling is correctly implemented
in llm.py and not in agent.py, addressing issue #840

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 17:25:07 +00:00
Mervin Praison b421bcf925 Merge pull request #843 from MervinPraison/claude/issue-841-20250712_080725
fix: add return_dict=True to fix TypeError in prompt_chaining tests
2025-07-12 18:24:24 +01:00
claude[bot]andMervin Praison 41d0998b76 fix: preserve reasoning_steps functionality with sequential tool calling
- Add stored_reasoning_content to capture reasoning after tool execution
- Restore reasoning_steps handling after tools while keeping loop continuation
- Update final response display to include stored reasoning when available
- Return reasoning content when reasoning_steps=True and content exists

This ensures backward compatibility while maintaining the sequential tool calling fix

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 08:41:06 +00:00
claude[bot]andMervin Praison 393e0ee33d fix: document async limitation and ensure consistent behavior
- Added clear documentation that async version doesn't support sequential tool calling
- Reverted incomplete async implementation to avoid breaking existing functionality
- Sync version retains the fix for sequential tool calling (issue #839)
- Created a known limitation that needs to be addressed in a future PR

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 08:40:25 +00:00
claude[bot]andMervin Praison 0dce4de4a4 fix: add return_dict=True to fix TypeError in prompt_chaining tests
The workflow.start() method returns a string by default (for backward compatibility),
but the test files were expecting a dictionary. Fixed by adding return_dict=True
parameter to get the expected dictionary format with task_results and task_status keys.

Fixes #841

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 08:23:56 +00:00
Mervin Praison 7fe4b48c6e fix: update LLM model and refine agent instruction
Changed the LLM model from "openai/gpt-4o-mini" to "gemini/gemini-2.5-pro" for improved performance. Updated the agent's instruction to provide clearer context for the task, enhancing user interaction.

Also, optimised the suggest_fixes function to handle both dictionary and string inputs, improving its flexibility in suggesting fixes based on issue type.

This minimal change aims to enhance the functionality while maintaining existing code integrity.
2025-07-12 09:22:33 +01:00
claude[bot]andMervin Praison 5286912f34 test: add test scripts for sequential tool calling fix
Add test scripts to verify the fix for issue #839 works correctly
with both Gemini and GPT-4 models.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 08:01:18 +00:00
claude[bot]andMervin Praison d6cb1c0165 fix: allow agents to continue with sequential tool calls
After executing tool calls, the agent now continues the iteration loop
instead of immediately trying to get a final response. This allows the
LLM to decide if more tools are needed to complete the task.

Fixes issue where agents would return empty responses after the first
tool call instead of continuing with additional required tool calls.

Resolves #839

Co-authored-by: Mervin Praison <[email protected]>
2025-07-12 08:01:10 +00:00
Mervin Praison 08ed3f94dc Merge pull request #836 from MervinPraison/claude/issue-835-20250711_234446
fix: capture final response after tool execution in LLM
2025-07-12 01:10:32 +01:00
Mervin Praison d3bfbc4b92 Delete test_issue_835.py 2025-07-12 01:00:19 +01:00
claude[bot]andMervin Praison af7081d294 fix: capture final response after tool execution in LLM
When an agent executes tools and the final iteration contains the answer
without additional tool calls, ensure the response text is properly captured
and returned instead of returning empty/None.

This fixes the issue where agents with multiple tools would return empty
responses after successfully executing tools.

Fixes #835

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 23:52:25 +00:00
Mervin Praison 3b2f26699e Merge pull request #834 from MervinPraison/claude/pr-832-20250711_232348
PR #832: Changes from Claude
2025-07-12 00:42:58 +01:00
claude[bot]andMervin Praison 7aa61b9155 fix: pass stream parameter from Agent to LLM
The Agent class was not passing the stream parameter to the LLM's get_response() method, causing the LLM to always use its default stream=True behavior regardless of the Agent's configuration.

This fix ensures that when an Agent is created with stream=False or when chat() is called with stream=False, this preference is properly passed to the LLM.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 23:31:50 +00:00
Mervin Praison 7e37c940d4 feat: upgrade praisonai to v2.2.51 and add aiohttp dependency to praisonaiagents v0.0.125 2025-07-12 00:28:17 +01:00
Mervin Praison 2199a57dfe Merge pull request #832 from MervinPraison/claude/issue-824-20250711_155141
fix: sequential tool calling for non-streaming responses
2025-07-12 00:19:42 +01:00
Mervin Praison d49f046322 Rename test_sequential_tool_calling.py to src/praisonai-agents/test_sequential_tool_calling.py 2025-07-12 00:14:28 +01:00
claude[bot]andMervin Praison c16c2e38af fix: improve sequential tool calling for non-streaming responses
- Fixed Ollama handling to properly separate streaming/non-streaming modes
- Added robust error handling for response extraction
- Fixed test file to use correct stream parameter
- Ensures tool outputs are processed by LLM in non-streaming mode

Addresses review feedback on PR #832

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 18:24:18 +00:00
Mervin Praison b5df9f323c Merge pull request #833 from MervinPraison/claude/issue-831-20250711_173321
fix: centralize logging configuration to respect LOGLEVEL environment variable
2025-07-11 19:05:06 +01:00
claude[bot]andMervin Praison 6e4abeef52 fix: ensure consistent logger levels across modules
- Change third-party logger levels from ERROR to WARNING in llm/__init__.py
  to match the centralized configuration
- Remove root logger override in knowledge.py that was ignoring LOGLEVEL
  environment variable

This ensures the LOGLEVEL environment variable is properly respected
throughout the application.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 17:58:02 +00:00
claude[bot] 5656570172 chore: remove test_logging.py from root - should be in tests directory
The test script was helpful for verifying the fix but should not be in the package root.
2025-07-11 17:44:52 +00:00
claude[bot]andMervin Praison c08c7cfedf fix: centralize logging configuration to respect LOGLEVEL environment variable
- Move logging configuration to top of __init__.py to ensure it runs before any imports
- Remove duplicate logging.basicConfig from llm/__init__.py that was overriding settings
- Clean up main.py to remove redundant logging configuration
- Add test_logging.py script to verify the fix works correctly

This ensures that the LOGLEVEL environment variable (DEBUG, INFO, WARNING, ERROR) properly controls logging verbosity throughout the package.

Fixes #831

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 17:44:18 +00:00
Mervin Praison fbbe80fd4d Merge pull request #829 from MervinPraison/claude/issue-827-20250711_151456
fix: add validation feedback to workflow retry logic
2025-07-11 17:27:46 +01:00
claude[bot]andMervin Praison cabddd9a22 refactor: extract validation failure decisions to class constant
- Add VALIDATION_FAILURE_DECISIONS constant to avoid duplication
- Update all references to use the constant
- Improve maintainability for future additions

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 16:05:19 +00:00
claude[bot]andMervin Praison 20b838f36a fix: handle non-streaming responses after tool execution for sequential tool calling
- Fixed issue where tool outputs were returned directly to user when stream=False
- Added proper handling for non-streaming responses after tool calls
- Maintains backward compatibility with existing streaming behavior

Fixes #824

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 15:59:04 +00:00
claude[bot]andMervin Praison cf149a3c2d fix: add validation feedback to workflow retry logic
When validation fails, retry tasks now receive:
- The validation failure reason
- The rejected output that failed validation  
- Clear instructions to try a different approach

This allows context-dependent tasks to improve on retry instead of
repeating the same invalid output.

Fixes #827

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 15:24:52 +00:00
Mervin Praison 30f6f5706c Merge pull request #826 from MervinPraison/claude/issue-823-20250711_111524
feat: Implement MCP HTTP Stream transport
2025-07-11 16:05:43 +01:00
claude[bot]andMervin Praison 0423c9c4af fix: address code review issues in HTTP Stream implementation
- Fix error propagation in write_stream method
- Add proper shutdown handling in SSE listener to prevent resource leaks
- Implement proper type annotations based on schema types
- Add _closing flag to gracefully stop SSE listener
- Create basic test to verify transport selection logic

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 14:08:58 +00:00
claude[bot]andMervin Praison be82abfac3 feat: Implement MCP HTTP Stream transport
- Add HTTP Stream transport implementation with single endpoint architecture
- Support both batch (JSON) and stream (SSE) response modes
- Implement session management with Mcp-Session-Id header
- Maintain full backward compatibility with SSE transport
- Add aiohttp dependency for HTTP client functionality
- Create usage examples and test file

Closes #823

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 11:27:37 +00:00
Mervin Praison 4af6228f89 feat: add automated PR review comment workflow for Claude integration 2025-07-11 11:59:45 +01:00
Mervin Praison 33eaf34ffb feat: bump PraisonAI to v2.2.50 and add Gemini agent tools implementation 2025-07-11 11:50:25 +01:00
Mervin Praison e2512b38c0 Merge pull request #814 from Dhivya-Bharathy/grok4-10-new-agents
Add 10 New Grok4 Intelligent Agents Covering Diverse Domains
2025-07-11 11:46:42 +01:00
Mervin Praison b02cda252d Merge pull request #819 from MervinPraison/claude/issue-818-20250711_091438
fix: enable tool calling for Gemini models
2025-07-11 11:42:43 +01:00
Mervin Praison 2a4b369e15 Rename test_tool_fix_improved.py to src/praisonai/tests/unit/test_tool_fix_improved.py 2025-07-11 11:42:29 +01:00
Mervin Praison c0a9e55f6a Rename test_tool_fix_example.py to src/praisonai/tests/unit/test_tool_fix_example.py 2025-07-11 11:42:12 +01:00
Mervin Praison 7c4b28885d Rename test_tool_fix_documentation.md to src/praisonai/tests/unit/test_tool_fix_documentation.md 2025-07-11 11:41:56 +01:00
Mervin Praison b0ec8b9a22 Rename test_gemini_tool_choice.py to src/praisonai/tests/unit/test_gemini_tool_choice.py 2025-07-11 11:41:32 +01:00
Mervin Praison 1b5cf2baea Rename test_async_gemini_fix.py to src/praisonai/tests/unit/test_async_gemini_fix.py 2025-07-11 11:41:19 +01:00
claude[bot]andMervin Praison b1cc2c31ce fix: enable tool calling for async agents with Gemini models
- Created _build_system_prompt method to centralize system prompt generation
- Fixed async achat to use correct tools parameter (was always using self.tools)
- Both sync and async now use enhanced system prompt with tool information
- Added comprehensive async agent test to verify the fix

This resolves the issue where async agents would claim no internet access
even when tools were available.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 10:15:56 +00:00
claude[bot]andMervin Praison 2a40c57033 feat: enhance Gemini tool calling fix with improved error handling
- Add comprehensive error handling for tool name extraction
- Support MCP tools with to_openai_tool method
- Improve Gemini model detection to handle variants
- Add litellm.supports_function_calling check
- Fix potential TypeError with nested dictionary access
- Update documentation with improvements
- Add comprehensive test example

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 09:59:39 +00:00
claude[bot]andMervin Praison 350d6e6488 fix: improve Gemini tool calling implementation
- Fix model prefix inconsistency (add 'gemini-' prefix check)
- Add debug logging when tool_choice='auto' is set for Gemini models
- Add error handling for tool name extraction
- Add test to verify tool_choice behavior for different models

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 09:54:05 +00:00
Mervin Praison 20a49ffd70 refactor: optimise test_autoagents.py for clarity and consistency
- Updated tool configurations to use string names instead of Mock objects for better clarity.
- Simplified the test for custom API key and base URL, ensuring parameters are stored correctly.
- Enhanced comments to improve understanding of the test setup and expected behaviour.

These changes improve the readability and maintainability of the test suite while ensuring accurate validation of configurations.
2025-07-11 10:42:57 +01:00
Mervin Praison 4bf9916c5f refactor: update test_autoagents.py to improve validation scenarios
- Introduced an invalid configuration to simulate validation failures in tests.
- Updated the first response to reflect the new invalid config structure.
- Simplified mock client configuration by using a sample valid config for structured output.

These changes enhance the robustness of the test cases while ensuring clarity in error handling scenarios.
2025-07-11 10:36:17 +01:00
claude[bot]andMervin Praison 9764483f36 fix: enable tool calling for Gemini models
- Enhanced system prompt to explicitly mention available tools
- Added tool_choice='auto' for Gemini models to encourage tool usage
- Maintains full backward compatibility
- Added test example and documentation

Fixes #818 where agents using Gemini models were not calling tools

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 09:27:37 +00:00
Mervin Praison ff405be834 refactor: enhance test_autoagents.py with improved mock configuration
- Updated the first response to use a malformed JSON string for clarity in error simulation.
- Introduced a serializable configuration for the mock client to ensure valid data handling in tests.
- Enhanced comments for better understanding of the test setup and scenarios.

These changes improve the clarity and robustness of the test cases while maintaining the integrity of the testing framework.
2025-07-11 10:23:21 +01:00
Mervin Praison 6d384a96ca refactor: improve test_autoagents.py for clarity and validation
- Updated comments for better understanding of test cases.
- Modified task configuration to create a valid config before simulating error conditions.
- Changed patch references from 'praisonaiagents.agents.autoagents.supports_structured_outputs' to 'praisonaiagents.llm.supports_structured_outputs' for consistency across tests.

These changes enhance the readability and maintainability of the test suite while ensuring accurate validation scenarios.
2025-07-11 10:18:13 +01:00
Mervin Praison 6770996c8b Merge pull request #812 from MervinPraison/claude/issue-795-20250710_222918
Claude/issue 795 20250710 222918
2025-07-11 10:06:12 +01:00
claude[bot]andMervin Praison 93c7731ccb fix: resolve code quality issues and unreachable code in agent.py
- Remove unused variable final_response_text
- Fix multimodal prompt normalization fallback to use empty string instead of str(prompt)
- Fix inconsistent variable usage: use original_prompt instead of prompt in display_interaction and _apply_guardrail_with_retry calls
- Remove unnecessary f-string where no interpolation is needed
- Fix unused exception variable by removing 'as e' where e is not used

These changes improve code quality while maintaining backward compatibility and ensuring the handoff fix continues to work correctly.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 08:29:20 +00:00
Mervin Praison 2057c68a20 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into pr-812-handoff-fix 2025-07-11 09:16:11 +01:00
Mervin Praison 1ca928a2e4 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-11 09:09:32 +01:00
Mervin Praison 66ea9d7148 fix: enhance unit tests for AutoAgents class
- Added dynamic import handling for AutoAgents and related classes to prevent ImportError.
- Refactored test cases to create AutoAgents instances without invoking __init__ to avoid unnecessary API calls.
- Improved mock handling in tests to ensure proper validation and response checks.
- Ensured structured output support is correctly mocked across various test scenarios.
- Maintained existing functionality while optimising test structure for clarity and maintainability.
2025-07-11 09:09:31 +01:00
Mervin Praison 74a71807a6 Merge pull request #816 from MervinPraison/claude/issue-813-20250711_070340
fix: add missing HostedMCPServer class for MCP server implementations
2025-07-11 09:06:39 +01:00
Mervin Praison 9e92e85a72 Update pyproject.toml 2025-07-11 08:53:35 +01:00
Mervin Praison 6d827a45c8 Update pyproject.toml 2025-07-11 08:53:01 +01:00
Mervin Praison aabaaa6318 Update pyproject.toml 2025-07-11 08:52:38 +01:00
Mervin Praison f518bd301a Update pyproject.toml 2025-07-11 08:52:14 +01:00
Mervin Praison 834f710cf6 chore: update PraisonAI and related package versions to 2.2.49 and 0.0.123
- Updated PraisonAI version from 2.2.48 to 2.2.49 across Dockerfiles, README, and Ruby formula.
- Incremented praisonaiagents version from 0.0.122 to 0.0.123 in relevant files.
- Ensured consistency in package versions for improved stability and functionality.
2025-07-11 08:50:14 +01:00
Mervin Praison ede71a7fbe Merge pull request #817 from MervinPraison/claude/issue-815-20250711_070741
fix: resolve SyntaxError in autoagents.py
2025-07-11 08:47:11 +01:00
claude[bot]andMervin Praison 7c751c88a3 fix: resolve test failures in autoagents.py
- Use client.parse_structured_output instead of client.beta.chat.completions.parse
- Change llm_instance.response to llm_instance.get_response for structured output support
- Fixes AttributeError: 'OpenAIClient' object has no attribute 'beta'
- Fixes TypeError: Object of type ModelMetaclass is not JSON serializable

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:42:53 +00:00
claude[bot]andMervin Praison 17f3aab1e1 refactor: complete moving HostedMCPServer to examples folder
- Add hosted_server.py to examples/python/custom_tools/
- Update documentation to clarify this is an example implementation
- Keep starlette dependency as it's still used by Agent.launch() for MCP

This makes HostedMCPServer an example implementation rather than
a core package component.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:41:27 +00:00
claude[bot]andMervin Praison 028fa8158d refactor: move HostedMCPServer from core package to examples folder
- Move hosted_server.py to examples/python/custom_tools/
- Update import in mcp_server_latency_example.py to use local file
- Remove HostedMCPServer from core package exports

This keeps HostedMCPServer as an example implementation rather than
a core package component, as requested.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:39:24 +00:00
claude[bot]andMervin Praison c62685adc5 fix: remove dead code and add missing reflection continuation logic
- Remove unreachable code after while True loop (lines 1414-1429)
- Add missing reflection continuation code for non-satisfactory reflections
- Fix unnecessary f-string prefix in error message
- Fixes syntax error preventing test imports

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:29:52 +00:00
claude[bot]andMervin Praison 60d6178310 fix: add missing newline at end of autoagents.py to prevent parser errors
Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:26:59 +00:00
claude[bot]andMervin Praison b198154b71 fix: resolve SyntaxError and improve code structure in autoagents.py
- Fixed incorrect indentation causing SyntaxError on line 436
- Removed duplicate llm_instance creation and OpenAI detection logic
- Cleaned up nested try-except blocks for better readability
- Preserved backward compatibility with OpenAI structured outputs
- Maintained all error handling and retry mechanisms
- Fixed logic flow to properly check for OpenAI support once per retry

This minimal fix addresses the critical syntax issues while maintaining
all existing functionality.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:26:44 +00:00
claude[bot]andMervin Praison 205de2ba0b fix: improve HostedMCPServer implementation
- Remove unnecessary ABC inheritance and unused imports
- Add proper error handling for uninitialized MCP server
- Improve error messages for better debugging

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:23:48 +00:00
claude[bot]andMervin Praison ee668b2711 fix: resolve code quality issues and unreachable code in agent.py
- Fix unreachable reflection continuation code by moving it outside max reflections if block
- Remove unused variable final_response_text
- Fix unnecessary f-string without placeholders
- Correct prompt normalization: use original_prompt instead of prompt in display/guardrail calls
- Maintain backward compatibility while fixing handoff functionality

These changes address issues identified by multiple code reviewers while preserving
the core fix for handoff functionality (issue #795).

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:23:34 +00:00
claude[bot]andMervin Praison a5bbb65017 fix: resolve IndentationError in autoagents.py
- Fixed indentation issues that caused SyntaxError on line 360
- Removed duplicate OpenAI client initialization logic
- Properly indented the LLM instance creation and response parsing code
- Maintained backward compatibility with existing functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:23:30 +00:00
claude[bot]andMervin Praison 6296755ebb fix: add missing newline at end of autoagents.py to prevent parser errors
Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:21:07 +00:00
claude[bot]andMervin Praison 4b6c847260 fix: resolve SyntaxError in autoagents.py by fixing indentation and uninitialized variables
- Fixed incorrect indentation from line 347 onwards that caused the SyntaxError
- All code from line 347-435 is now properly indented inside the else block
- Added initialization of `use_openai_structured` and `client` variables at the start of each retry loop to prevent NameError
- Preserved duplicate OpenAI detection logic for backward compatibility

Fixes #815

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:19:17 +00:00
Mervin Praison 2fc459fe05 chore: correct string escape sequences in test-core.yml
- Adjusted escape sequences for environment variable retrieval and print statements to ensure proper formatting and clarity in the workflow file.
2025-07-11 08:18:05 +01:00
Mervin Praison 1c3c2941cc chore: enhance review comments in automated workflows for clarity
- Updated the body of comments in auto-issue-comment.yml and auto-pr-comment.yml to include a note on minimal code changes, ensuring clarity while maintaining guidance for backward compatibility and testing.
2025-07-11 08:15:20 +01:00
Mervin Praison 6e38a88cd3 chore: optimise variable initialisation in autoagents.py
- Removed unnecessary initialisation of variables and streamlined the handling of OpenAI client instances to enhance code clarity and maintainability while ensuring backward compatibility.
2025-07-11 08:12:51 +01:00
claude[bot]andMervin Praison f0f22bb13d fix: add missing HostedMCPServer class for MCP server implementations
- Created HostedMCPServer base class in mcp/hosted_server.py
- Added HostedMCPServer to module exports in __init__.py
- Added starlette>=0.27.0 to MCP optional dependencies
- Fixes ImportError when using mcp_server_latency_example.py

Resolves #813

Co-authored-by: Mervin Praison <[email protected]>
2025-07-11 07:12:31 +00:00
Mervin Praison a8fa70c455 chore: refine review comment in automated issue workflow
- Adjusted the body of the comment in auto-issue-comment.yml to enhance clarity by removing redundant phrases while ensuring guidance for backward compatibility and testing remains intact.
2025-07-11 08:11:37 +01:00
Mervin Praison 1b4b4a10b5 chore: update review comment in automated PR workflow for multi-agent analysis
- Modified the body of the comment in auto-pr-comment.yml to include instructions for reviewing pull requests with multiple parallel running agents, ensuring clarity while maintaining guidance for backward compatibility and testing.
2025-07-11 08:11:20 +01:00
devops-vestradata 1efdaac18f Add 10 new Grok4 intelligent agents 2025-07-11 12:29:26 +05:30
Mervin Praison 1b2182968f chore: simplify review comment in automated PR workflow
- Revised the body of the comment in auto-pr-comment.yml to streamline instructions for review, removing redundant phrases while maintaining clarity and guidance for backward compatibility and testing.
2025-07-11 01:16:13 +01:00
claude[bot]andMervin Praison 5e5a10589e fix: correct syntax error - fix indentation of lines 1404-1411 to be inside try block
The code from lines 1404-1411 was incorrectly outside the try block that starts at line 1325, causing a syntax error when the except block at line 1413 tried to match with it. This fix properly indents these lines to be inside the try block.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:59:40 +00:00
claude[bot]andMervin Praison 6c5e42762f fix: comprehensive fix for all try-except block indentation issues
- Fixed indentation of except block at line 1413 to match its try block
- Moved except block at line 1419 and subsequent code inside the while loop
- Properly structured all nested try-except blocks to prevent syntax errors
- Ensured the handoff fix (user message added before LLM call) is preserved

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:55:28 +00:00
claude[bot]andMervin Praison afb7e47080 fix: correct syntax error - fix indentation of except block at line 1413
The except block was indented with 28 spaces instead of 24 spaces to match its corresponding try block, causing a SyntaxError

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:50:32 +00:00
claude[bot]andMervin Praison e674a2ae84 fix: correct syntax errors and add missing guardrail validation to achat()
- Fix indentation of except block at line 1413 (20 spaces -> 24 spaces)
- Add guardrail validation to achat() method for both custom LLM and OpenAI paths
- Ensure feature parity between sync chat() and async achat() methods

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:46:10 +00:00
Mervin Praison d471d9754a chore: enhance automated comment workflows with additional guidance
- Updated the body of comments in both auto-issue-comment.yml and auto-pr-comment.yml to include instructions for using @web for information retrieval and testing code execution if necessary.
2025-07-11 00:39:27 +01:00
claude[bot]andMervin Praison 9d25b1ed3d fix: correct syntax error in agent.py - add missing except block
The try block at line 1249 (inside the while loop) was missing its 
corresponding except block. Added proper exception handling to close
the try block and re-raise exceptions to the outer handler.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:37:43 +00:00
claude[bot]andMervin Praison d0d04bc17e fix: add missing guardrail validation and error handling to achat() async method
- Add guardrail validation to all return points in achat() method (except JSON/Pydantic outputs)
- Add try-except wrapper around while loop in OpenAI path for proper error recovery
- Ensure chat history rollback on all failure paths in async method
- Maintain feature parity between sync chat() and async achat() methods

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:36:32 +00:00
Mervin Praison 1f4e2b1c5a chore: update github-token in automated comment workflows
- Changed the token reference from GITHUB_TOKEN to GH_TOKEN in both auto-issue-comment.yml and auto-pr-comment.yml for consistency in authentication.
2025-07-11 00:32:09 +01:00
claude[bot]andMervin Praison 88d4241121 fix: correct syntax error in agent.py - proper indentation for try-except block
Fixed syntax error at line 1361 where code was not properly indented inside the try block.
The code from lines 1361-1412 needed to be indented by 4 spaces to be inside the try
block that starts at line 1325.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:31:31 +00:00
Mervin Praison 9e081e9413 chore: add github-token to automated comment workflows
- Included github-token in both auto-issue-comment.yml and auto-pr-comment.yml to ensure proper authentication for comment creation.
2025-07-11 00:30:18 +01:00
Mervin Praison bc0449b8de Merge pull request #803 from MervinPraison/claude/issue-792-20250710_221133
fix: replace prefix-based model detection with capability-based detection
2025-07-11 00:26:33 +01:00
Mervin Praison c262942ba7 Merge branch 'main' into claude/issue-792-20250710_221133 2025-07-11 00:26:18 +01:00
Mervin Praison 40e5c13f47 chore: update PraisonAI version to 2.2.48 in Dockerfiles, README, and related files 2025-07-11 00:23:41 +01:00
Mervin Praison 5eea991a60 Merge pull request #801 from MervinPraison/claude/issue-798-20250710_224150
fix: update AutoAgents prompt to generate proper TaskConfig objects
2025-07-11 00:19:27 +01:00
claude[bot]andMervin Praison 209c2a42ae fix: correct syntax errors in try-except block indentation
- Fix indentation of reflection prompt code block (lines 1316-1323)
- Fix indentation of try-except blocks for self-reflection (lines 1325-1418)
- Fix indentation of code inside if-else statements for custom LLM vs OpenAI
- Fix indentation of final logging and guardrail validation code

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:18:25 +00:00
Mervin Praison efb927137f refactor: remove unused autoagents-tools.py file
- Deleted the autoagents-tools.py file as it contained redundant code and instances of AutoAgents that are no longer needed.
2025-07-11 00:17:10 +01:00
claude[bot]andMervin Praison 162223162f test: add comprehensive unit tests for AutoAgents validation and retry logic
- Add test coverage for _validate_config method
- Test successful config generation via OpenAI and LLM paths
- Test retry mechanism with validation failures
- Test edge cases like max_agents truncation and warnings
- Mock LLM responses to avoid API calls in tests

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:15:15 +00:00
claude[bot]andMervin Praison 75c856b948 fix: correct syntax errors in try-except block indentation
- Fixed indentation issues in chat() method where code was not properly indented inside try blocks
- Fixed duplicate except block that was causing syntax errors
- Added missing chat history management to async achat() method for OpenAI client path
- Ensured all try-except blocks are properly structured and closed

This resolves the SyntaxError preventing module import and test execution.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:11:36 +00:00
claude[bot]andMervin Praison 85fefac429 fix: add missing duplicate prevention and error rollback in achat() OpenAI path
- Add duplicate message prevention for async OpenAI client path
- Add chat history rollback on errors in achat() method
- Ensure consistent behavior between sync and async methods
- Handle edge case where chat_history_length might not be defined

This completes the fix by ensuring both sync and async methods have
identical error handling and duplicate prevention logic.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:10:39 +00:00
claude[bot]andMervin Praison 35b9d46bdf feat: add validation and retry mechanism for AutoAgents config generation
- Add _validate_config method to ensure tasks are proper TaskConfig objects
- Implement retry logic with up to 3 attempts
- Include previous response and error in retry prompt for better context
- Add explicit task structure reminder on validation failures

This ensures more robust configuration generation and better error recovery
when LLMs generate incorrect task formats.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:09:16 +00:00
claude[bot]andMervin Praison 5bd3e45be4 fix: add error handling, duplicate prevention, and multimodal normalization for chat_history
- Add chat history rollback on LLM call failures to prevent inconsistent state
- Prevent duplicate user messages in chat history
- Normalize multimodal prompts to store only text content in chat history
- Add thread safety documentation for future consideration
- Apply fixes to both sync (chat) and async (achat) methods
- Handle all error paths including guardrail failures

This ensures chat_history remains consistent even when errors occur, preventing
unpaired user/assistant messages that could break handoff functionality.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 23:01:57 +00:00
Mervin Praison 4c62731e81 Merge branch 'main' into claude/issue-795-20250710_222918 2025-07-10 23:56:44 +01:00
Mervin Praison 544672edea Merge pull request #800 from MervinPraison/claude/issue-796-20250710_222402
fix: handle JSON parsing for Gemini self-reflection
2025-07-10 23:51:12 +01:00
Mervin Praison 72dcc91b3a Rename test_gemini_fix.py to gemini_self_reflection.py 2025-07-10 23:50:51 +01:00
claude[bot]andMervin Praison 75e728f7d7 fix: update AutoAgents prompt to generate proper TaskConfig objects
The validation error was occurring because the LLM was generating tasks as simple strings instead of proper TaskConfig objects. This commit updates the prompt in the _generate_config method to:

1. Include an explicit JSON schema example showing the correct structure
2. Add a clear warning that tasks must be objects with specific fields
3. Provide a concrete example of the task object structure

This ensures tasks are generated with the required fields: name, description, expected_output, and tools.

Fixes #798

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:44:30 +00:00
claude[bot]andMervin Praison 7ddbf98794 fix: add user message to chat_history before LLM call to fix handoff issue
This fix ensures that handoff tools can access the current user message
during execution. Previously, chat_history was updated after the LLM call,
causing handoffs to fail with "no specific task was provided" message.

The fix adds the user message to chat_history before LLM processing in both:
- Custom LLM path
- Standard OpenAI client path

This maintains backward compatibility while fixing the handoff functionality.

Fixes #795

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:36:33 +00:00
Mervin Praison 0213dea12b chore: update PraisonAI version to 2.2.47 in Dockerfiles, README, and related files 2025-07-10 23:30:27 +01:00
claude[bot]andMervin Praison 841a7b52c4 fix: handle JSON parsing for Gemini self-reflection
- Disable streaming for custom LLMs during self-reflection to avoid incomplete JSON chunks
- Add manual JSON parsing for custom LLM reflection responses
- Use clean_json_output method to handle markdown-wrapped JSON
- Ensure reflection regeneration also uses non-streaming for custom LLMs

This fixes the "Expecting property name enclosed in double quotes" error
when using Gemini models with self-reflection enabled.

Fixes #796

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:29:42 +00:00
claude[bot]andMervin Praison 99506e80cf fix: replace prefix-based model detection with capability-based detection
- Created model_capabilities.py with comprehensive lists of models supporting structured outputs
- Updated llm.py to use supports_streaming_with_tools() instead of prefix checks
- Updated autoagents.py to use supports_structured_outputs() instead of prefix checks
- Added proper imports/exports in __init__.py
- Maintains backward compatibility for all existing functionality
- More accurate and maintainable approach than hardcoded prefixes

Fixes #792

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:21:30 +00:00
Mervin Praison c0d495fd48 Merge pull request #781 from MervinPraison/claude/issue-754-20250709_155906
refactor: eliminate sync/async duplication in llm.py
2025-07-10 23:21:04 +01:00
Mervin Praison 0e51ed0d6c Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-10 23:20:50 +01:00
Mervin Praison 32dce14f96 chore: update version to 0.0.120 in pyproject.toml and uv.lock 2025-07-10 23:20:48 +01:00
Mervin Praison 27aaac80c6 Merge branch 'main' into claude/issue-754-20250709_155906 2025-07-10 23:20:17 +01:00
Mervin Praison 5a0a3983e4 Merge pull request #794 from MervinPraison/claude/pr-791-20250710_214815
PR #791: Changes from Claude
2025-07-10 23:19:03 +01:00
claude[bot]andMervin Praison 400a4c934e fix: properly pass base_url and api_key parameters to OpenAI client and agents
- Create new OpenAIClient instance when custom base_url or api_key are provided
- Pass base_url and api_key to Agent instances for consistency
- Maintain backward compatibility by falling back to singleton client when no custom parameters

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:13:29 +00:00
Mervin Praison e88b0fd47b Merge pull request #793 from MervinPraison/claude/issue-754-20250709_155933
refactor: extract debug logging into centralized method
2025-07-10 23:11:57 +01:00
claude[bot]andMervin Praison e6c1c0679f fix: address review comments for debug logging refactor
- Restore backward compatibility for verbose parameter (verbose >= 10 now works)
- Fix condition ordering bug (check "parameters" before "_async")
- Fix API key masking for empty strings
- Add type check for system_prompt truncation
- Add iterable check for tools parameter
- Restore original prompt logging behavior for non-string prompts

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:03:01 +00:00
claude[bot]andMervin Praison 108aee0a54 fix: remove duplicate _handle_ollama_model method and fix double tool call processing
- Remove duplicate _handle_ollama_model method definition
- Fix bug where tool calls were processed twice in verbose streaming
- Keep the method with better type hints (Union[str, List[Dict]])
- Remove redundant _process_tool_calls_from_stream calls after _process_stream_delta

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 22:02:58 +00:00
Mervin Praison cb017aad70 Merge branch 'main' into claude/issue-754-20250709_155906 2025-07-10 22:53:33 +01:00
claude[bot]andMervin Praison ea29d3181b fix: properly handle OpenAI client API and store base_url/api_key
- Use OpenAIClient's parse_structured_output method instead of accessing client.beta directly
- Store base_url and api_key as instance variables to support custom endpoints
- This fixes the AttributeError when using AutoAgents with non-OpenAI providers

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:50:39 +00:00
claude[bot]andMervin Praison 7f0f265671 refactor: eliminate sync/async duplication in llm.py
- Extract common logic into shared helper methods
- Fix variable reference errors for ollama_params
- Reduce code duplication between get_response/get_response_async
- Reduce code duplication between response/aresponse
- Maintain 100% backward compatibility
- No API changes or breaking changes

Fixes #754

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:42:47 +00:00
Mervin Praison bc1c508419 Merge pull request #789 from MervinPraison/claude/issue-787-20250710_205703
fix: prevent double output when using litellm models
2025-07-10 22:37:16 +01:00
Mervin Praison bd108ba3e7 Merge pull request #791 from MervinPraison/claude/issue-788-20250710_210226
fix: add multi-provider support for AutoAgents
2025-07-10 22:34:58 +01:00
claude[bot]andMervin Praison ac5f2649df refactor: resolve merge conflicts with main branch
- Renamed _prepare_ollama_followup to _handle_ollama_model to match main branch
- Updated method signature to (response_text, tool_results, messages, original_prompt)
- Modified return value to dict with follow_up_messages and original_prompt
- Updated all call sites to use the new interface
- Maintained backward compatibility and refactoring benefits

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:34:28 +00:00
claude[bot]andMervin Praison 1b64762d54 fix: add verbose checks to all display_interaction calls for consistency
- Applied consistent pattern to all 4 display_interaction calls
- Now all checks follow pattern: if self.verbose and not self._using_custom_llm
- Ensures display is only shown when verbose mode is enabled AND not using custom LLM
- Maintains backward compatibility while fixing the inconsistency

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:29:45 +00:00
claude[bot]andMervin Praison df402bcfdb fix: correct indentation error in aresponse method
Fixed incorrect indentation in the async Ollama follow-up handling code
that was causing a syntax error at line 1364.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:20:39 +00:00
claude[bot]andMervin Praison 061c8d58b4 fix: add multi-provider support for AutoAgents
- Replace OpenAI-specific beta.chat.completions.parse() with cross-provider LLM class
- Maintain backward compatibility by using structured output for OpenAI models
- Add support for all LiteLLM providers (Gemini, Anthropic, etc.)
- Include robust JSON parsing to handle markdown-wrapped responses
- Fixes #788: AttributeError when using AutoAgent with Gemini provider

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:18:52 +00:00
Mervin Praison 117c02cf30 chore: update PraisonAI and related package versions to 2.2.46 and 0.0.119
- Updated PraisonAI version in Dockerfiles and README to 2.2.46
- Updated version in pyproject.toml and uv.lock for PraisonAI and PraisonAI agents to 0.0.119
- Adjusted deployment script to reflect the new PraisonAI version
2025-07-10 22:16:47 +01:00
claude[bot]andMervin Praison 82c9ff80a7 fix: correct indentation error in get_response method
Fixed incorrect indentation in lines 779-804 of the get_response method
that was causing IndentationError. The code block for Ollama follow-up
handling is now properly nested within the if follow_up_prompt block.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:15:53 +00:00
Mervin Praison f44b15d73b Merge pull request #782 from MervinPraison/claude/issue-754-20250709_155935
refactor: extract streaming chunk processor to eliminate code duplication
2025-07-10 22:13:29 +01:00
claude[bot]andMervin Praison f2c89c2012 fix: prevent double output when using litellm models
- Check for self._using_custom_llm before calling display_interaction
- Custom LLM already handles display in its get_response method
- Fixes issue #787 where task/response printed twice with litellm

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 21:12:41 +00:00
Mervin Praison fd2569e642 chore: update PraisonAI and related package versions to 2.2.45 and 0.0.118
- Updated PraisonAI version in Dockerfiles and README to 2.2.45
- Updated version in pyproject.toml and uv.lock for PraisonAI and PraisonAI agents to 0.0.118
- Adjusted deployment script to reflect the new PraisonAI version
2025-07-10 22:08:47 +01:00
Mervin Praison 58efb4b4cd Merge pull request #783 from MervinPraison/claude/issue-754-20250709_155947
refactor: extract Ollama handler to eliminate code duplication
2025-07-10 22:04:05 +01:00
Mervin Praison 35df78874d chore: update PraisonAI and related package versions to 2.2.44 and 0.0.117
- Updated PraisonAI version in Dockerfiles and README to 2.2.44
- Updated version in pyproject.toml and uv.lock for PraisonAI and PraisonAI agents to 0.0.117
- Adjusted deployment script to reflect the new PraisonAI version
2025-07-10 21:02:01 +01:00
Mervin Praison 4abe80a563 Merge pull request #786 from Dhivya-Bharathy/grok4-intelligent-agents-examples
Add grok4_intelligent_agents Folder to Exa Tool with 5 Agent scripts
2025-07-10 21:00:03 +01:00
Mervin Praison 95c15f52fc Merge pull request #785 from MervinPraison/claude/issue-784-20250710_065335
fix: remove OPENAI_API_KEY requirement for non-OpenAI providers
2025-07-10 20:58:54 +01:00
claude[bot]andMervin Praison 0e2a753cc3 fix: add null safety checks for OpenAI client usage
- Add null check in self-reflection to prevent crash for non-OpenAI providers
- Add null checks in async chat methods before accessing OpenAI client
- Add graceful fallback for self-reflection with custom LLMs
- Add clear error message in AutoAgents explaining it requires OpenAI API
- Ensure non-OpenAI providers can use Agent class without errors

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 18:05:28 +00:00
claude[bot]andMervin Praison 660260c6e6 fix: make OpenAI client initialization lazy for non-OpenAI providers
- Convert unconditional OpenAI client init to lazy property
- Add null safety checks in critical methods
- Provide fallback implementation for message building
- Fix test script by removing non-existent attribute access

This allows using providers like xai/grok-4 without OPENAI_API_KEY

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 13:37:28 +00:00
devops-vestradata f49b5c368c Add grok4_intelligent_agents with 5 agent scripts 2025-07-10 14:53:31 +05:30
claude[bot]andMervin Praison 39f0c40dcc fix: remove client imports from main.py to fix ImportError
- Remove client from imports in agents/agents.py (not used)
- Remove client from imports in autoagents.py and use get_openai_client() instead
- Remove client from imports in process.py and create local OpenAI() instance
- This fixes the ImportError that was blocking tests after removing global client from main.py

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 07:22:42 +00:00
Mervin Praison 27b10ff3ea Rename test_xai_fix.py to src/praisonai/tests/unit/test_xai_fix.py 2025-07-10 08:03:46 +01:00
claude[bot]andMervin Praison f63f247bfe fix: remove OPENAI_API_KEY requirement for non-OpenAI providers
- Remove unnecessary OpenAI client initialization at import time in main.py
- This was blocking users from using other LLM providers (xai, anthropic, etc)
- The OpenAI client is properly initialized when needed in OpenAIClient class
- Clean up unused imports and constants
- Add test script to verify the fix

Fixes #784

Co-authored-by: Mervin Praison <[email protected]>
2025-07-10 07:02:20 +00:00
claude[bot]andMervin Praison f3f5f63b22 refactor: eliminate sync/async duplication in llm.py
- Extract common logic into shared helper methods
- Reduce code duplication between get_response/get_response_async
- Reduce code duplication between response/aresponse
- Maintain 100% backward compatibility
- No API changes or breaking changes

Addresses issue #754

Co-authored-by: Mervin Praison <[email protected]>
2025-07-09 16:07:51 +00:00
claude[bot]andMervin Praison ccf9470f41 refactor: extract debug logging into centralized _log_llm_config method
- Created private _log_llm_config method to handle all debug logging
- Eliminated ~116 lines of duplicated debug logging code
- Maintains 100% backward compatibility (no API changes)
- Centralizes security measures (API key masking)
- Consistent formatting across all logging calls
- No functional changes, only code organization

Addresses code duplication issue #754

Co-authored-by: Mervin Praison <[email protected]>
2025-07-09 16:05:59 +00:00
claude[bot]andMervin Praison 75cf937581 refactor: extract Ollama handler to eliminate code duplication
- Created shared _handle_ollama_model method to consolidate logic
- Updated both sync and async methods to use the shared handler
- Eliminated ~185 lines of duplicated code
- Maintained 100% backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-09 16:04:38 +00:00
claude[bot]andMervin Praison d228a742b7 refactor: extract streaming chunk processor to eliminate code duplication
- Add _process_stream_delta() helper method to consolidate duplicate logic
- Refactor 4 duplicated streaming sections (sync/async, verbose/non-verbose)
- Eliminates ~50 lines of duplicated code
- Maintains 100% backward compatibility with no API changes
- Addresses original issue #754 about streaming code duplication

Co-authored-by: Mervin Praison <[email protected]>
2025-07-09 16:03:24 +00:00
Mervin Praison 1d7e03b03e Merge pull request #779 from Dhivya-Bharathy/add-Domain_Deep_Research_Agent
Add Domain Deep Research Agent Notebook to Research Knowledge QA Agents Folder
2025-07-09 16:55:09 +01:00
Mervin Praison 290570de88 Merge pull request #780 from Dhivya-Bharathy/feature/add-ai-agent-examples
Add 5 domain-specific AI agent examples to exa-tool directory
2025-07-09 16:54:50 +01:00
Mervin Praison 542ea8c10d Merge pull request #778 from Dhivya-Bharathy/add-Game_Playing_Agent_Tic_Tac_Toe
Add Game Playing Agent (Tic Tac Toe) Notebook to Programming Code Analysis Agents Folder
2025-07-09 16:54:22 +01:00
Mervin Praison 843f70b599 Merge pull request #777 from Dhivya-Bharathy/add-News_And_Podcast_Aggregator_Agent
Add News and Podcast Aggregator Agent Notebook to Social Media Content Agents Folder
2025-07-09 16:54:10 +01:00
Mervin Praison dee707299d Merge pull request #776 from Dhivya-Bharathy/add-Financial_Coaching_Agent
Add Financial Coaching Agent Notebook to Finance Market Job Agents Folder
2025-07-09 16:53:50 +01:00
devops-vestradata 7f6e300a9e Add 5 domain-specific AI agent folders (Finance, Health, Programming, Research, Social Media) to exa-tool 2025-07-09 18:51:38 +05:30
Dhivya-Bharathy 88e9de2914 Add Domain_Deep_Research_Agent notebook 2025-07-09 10:49:17 +00:00
Dhivya-Bharathy f17daec68b Add Game_Playing_Agent_Tic_Tac_Toe notebook 2025-07-09 10:35:09 +00:00
Dhivya-Bharathy f4d54d76e8 Add News_And_Podcast_Aggregator_Agent notebook 2025-07-09 10:12:16 +00:00
Dhivya-Bharathy 23e2951724 Add Financial_Coaching_Agent notebook 2025-07-09 09:25:23 +00:00
Mervin Praison 1916b1a108 Merge pull request #775 from Dhivya-Bharathy/add-Air_Quality_Analysis_Agent
Add Air Quality Analysis Agent Notebook to Health Fitness Agents
2025-07-09 10:12:38 +01:00
DhivyaBharathy 5b99ca8357 Delete examples/cookbooks/Health_Fitness_Agents/Air_Quality_Analysis_Agent.ipynb 2025-07-09 14:39:17 +05:30
DhivyaBharathy 09ef400c15 Update Air_Quality_Analysis_Agent.ipynb 2025-07-09 14:38:25 +05:30
DhivyaBharathy d5c381890f Add files via upload 2025-07-09 14:36:29 +05:30
DhivyaBharathy 639e53ea9b Update Air_Quality_Analysis_Agent.ipynb 2025-07-09 14:26:25 +05:30
DhivyaBharathy 0954fb4d3d Update Air_Quality_Analysis_Agent.ipynb 2025-07-09 14:14:53 +05:30
Dhivya-Bharathy f5c35f31e9 Add Air_Quality_Analysis_Agent notebook 2025-07-09 08:34:57 +00:00
Mervin Praison 4f31ec9b63 Update PraisonAI and related dependencies to version 2.2.43 and praisonaiagents to version 0.0.116 across Dockerfiles, README, and project files for consistency and compatibility. 2025-07-09 00:37:21 +01:00
Mervin Praison abee86337d Merge pull request #774 from MervinPraison/claude/pr-773-20250708_232256
fix: add array schema validation to llm.py for MCP tools compatibility
2025-07-09 00:34:52 +01:00
claude[bot]andMervin Praison e6cf4ebfcd fix: add array schema validation to llm.py for MCP tools compatibility
- Add _fix_array_schemas method to recursively fix missing 'items' in array schemas
- Apply fix to pre-formatted tools in _format_tools_for_litellm
- Apply fix to generated tool definitions in _generate_tool_definition
- Ensures OpenAI compatibility for all tool types (MCP, pre-formatted, generated)
- Maintains backward compatibility by only adding missing fields

Related to PR #773

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 23:27:14 +00:00
Mervin Praison 68fb0aaaca Update PraisonAI and related dependencies to version 2.2.42 and praisonaiagents to version 0.0.115 across Dockerfiles, README, and project files for consistency and compatibility. 2025-07-09 00:24:00 +01:00
Mervin Praison 4c9009c3f5 Merge pull request #773 from MervinPraison/claude/pr-772-20250708_230928
fix: comprehensive array schema validation for MCP tools
2025-07-09 00:21:05 +01:00
claude[bot]andMervin Praison ac21e5d595 fix: add comprehensive array schema validation for all tool types
- Add _fix_array_schemas method to recursively fix array schemas
- Apply schema fix to all pre-formatted OpenAI tools in format_tools
- Ensures MCP tools and other external tools have properly formatted array schemas
- Resolves "array schema missing items" error for read_multiple_files and similar functions

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 23:14:56 +00:00
Mervin Praison 58b12b9f24 Merge pull request #772 from MervinPraison/claude/pr-771-20250708_230103
fix: add items property to array parameters in OpenAI tool definitions
2025-07-09 00:05:24 +01:00
claude[bot]andMervin Praison 09dcf9c114 fix: add items property to array parameters in OpenAI tool definitions
- Fix array schema validation error by adding required 'items' property
- Change type comparisons to use 'is' instead of '=='
- Remove unnecessary f-string prefixes where no placeholders exist
- Resolves OpenAI API error: "array schema missing items"

This ensures compatibility with OpenAI's function calling format which
requires array types to specify the type of items they contain.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 23:04:25 +00:00
Mervin Praison e25e0a895f Merge pull request #771 from MervinPraison/claude/issue-752-20250708_223652
refactor: make openai_client.py self-contained like llm.py
2025-07-08 23:58:16 +01:00
Mervin Praison 855ec4c10a Rename test_openai_refactor.py to src/praisonai/tests/unit/test_openai_refactor_2.py 2025-07-08 23:58:02 +01:00
claude[bot]andMervin Praison 2b672f4d40 refactor: make openai_client.py self-contained like llm.py
- Move all data classes from agent.py to openai_client.py
- Add comprehensive completion methods with streaming and tool support
- Add helper methods for message building and tool formatting
- Update agent.py to use openai_client methods
- Export data classes from llm module for easy import
- Add test script to verify refactoring

This makes openai_client.py fully self-contained with all OpenAI-specific
logic, following the same pattern as llm.py for better organization and
maintainability.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 22:51:17 +00:00
Mervin Praison fe24d6bbea Remove test_mcp_fix.py and update PraisonAI and related dependencies to version 2.2.41 and praisonaiagents to version 0.0.114 across Dockerfiles, README, and project files for consistency and compatibility. 2025-07-08 23:28:09 +01:00
Mervin Praison f402ef642b Merge pull request #770 from MervinPraison/claude/pr-766-20250708_222154
fix: convert ToolCall dataclass to dict for JSON serialization
2025-07-08 23:25:55 +01:00
claude[bot]andMervin Praison 7ca9db4d1c fix: convert ToolCall dataclass to dict for JSON serialization
When streaming responses create ToolCall dataclass objects, they need
to be converted to dictionaries before being passed to the OpenAI API
to avoid JSON serialization errors.

This fixes the "Object of type ToolCall is not JSON serializable" error
that occurred after the OpenAI refactoring in PR #766.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 22:24:40 +00:00
Mervin Praison 322f972b5d Merge pull request #769 from MervinPraison/claude/pr-766-20250708_221226
fix: handle both ToolCall dataclass and OpenAI object in tool execution
2025-07-08 23:20:19 +01:00
claude[bot]andMervin Praison 8c50464db0 fix: handle both ToolCall dataclass and OpenAI object in tool execution
After the OpenAI refactoring in PR #766, tool calls from streaming responses
are ToolCall dataclass objects while non-streaming responses return OpenAI
API objects. This fix handles both cases properly to prevent the "'dict' 
object has no attribute 'name'" error.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 22:15:48 +00:00
Mervin Praison 7828697eea Merge pull request #768 from MervinPraison/claude/issue-767-20250708_220427
fix: handle MCP tools returning lists in agent.py
2025-07-08 23:15:01 +01:00
claude[bot]andMervin Praison 4e89a5f6db fix: handle MCP tools returning lists in agent.py
- Fixed issue where MCP's to_openai_tool() returns a list of tools but agent.py was expecting a single tool
- Now properly extends the formatted_tools list when MCP returns multiple tools
- Maintains backward compatibility for single tool returns
- Added test script to verify the fix

Fixes #767

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 22:10:06 +00:00
Mervin Praison 8692a04551 Merge pull request #766 from MervinPraison/claude/issue-752-20250708_213500
refactor: separate OpenAI logic from agent.py into llm/openai_client.py
2025-07-08 23:08:25 +01:00
Mervin Praison da51c0ae63 Rename test_openai_refactor.py to src/praisonai/tests/unit/test_openai_refactor.py 2025-07-08 22:59:08 +01:00
claude[bot]andMervin Praison 77b2db24cc refactor: separate OpenAI logic from agent.py into llm/openai_client.py
- Created OpenAIClient class in llm/openai_client.py to encapsulate all OpenAI logic
- Removed direct OpenAI imports from agent.py
- Updated all OpenAI client references to use centralized client
- Added ToolCall dataclass to replace OpenAI's ChatCompletionMessageToolCall
- Maintained backward compatibility with existing API
- Created test script to verify the refactoring

This change follows the same modular pattern as litellm in llm.py, improving code organization and maintainability.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 21:54:34 +00:00
Mervin Praison 9569d1fefa Merge pull request #765 from MervinPraison/claude/issue-752-20250708_204518
refactor: Sync agent.py with llm.py patterns - Phase 1
2025-07-08 22:14:04 +01:00
claude[bot]andMervin Praison 84201195f7 fix: Replace shallow copy with deep copy in _build_messages()
- Added import copy to both agent.py and test file
- Changed prompt.copy() to copy.deepcopy(prompt) to prevent mutation of original objects
- Ensures nested dictionaries in multimodal prompts are not modified

This fixes the issue where modifying item["text"] would mutate the original prompt objects.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 21:11:38 +00:00
Mervin Praison 850b7bfd7b Rename test_agent_refactor.py to src/praisonai/tests/unit/test_agent_refactor.py 2025-07-08 22:02:42 +01:00
claude[bot]andMervin Praison 77532114ec refactor: Sync agent.py with llm.py patterns - Phase 1
- Added _build_messages() helper to consolidate message building logic
- Added _format_tools_for_completion() helper to handle all tool formats
- Updated chat() and achat() to use _build_messages()
- Updated _chat_completion() and achat() to use _format_tools_for_completion()
- Removed ~105 lines of duplicated code
- 100% backward compatible - no breaking changes
- Added comprehensive test script to verify functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 20:59:43 +00:00
Mervin Praison 2882af376e chore: Update PraisonAI to version 2.2.40 and PraisonAI Agents to version 0.0.113 across Dockerfiles and project files for consistency and improved functionality. 2025-07-08 21:41:46 +01:00
Mervin Praison 19482e9163 Merge pull request #764 from MervinPraison/claude/issue-752-20250708_191412
refactor: Add full tool format support to async method
2025-07-08 21:35:20 +01:00
claude[bot]andMervin Praison 0741b523b8 fix: Update tool formatting to handle callable functions from any module
- Modified _format_tools_for_litellm to pass function objects instead of names
- Updated _generate_tool_definition to accept both function objects and names
- This fixes test failures where functions weren't found in globals()

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 20:25:51 +00:00
Mervin Praison d63d564649 Fix import path in test_phase2_refactor.py to ensure correct module access for LLM class 2025-07-08 21:17:46 +01:00
claude[bot]andMervin Praison 88ae3a26fb fix: Add defensive validation and fix test import path
- Add validation for nested dictionary keys to prevent KeyError
- Add JSON serialization validation to ensure tools are serializable  
- Fix import path in test_async_tool_formats.py
- Improves robustness of tool formatting

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 20:13:42 +00:00
Mervin Praison 74ef96b9f6 Rename src/praisonai/tests/test_async_tool_formats.py to src/praisonai/tests/unit/test_async_tool_formats.py 2025-07-08 20:54:29 +01:00
Mervin Praison 12270a56d7 Rename test_async_tool_formats.py to src/praisonai/tests/test_async_tool_formats.py 2025-07-08 20:54:00 +01:00
claude[bot]andMervin Praison c79eedc8ec refactor: Add full tool format support to async method
- Created _format_tools_for_litellm() helper method to handle all tool formats
- Updated sync get_response() to use the shared helper 
- Updated async get_response_async() to use the shared helper
- Async now supports: pre-formatted tools, lists, string names (previously unsupported)
- Removed ~95 lines of duplicate code (4.6% reduction)
- Zero breaking changes - all functionality preserved

Fixes async tool format parity issue from #752

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 19:25:29 +00:00
Mervin Praison 98874da689 Update PraisonAI to version 2.2.39 and PraisonAI Agents to version 0.0.112 across Dockerfiles and project files for consistency and improved functionality. 2025-07-08 19:37:21 +01:00
Mervin Praison 6f019de05c Merge pull request #761 from MervinPraison/claude/issue-752-20250708_181532
refactor: Phase 2 - Extract shared _build_messages helper
2025-07-08 19:31:50 +01:00
Mervin Praison a03d288e01 Rename test_phase2_refactor.py to src/praisonai/tests/test_phase2_refactor.py 2025-07-08 19:31:19 +01:00
claude[bot]andMervin Praison 03c23021ab refactor: extract shared _build_messages helper to reduce code duplication
Phase 2 implementation to reduce code duplication in LLM class:
- Added _build_messages() helper method to consolidate message building logic
- Updated all 4 methods to use the shared helper:
  - get_response() (sync)
  - response() (sync)
  - get_response_async() (async)
  - aresponse() (async)
- Removed ~40 lines of duplicated code
- No breaking changes - all functionality preserved
- Added test script to verify backward compatibility

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 18:26:45 +00:00
Mervin Praison 0178ec807e Merge pull request #731 from Dhivya-Bharathy/add-talk2find_voice_agent_demo
Add Talk2find Voice Agent Notebook
2025-07-08 19:25:03 +01:00
Mervin Praison 922362bd4c Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-07-08 19:23:56 +01:00
Mervin Praison 2e8b9cbf29 Update PraisonAI to version 2.2.38 and PraisonAI Agents to version 0.0.111 across Dockerfiles and project files for consistency and improved functionality. 2025-07-08 19:23:54 +01:00
Mervin Praison b79197b3a6 Merge pull request #757 from Dhivya-Bharathy/add-cookbook-folders
Add Cookbook Folders
2025-07-08 19:16:00 +01:00
Mervin Praison c056c3b65d Merge pull request #759 from MervinPraison/claude/issue-758-20250708_175805
fix: Resolve TypeError in COT agents with telemetry
2025-07-08 19:02:50 +01:00
Mervin Praison 965df5296f Delete cot-agents.py 2025-07-08 19:02:37 +01:00
claude[bot]andMervin Praison a8810cf4de fix: Resolve TypeError in COT agents with telemetry
- Add telemetry disable flag to cot-agents.py as minimal workaround
- Fix type comparison bug in telemetry integration by adding isinstance check
- This prevents string task_id from being compared with integer length

Fixes #758

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 18:01:19 +00:00
devops-vestradata 4e50fab7f8 Remove duplicate Ai_Market_Startup_Trend_Agent.ipynb from cookbooks root 2025-07-08 19:07:36 +05:30
devops-vestradata 041feb6ec9 Merge remote-tracking branch 'upstream/main'
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2025-07-08 18:48:41 +05:30
DhivyaBharathy 1fafaf8758 Add files via upload 2025-07-08 18:19:56 +05:30
DhivyaBharathy a056015b4b Delete examples/cookbooks/Vision_Multimodal_Agents/Bert_Whisper_Agent.ipynb 2025-07-08 18:19:44 +05:30
DhivyaBharathy 80e27a7cb7 Add files via upload 2025-07-08 18:15:30 +05:30
DhivyaBharathy ac59fcf65e Delete examples/cookbooks/Research_Knowledge_QA_Agents/ArXiv_Agent_Notebook.ipynb 2025-07-08 18:15:13 +05:30
DhivyaBharathy a55db3f2c1 Add files via upload 2025-07-08 18:12:40 +05:30
DhivyaBharathy feafe6185d Delete examples/cookbooks/Research_Knowledge_QA_Agents/AI-CourtSimulation.ipynb 2025-07-08 18:12:26 +05:30
DhivyaBharathy e052f4ab97 Add files via upload 2025-07-08 18:09:15 +05:30
DhivyaBharathy a8b94c8c8e Add files via upload 2025-07-08 18:06:09 +05:30
DhivyaBharathy d5270d5f13 Add files via upload 2025-07-08 18:03:42 +05:30
DhivyaBharathy 9462b2409e Delete examples/cookbooks/Programming_Code_Analysis_Agents/MistralTechAgent.ipynb 2025-07-08 18:03:27 +05:30
DhivyaBharathy 5da1ba7387 Delete examples/cookbooks/Programming_Code_Analysis_Agents/Code_Analysis_Agent.ipynb 2025-07-08 18:00:17 +05:30
DhivyaBharathy 7567145042 Delete examples/cookbooks/Conversational_Chat_Agents/Qwen_Colab_Agent.ipynb 2025-07-08 17:55:43 +05:30
devops-vestradata ca83ea5548 Recreate Qwen_Colab_Agent.ipynb from scratch: valid JSON, no widgets, no duplicates, clean structure 2025-07-08 17:56:05 +05:30
devops-vestradata 84e880ccdb Resolve merge conflict: keep fixed Qwen_Colab_Agent.ipynb (remove widgets, duplicates, ensure valid JSON) 2025-07-08 17:51:22 +05:30
devops-vestradata d20247f628 Fix Qwen_Colab_Agent.ipynb: Remove duplicates, widgets metadata, and ensure valid JSON 2025-07-08 17:49:36 +05:30
DhivyaBharathy 9794047182 Update Qwen_Colab_Agent.ipynb 2025-07-08 17:39:33 +05:30
devops-vestradata 7292182a16 Organized all cookbooks .ipynb files into categorized folders and fixed invalid notebook metadata. 2025-07-08 17:36:20 +05:30
devops-vestradata 94f2f92577 Remove duplicate e-commerce notebook. Now 60 cookbooks .ipynb files. 2025-07-08 16:57:09 +05:30
DhivyaBharathy f6ae1d2c5f Rename voiGno_Restaurant_Agent_PraisonAI.ipynb to VoiGno_Restaurant_Agent_PraisonAI.ipynb 2025-07-08 16:48:28 +05:30
DhivyaBharathy cfe948e7ef Rename arXiv_agent_notebook.ipynb to ArXiv_Agent_Notebook.ipynb 2025-07-08 16:47:53 +05:30
devops-vestradata 3e18a5c591 Force Git to recognize PascalCase renames for all notebooks 2025-07-08 16:46:32 +05:30
DhivyaBharathy 498e6a4dbf Rename ai_data_analysis_agent.ipynb to AI_Data_Analysis_Agent.ipynb 2025-07-08 16:19:47 +05:30
Mervin Praison 5ff64d2c10 Merge pull request #755 from Dhivya-Bharathy/add-Ai_Market_Startup_Trend_Agent
Add AI Market & Startup Trend Agent Notebook
2025-07-08 11:11:17 +01:00
DhivyaBharathy af5556a235 Merge branch 'main' into add-Ai_Market_Startup_Trend_Agent 2025-07-08 13:10:23 +05:30
Dhivya-Bharathy 2d27264bab Add Ai_Market_Startup_Trend_Agent notebook 2025-07-08 07:38:28 +00:00
DhivyaBharathy ed443583b2 Rename cleaned_ai_market_startup_trend_agent.ipynb to ai_market_startup_trend_agent.ipynb 2025-07-08 13:05:30 +05:30
Mervin Praison c0c6eed552 Update PraisonAI and related dependencies to version 2.2.37 and PraisonAI Agents to version 0.0.110 across Dockerfiles and project files for consistency and improved functionality. 2025-07-08 08:34:15 +01:00
DhivyaBharathy 54da62213a Add files via upload 2025-07-08 13:04:12 +05:30
DhivyaBharathy 9efed5b4c7 Add files via upload 2025-07-08 13:01:16 +05:30
Mervin Praison bd2774d44c Merge pull request #753 from MervinPraison/claude/issue-752-20250708_064933
fix: eliminate double API calls when using tools with streaming
2025-07-08 08:25:40 +01:00
Mervin Praison 89bbc960dd Rename test_double_api_fix.py to src/praisonai/tests/test_double_api_fix.py 2025-07-08 08:25:25 +01:00
claude[bot]andMervin Praison 8214b8ac04 fix: eliminate double API calls when using tools with streaming
- Add _supports_streaming_tools() to detect provider capabilities
- Modify sync/async get_response to capture tool calls from streaming
- Reduce API costs by 50% and improve latency by 1-3 seconds
- Add test script to verify the optimization

Fixes #752

Co-authored-by: Mervin Praison <[email protected]>
2025-07-08 07:06:13 +00:00
Mervin Praison 9d01b277a5 fix: revert previous provider pattern implementation due to issues
This commit reverts the changes made in the previous provider pattern implementation to address identified problems. The aim is to restore stability while further investigating the issues with lightweight/heavy LLM support.
2025-07-08 07:57:21 +01:00
DhivyaBharathy f1cb5df3aa Add files via upload 2025-07-08 11:34:31 +05:30
DhivyaBharathy ab7d5cc5cc Add files via upload 2025-07-08 11:08:22 +05:30
DhivyaBharathy 8b03c399f6 Add files via upload 2025-07-08 10:51:33 +05:30
DhivyaBharathy 8ca1104850 Add files via upload 2025-07-08 10:16:37 +05:30
Mervin Praison 0c8efc283e Merge pull request #747 from MervinPraison/revert-743-claude/issue-739-20250707_123216
Revert "feat: implement provider pattern for lightweight/heavy LLM support"
2025-07-07 22:00:48 +01:00
Mervin Praison c560957a38 Revert "feat: implement provider pattern for lightweight/heavy LLM support" 2025-07-07 22:00:38 +01:00
Mervin Praison 5c73595f22 Merge pull request #743 from MervinPraison/claude/issue-739-20250707_123216
feat: implement provider pattern for lightweight/heavy LLM support
2025-07-07 21:57:51 +01:00
Mervin Praison a88ea82bf0 Rename test_provider_pattern.py to src/praisonai/tests/unit/test_provider_pattern.py 2025-07-07 21:57:12 +01:00
Mervin Praison 9e35d6e46b Rename test_parallel_provider_pattern.py to src/praisonai/tests/unit/test_parallel_provider_pattern.py 2025-07-07 21:56:27 +01:00
Mervin Praison 4cc7ee7cfb Rename test_multi_agent_workflow.py to src/praisonai/tests/unit/test_multi_agent_workflow.py 2025-07-07 21:56:03 +01:00
claude[bot]andMervin Praison 1f260f419f fix: implement thread-safe provider pattern with parallel execution support
- Fix thread-unsafe environment variable mutations in litellm_provider.py
  - Add thread-safe lazy loading with double-check pattern
  - Pass API keys per-request instead of modifying os.environ
  - Move global LiteLLM configuration to one-time initialization

- Complete provider abstraction in llm.py
  - Replace all direct litellm.completion calls with provider calls
  - Add missing _build_completion_params method
  - Update capability checking methods to use provider instance

- Add comprehensive test suites
  - test_parallel_provider_pattern.py: Thread-safety and race condition tests
  - test_multi_agent_workflow.py: Real-world parallel execution scenarios
  - Update test_provider_pattern.py with better assertions

- Clean up unused imports from all provider files

This enables safe parallel execution of multiple agents with different API keys
and configurations without race conditions or cross-contamination.

Co-authored-by: Mervin Praison <[email protected]>
2025-07-07 19:01:54 +00:00
Mervin Praison ef0e3529e4 Merge pull request #745 from MervinPraison/claude/issue-744-20250707_174818
feat: Add examples for documented features
2025-07-07 19:16:59 +01:00
claude[bot]andMervin Praison eafc33976c feat: Add examples for documented features
Add comprehensive examples for:
- Chat with PDF functionality
- Code Agent with self-reflection and tools
- Math Agent for calculations and problem solving
- Routing patterns (conditional, loops, decision trees)
- Self-reflection details and configuration
- Reasoning extraction (Chain of Thought, patterns)

These examples demonstrate the features documented in https://docs.praison.ai/

Co-authored-by: Mervin Praison <[email protected]>
2025-07-07 17:56:14 +00:00
claude[bot]andMervin Praison dd6e1e1309 feat: implement provider pattern for lightweight/heavy LLM support
- Add provider pattern under llm/providers/ for smart LLM selection
- Create OpenAI provider for lightweight mode (~500KB) 
- Create LiteLLM provider for full multi-provider support (~2.5MB)
- Update LLM class to use providers instead of direct litellm calls
- Update Agent class to always use LLM wrapper (no more direct client)
- Remove global OpenAI client from main.py (deprecated)
- Add provider factory for intelligent provider selection
- Support PRAISONAI_LLM_PROVIDER env var for provider override
- Maintain full backward compatibility - no API changes
- Add test script to verify provider pattern implementation

Benefits:
- Lightweight by default for OpenAI-only users
- Full LiteLLM features available when needed
- Seamless provider switching
- Reduced import time and memory usage for simple cases

Co-authored-by: Mervin Praison <[email protected]>
2025-07-07 12:49:48 +00:00
DhivyaBharathy 952e59e07a Add files via upload 2025-07-07 17:24:11 +05:30
Mervin Praison 730ee778dc Merge pull request #740 from MervinPraison/claude/issue-737-20250707_104724
fix: critical security vulnerabilities in tools
2025-07-07 12:50:52 +01:00
claude[bot]andMervin Praison 3cd664bf7b fix: critical security vulnerabilities in tools
- Fixed command injection in shell_tools.py by forcing shell=False
- Implemented sandboxed execution in python_tools.py with restricted builtins
- Fixed SQL injection in duckdb_tools.py using parameterized queries
- Added path traversal protection in file_tools.py
- Added SSRF protection in spider_tools.py with URL validation

These changes address the critical security issues identified in issue #737

Co-authored-by: Mervin Praison <[email protected]>
2025-07-07 10:54:50 +00:00
Mervin Praison 25de69d3fa Merge pull request #736 from MervinPraison/claude/issue-733-20250705_072344
feat: Add minimal latency tracking as custom tool for MCP servers
2025-07-05 19:47:14 +01:00
claude[bot]andMervin Praison 894a95cfc2 feat: Add minimal latency tracking as custom tool for MCP servers
- Create standalone latency tracking tool without core file modifications
- Add multiple integration methods: tool, decorator, context manager, wrapper
- Provide comprehensive examples for different use cases
- Track planning, tool usage, and LLM generation phases
- Thread-safe implementation supporting concurrent requests

Closes #733

Co-authored-by: Mervin Praison <[email protected]>
2025-07-05 07:30:32 +00:00
Mervin Praison 6f6979e616 Merge pull request #732 from Dhivya-Bharathy/add-AI_Enrollment_Counselor
Add Ai Enrollment Counselor Notebook
2025-07-04 23:13:57 +01:00
Mervin Praison e3b9ca6091 Merge pull request #734 from MervinPraison/claude/issue-717-20250630_131044
fix: Add generic search() method to Memory class for mem0 compatibility
2025-07-04 22:43:36 +01:00
DhivyaBharathy 370a51dc86 Add files via upload 2025-07-04 17:20:41 +05:30
Dhivya-Bharathy 72e25f1ca2 Add AI_Enrollment_Counselor notebook 2025-07-04 11:38:55 +00:00
Dhivya-Bharathy 9757e3dea7 Add talk2find_voice_agent_demo notebook 2025-07-04 11:18:21 +00:00
DhivyaBharathy 3f1437e216 Add files via upload 2025-07-04 16:28:19 +05:30
DhivyaBharathy 9f682a5a36 Delete examples/cookbooks/youtube_content_integrity_analyzer.ipynb 2025-07-04 16:27:30 +05:30
DhivyaBharathy 53acd2ae4b Add files via upload 2025-07-04 16:04:17 +05:30
DhivyaBharathy afadcbe687 Add files via upload 2025-07-04 16:02:01 +05:30
DhivyaBharathy a95fdede7c Add files via upload 2025-07-02 14:30:31 +05:30
DhivyaBharathy 33ef1cdf48 Add files via upload 2025-07-02 14:00:16 +05:30
DhivyaBharathy 5f38d7f9f4 Add files via upload 2025-07-01 12:57:24 +05:30
claude[bot]andMervin Praison be57dd2e73 chore: Remove temporary test file
Co-authored-by: Mervin Praison <[email protected]>
2025-06-30 13:25:07 +00:00
claude[bot]andMervin Praison bc6373036b fix: Add generic search() method to Memory class for mem0 compatibility
- Added search() method that accepts query, user_id, agent_id, run_id, limit, rerank, and **kwargs parameters
- Method delegates to mem0 client when available or appropriate local search methods
- Fixes TypeError when Knowledge class calls memory.search() with rerank parameter
- Maintains backward compatibility with existing code
- Added test script to verify the fix

Fixes #717

Co-authored-by: Mervin Praison <[email protected]>
2025-06-30 13:24:59 +00:00
Mervin Praison ed41906af7 Merge pull request #716 from Dhivya-Bharathy/add-ZeroScript_AI_TestExecutor
Add ZeroScript_AI_TestExecutor Notebook
2025-06-30 13:50:33 +01:00
DhivyaBharathy e456990a91 Rename Pocky_Cybersecurity_PoC_Agent.ipynb to Cybersecurity_PoC_Agent.ipynb 2025-06-30 18:15:00 +05:30
DhivyaBharathy c5647bec54 Update and rename MemoryPal_Search_Agent.ipynb to SearchAgent.ipynb 2025-06-30 18:14:30 +05:30
DhivyaBharathy 1e45cc0ce1 Update and rename LegaliaAI_MiniCourt.ipynb to AI-CourtSimulation.ipynb 2025-06-30 18:13:48 +05:30
DhivyaBharathy 6a1009462a Update and rename Chile_Government_Services_Assistant.ipynb to Government-Services-Assistant.ipynb 2025-06-30 18:12:41 +05:30
DhivyaBharathy-web 6425758a25 Add ZeroScript_AI_TestExecutor notebook 2025-06-30 12:39:06 +00:00
Mervin Praison 1960cf9401 Merge pull request #712 from MervinPraison/claude/issue-491-20250628_070020
feat: implement agent-to-agent handoffs
2025-06-30 11:04:57 +01:00
claude[bot]andMervin Praison 7f399f4870 fix: improve handoff robustness and fix test import
- Enhanced callback invocation logic to handle keyword-only args and defaults
- Added error handling for input_type instantiation failures
- Fixed remove_all_tools filter to check truthy values instead of key existence
- Corrected line continuation indentation in test file

Co-authored-by: Mervin Praison <[email protected]>
2025-06-30 09:30:20 +00:00
claude[bot]andMervin Praison 81c35a35ca fix: improve handoff robustness and fix test import
- Fix callback parameter mismatch handling with proper warnings
- Add check for __annotations__ before accessing it
- Fix tool_calls filter to check key existence rather than truthiness
- Update test import path for HandoffInputData

Co-authored-by: Mervin Praison <[email protected]>
2025-06-30 06:40:29 +00:00
claude[bot]andMervin Praison d0cf8e8b20 refactor: complete handoff.py relocation and update all imports
- Created handoff.py in agent/ folder with updated import path
- Updated agent.py to import from .handoff instead of ..handoff
- Updated main __init__.py to import from .agent.handoff
- Added handoff exports to agent/__init__.py for cleaner imports

Co-authored-by: Mervin Praison <[email protected]>
2025-06-30 06:34:20 +00:00
claude[bot] 9eee37ad61 refactor: move handoff.py to agent/ folder for better organization
- Handoffs are agent-specific functionality, tightly coupled with Agent class
- Better long-term organization to group agent-related features together
- Consistent with existing pattern (e.g., image_agent.py in agent folder)
2025-06-30 06:33:34 +00:00
Mervin Praison 90cb5c57db Refactor: reorganise handoff example scripts into structured directories
- Moved handoff example scripts to a new directory structure for better organisation.
- Updated paths to reflect the new locations of the files.

This change aims to enhance the clarity and maintainability of the codebase.
2025-06-30 07:22:43 +01:00
Mervin Praison 4137d7dd45 Merge branch 'main' into claude/issue-491-20250628_070020 2025-06-30 07:16:37 +01:00
Mervin Praison 5804bb7115 Delete docs/handoffs.md 2025-06-30 07:14:30 +01:00
Mervin Praison f641110bd1 Rename examples/handoff_customer_service.py to examples/python/handoff/handoff_customer_service.py 2025-06-30 07:13:00 +01:00
Mervin Praison de02eb7054 Rename examples/handoff_basic.py to examples/python/handoff/handoff_basic.py 2025-06-30 07:12:42 +01:00
Mervin Praison d579412eed Rename examples/handoff_advanced.py to examples/python/handoff/handoff_advanced.py 2025-06-30 07:12:24 +01:00
Mervin Praison 22904cf41d Delete tests directory 2025-06-30 07:11:19 +01:00
claude[bot]andMervin Praison c542d77b45 fix: address review feedback for handoff implementation
- Fix callback invocation logic to handle edge cases (0-param callbacks)
- Remove unused imports (Union, datetime, pytest, Handoff, handoff)
- Fix PEP 8 formatting issues (add blank lines between functions)
- Simplify nested if statements and redundant conditions
- Fix undefined variables in documentation examples
- Add error handling and type validation to _process_handoffs
- Add comprehensive test cases for all handoff filters
- Use 'not' instead of '== False' for boolean comparison
- Improve prompt_with_handoff_instructions to generate better descriptions

Co-authored-by: Mervin Praison <[email protected]>
2025-06-29 06:42:11 +00:00
Mervin Praison dce8becb5d Merge pull request #713 from MervinPraison/claude/issue-66-20250628_222152
feat: add input variable value examples
2025-06-28 23:28:19 +01:00
claude[bot]andMervin Praison 9f7993ac40 feat: add input variable value examples
- simple_input.py: Basic user input example
- medium_complexity_input.py: Multiple inputs with tools and context
- advanced_dynamic_input.py: Class-based system with conditional logic
- environment_variable_input.py: Combining env vars with user input
- streamlit_ui_input.py: Web-based UI for dynamic input

These examples demonstrate various approaches to handling dynamic user input in PraisonAI agents.

Closes #66

Co-authored-by: Mervin Praison <[email protected]>
2025-06-28 22:25:24 +00:00
Mervin Praison 2ce177890f Merge pull request #711 from MervinPraison/claude/issue-489-20250628_220441
feat: Add comprehensive state management examples
2025-06-28 23:22:46 +01:00
claude[bot]andMervin Praison 11909566e9 feat: Add comprehensive state management examples
- 01_basic_state_management.py: Demonstrates fundamental state operations
- 02_state_in_tool_functions.py: Shows state usage within tool functions
- 03_conditional_task_execution.py: Illustrates conditional task flow based on state
- 04_session_state_persistence.py: Shows how to save/restore workflow state
- 05_loop_control_with_state.py: Demonstrates state-controlled loops and iterations
- 06_advanced_state_operations.py: Covers complex state scenarios and patterns

Each example is fully working with detailed documentation and real-world use cases.

Co-authored-by: Mervin Praison <[email protected]>
2025-06-28 22:12:15 +00:00
Mervin Praison 57b4b10ddf Merge pull request #710 from MervinPraison/claude/issue-103-20250628_214929
fix: add comprehensive Windows support with minimal changes
2025-06-28 23:01:42 +01:00
claude[bot]andMervin Praison 7bafdd7a4a fix: add comprehensive Windows support with minimal changes
- shell_tools.py: Replace os.uname() with platform.system(), fix Unix path handling, add proper Windows command parsing
- deploy.py: Replace Unix command substitution with cross-platform subprocess calls, handle Windows authentication
- mcp.py: Add Windows-aware command parsing, conditional locale variables, NPX variant detection

All changes maintain full backward compatibility for Unix/Linux/macOS.

Co-authored-by: Mervin Praison <[email protected]>
2025-06-28 21:55:52 +00:00
MervinPraison 911e991f84 chore: bump praisonai and praisonaiagents package versions 2025-06-28 09:44:34 +01:00
Mervin Praison 8164dfd1cf Merge pull request #708 from MervinPraison/claude/issue-482-20250628_070041
fix: Add base_url and api_key parameters to Agent class for Ollama support
2025-06-28 09:37:36 +01:00
Mervin Praison 461bac900d Merge pull request #707 from MervinPraison/claude/issue-67-20250628_070140
feat: add --file/-f flag for file input support
2025-06-28 09:34:01 +01:00
claude[bot]andMervin Praison a6b964d185 feat: implement agent-to-agent handoffs
- Add Handoff class and handoff() helper function
- Add handoffs parameter to Agent class with backward compatibility
- Convert handoffs to tools during agent initialization
- Support callbacks, input types, and input filters
- Add handoff_filters for common filtering patterns
- Include examples demonstrating basic and advanced usage
- Add comprehensive test for backward compatibility
- Add documentation for handoff feature

Co-authored-by: Mervin Praison <[email protected]>
2025-06-28 07:15:18 +00:00
claude[bot]andMervin Praison 67e02cd88a feat: add --file/-f flag for file input support
Implements file input functionality allowing users to pass file contents
as input to PraisonAI commands. The file content is appended to the
prompt similar to how stdin input is handled.

Key changes:
- Added --file/-f argument to CLI parser
- Added read_file_if_provided() method for safe file reading
- Updated prompt handling to combine file input with commands/stdin
- Maintains full backward compatibility

Usage examples:
- praisonai "Analyze this" --file data.txt
- praisonai -f prompt.txt
- echo "context" | praisonai "Process" --file input.txt

Closes #67

Co-authored-by: Mervin Praison <[email protected]>
2025-06-28 07:12:52 +00:00
claude[bot]andMervin Praison 4f7b6ed9f8 fix: Add base_url and api_key parameters to Agent class for Ollama support
This allows users to connect to remote Ollama instances without relying on environment variables.

Usage:
```python
agent = Agent(
    llm="ollama/llama3.2",
    base_url="http://remote-host:11434"
)
```

Fixes #482

Co-authored-by: Mervin Praison <[email protected]>
2025-06-28 07:06:54 +00:00
DhivyaBharathy f157196759 Add files via upload 2025-06-27 18:14:35 +05:30
MervinPraison c9d31385ec chore: bump praisonai to v2.2.35 and praisonaiagents to v0.0.108 2025-06-27 13:25:23 +01:00
Mervin Praison 92fae803e8 Merge pull request #702 from MervinPraison/claude/issue-619-20250627_112552
fix: add missing 'items' attribute for MCP array parameters
2025-06-27 12:52:02 +01:00
Mervin Praison 4d867a9ff1 Merge pull request #701 from MervinPraison/claude/issue-615-20250627_112613
fix: add stream parameter to disable streaming for custom LLMs
2025-06-27 12:50:07 +01:00
Mervin Praison 1fe43d9c9e Merge pull request #700 from MervinPraison/claude/issue-616-20250627_112603
fix: ensure all custom tools are available in chatbot integration
2025-06-27 12:49:03 +01:00
Mervin Praison acdcabcba7 Rename test_custom_tools_fix.py to src/praisonai/tests/test_custom_tools_fix.py 2025-06-27 12:48:54 +01:00
claude[bot]andMervin Praison 5f8c87f2cb fix: add stream parameter to disable streaming for custom LLMs
- Add stream parameter to Agent class with default True
- Add stream parameter to LLM get_response and get_response_async methods
- Replace hardcoded stream=True values with configurable stream parameter
- Maintains backward compatibility while allowing stream disabling

Fixes #615

Co-authored-by: Mervin Praison <[email protected]>
2025-06-27 11:46:35 +00:00
Mervin Praison 7907cd0913 Merge pull request #699 from MervinPraison/claude/issue-620-20250627_112541
fix: enable custom tools in chat interface
2025-06-27 12:45:40 +01:00
claude[bot]andMervin Praison 298a5b2b65 fix: enable custom tools in chat interface
- Add custom tool loading from tools.py
- Extend tools list to include both Tavily and custom tools  
- Update tool handling to work with any available tools
- Fix function calling to handle different parameter signatures
- Add proper error handling for sync/async functions
- Fix AsyncWebCrawler typo

Fixes #620

Co-authored-by: Mervin Praison <[email protected]>
2025-06-27 11:34:05 +00:00
claude[bot]andMervin Praison 7d6bd0ffeb fix: ensure all custom tools are available in chatbot integration
Previously, when agents were integrated into the chatbot UI, only the last
tool in the tools list was available due to the agent.tools assignment
being inside the tool loading loop. This caused the tools to be overwritten
on each iteration.

This commit moves the tool assignment outside the loop, ensuring all tools
are collected before being assigned to the agent. This fixes the issue
where custom tools were not working properly in the chatbot context while
maintaining full backward compatibility.

Fixes #616

Co-authored-by: Mervin Praison <[email protected]>
2025-06-27 11:32:37 +00:00
claude[bot]andMervin Praison 19d4999021 fix: add missing 'items' attribute for MCP array parameters
This fixes an issue where MCP tools with array parameters were not working
correctly with OpenAI-compatible LLMs. The tools were missing the required
'items' attribute that specifies the type of elements in the array.

- Added _fix_array_schemas() method to recursively fix array schemas
- Updated to_openai_tool() in both mcp.py and mcp_sse.py to apply the fix
- Maintains backward compatibility by preserving existing schemas

Fixes #619

Co-authored-by: Mervin Praison <[email protected]>
2025-06-27 11:31:28 +00:00
MervinPraison 8a309dd4b2 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-06-27 12:04:19 +01:00
MervinPraison 54805722cd refactor: migrate Claude action to OAuth and simplify filesystem agent implementation 2025-06-27 12:04:18 +01:00
DhivyaBharathy 41b1d9f885 Add files via upload 2025-06-25 19:04:52 +05:30
DhivyaBharathy 9de8d57a1c Add files via upload 2025-06-25 16:25:05 +05:30
DhivyaBharathy 58da95e139 Add files via upload 2025-06-25 14:18:58 +05:30
Mervin Praison 1b52f4ce5f Merge pull request #681 from Dhivya-Bharathy/add-personalized_learning_assistant
Add personalized learning assistant
2025-06-24 07:17:19 +01:00
Mervin Praison ec3a8d1863 Merge pull request #683 from Dhivya-Bharathy/add-github_repo_analyzer_agent
Add GitHub repo analyzer agent
2025-06-24 07:17:11 +01:00
Mervin Praison 41157e1f31 Merge pull request #684 from Dhivya-Bharathy/add-github-repo-analyzer-agent
Add GitHub repo analyzer agent
2025-06-24 07:17:08 +01:00
Mervin Praison 31078c38a0 Merge pull request #685 from Dhivya-Bharathy/add-Flow_Intelligent_Agent_PraisonAI
Add Flow_Intelligent_Agent_PraisonAI
2025-06-24 07:15:17 +01:00
devops-vestradata a48a0aca22 Move Flow_Intelligent_Agent_PraisonAI.py to examples/python/tools/exa-tool/ 2025-06-24 11:45:07 +05:30
devops-vestradata bf39bf7e8b Merge remote 'origin/main' into add-Flow_Intelligent_Agent_PraisonAI 2025-06-24 11:36:41 +05:30
devops-vestradata e9e1086afe Add Flow Intelligent Agent with custom tool 2025-06-24 11:32:10 +05:30
DhivyaBharathy 0554796b45 Add files via upload 2025-06-24 11:27:15 +05:30
devops-vestradata 7e2f17e047 Add GitHub Repo Analyzer Agent example 2025-06-23 16:41:57 +05:30
DhivyaBharathy 04457f5bc6 Add files via upload 2025-06-23 16:33:57 +05:30
DhivyaBharathy-web 250c56bbaa Add github_repo_analyzer_agent notebook 2025-06-23 11:02:14 +00:00
devops-vestradata a01f55cdd2 Add AI-Powered Learning Assistant example using praisonaiagents 2025-06-23 14:49:39 +05:30
devops-vestradata f4df72dfc4 Add learning assistant example 2025-06-23 14:46:48 +05:30
DhivyaBharathy 291c0b6b35 Add files via upload 2025-06-23 14:39:44 +05:30
DhivyaBharathy-web d7ad0dfaf4 Add personalized_learning_assistant notebook 2025-06-23 09:07:34 +00:00
Mervin Praison 3435b14a60 Merge pull request #678 from DhivyaBharathy-web/add-YouTube_Influencer_Intelligence_Agent
Add you tube influencer intelligence agent
2025-06-23 07:49:02 +01:00
Mervin Praison 26c89de3b7 Merge pull request #679 from DhivyaBharathy-web/add-voiGno_Restaurant_Agent_PraisonAI
Add voi gno restaurant agent praison ai
2025-06-23 07:48:52 +01:00
Mervin Praison 467e07fb8b Merge pull request #680 from DhivyaBharathy-web/add-Fuel_Emission_Agent_Intelligence_Agent
Add fuel emission agent intelligence agent
2025-06-23 07:47:50 +01:00
Mervin Praison 1f64210663 Merge pull request #677 from DhivyaBharathy-web/add-Home_Buying_Real_Estate_Agent
Add home buying real estate agent
2025-06-23 07:47:40 +01:00
DhivyaBharathy 8e87f2767f Add files via upload 2025-06-23 12:14:54 +05:30
DhivyaBharathy-web b74dbcd772 Add Fuel_Emission_Agent_Intelligence_Agent notebook 2025-06-23 06:43:19 +00:00
DhivyaBharathy 2ca306d6c9 Update E_commerce_Shopping_Assistant.ipynb 2025-06-22 19:18:11 +05:30
DhivyaBharathy 0ae294f528 Update E_commerce_Shopping_Assistant.ipynb 2025-06-22 19:16:56 +05:30
DhivyaBharathy d7b371fb3f Add files via upload 2025-06-22 18:31:02 +05:30
DhivyaBharathy-web 557f680b04 Add voiGno_Restaurant_Agent_PraisonAI notebook 2025-06-22 12:50:36 +00:00
DhivyaBharathy-web 80ceb59767 Add YouTube_Influencer_Intelligence_Agent notebook 2025-06-22 12:47:46 +00:00
DhivyaBharathy-web e2fc2752e0 Add Home_Buying_Real_Estate_Agent notebook 2025-06-22 12:45:21 +00:00
DhivyaBharathy f6ca39469f Delete examples/cookbooks/voiGno_Restaurant_Agent_PraisonAI.ipynb 2025-06-22 17:56:46 +05:30
DhivyaBharathy bd061bf555 Delete examples/cookbooks/YouTube_Influencer_Intelligence_Agent.ipynb 2025-06-22 17:56:32 +05:30
DhivyaBharathy c3f668ebef Delete examples/cookbooks/Home_Buying_Real_Estate_Agent.ipynb 2025-06-22 17:56:16 +05:30
DhivyaBharathy 1491ebf00a Delete examples/cookbooks/E_commerce_Shopping_Assistant.ipynb 2025-06-22 17:56:00 +05:30
DhivyaBharathy 59eec99ae4 Delete examples/cookbooks/Cognitive_Assistant_Agent_Team.ipynb 2025-06-22 17:55:47 +05:30
DhivyaBharathy 13d90399e5 Delete examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb 2025-06-22 17:55:31 +05:30
DhivyaBharathy e2a707509e Add files via upload 2025-06-22 17:53:57 +05:30
MervinPraison a432135e75 chore: update praisonai package version from 2.2.33 to 2.2.34 across Docker and deployment files 2025-06-21 07:22:29 +01:00
MervinPraison 17e620d9e0 refactor: migrate workflow process to sequential and enhance result handling with debug logging 2025-06-21 07:19:34 +01:00
MervinPraison 17ceaad435 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-06-21 06:40:45 +01:00
MervinPraison fe3ba3a916 feat: add weather server and Ollama LLM integration with test files 2025-06-21 06:40:44 +01:00
Mervin Praison 1b9c9b78c9 Merge pull request #670 from DhivyaBharathy-web/add-Meta_LLaMA3_SyntheticData
Add  Meta Synthetic Data Generator (LLaMA 3.2 - 3B)
2025-06-20 23:53:33 +02:00
Mervin Praison 1051f3a705 Merge pull request #671 from DhivyaBharathy-web/add-Sesame_CSM_1B_TTS
Add  Sesame CSM (1B) - TTS Model
2025-06-20 23:53:18 +02:00
Mervin Praison 982473ce08 Merge pull request #673 from DhivyaBharathy-web/add-KnowledgeAgent_PraisonAI
Add knowledge agent praison ai
2025-06-20 23:52:59 +02:00
DhivyaBharathy 09de1f1405 Add files via upload 2025-06-20 10:18:42 +05:30
DhivyaBharathy ee21add0ef Delete examples/cookbooks/KnowledgeAgent_PraisonAI.ipynb 2025-06-20 10:18:01 +05:30
DhivyaBharathy dcc2f899e7 Add files via upload 2025-06-20 10:16:59 +05:30
DhivyaBharathy 362d6e62be Add files via upload 2025-06-18 13:14:09 +05:30
DhivyaBharathy-web d2a12c5fc6 Add Sesame_CSM_1B_TTS notebook 2025-06-18 07:37:58 +00:00
DhivyaBharathy-web 993c342209 Add Meta_LLaMA3_SyntheticData notebook 2025-06-18 07:36:01 +00:00
MervinPraison 218370fef8 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-06-17 11:09:41 +01:00
MervinPraison 117969e8f6 Update Claude workflow to simplify action references by using version tags, enhancing clarity and maintainability. 2025-06-17 11:09:40 +01:00
DhivyaBharathy aa3282cabd Add files via upload 2025-06-17 15:29:02 +05:30
Mervin Praison 914532028d Merge pull request #669 from DhivyaBharathy-web/add-Phi_3_Medium_Conversational
Add Phi_3_Medium_Conversational notebook
2025-06-17 11:56:33 +02:00
DhivyaBharathy-web 83d808ddc1 Add Phi_3_Medium_Conversational notebook 2025-06-17 09:54:35 +00:00
Mervin Praison 3cf922f36c Merge pull request #667 from DhivyaBharathy-web/add-Phi_4_14B_GRPO
Add Phi_4_14B_GRPO notebook
2025-06-17 11:52:37 +02:00
Mervin Praison b5956e0d39 Merge pull request #668 from DhivyaBharathy-web/add-Phi_3_5_Mini_Conversational
Add Phi_3_5_Mini_Conversational notebook
2025-06-17 11:52:27 +02:00
Mervin Praison 07952d1b61 Merge pull request #666 from DhivyaBharathy-web/add-Phi_4_Conversational
Add Phi_4_Conversational notebook
2025-06-17 11:52:17 +02:00
DhivyaBharathy-web 9eedd55b19 Add Phi_3_5_Mini_Conversational notebook 2025-06-17 09:49:45 +00:00
DhivyaBharathy-web 3b31afb270 Add Phi_4_14B_GRPO notebook 2025-06-17 09:45:50 +00:00
DhivyaBharathy-web c77f3c7363 Add Phi_4_Conversational notebook 2025-06-17 09:40:28 +00:00
Mervin Praison c808ce29e4 Merge pull request #632 from DhivyaBharathy-web/add-qwen-chatbot-agent
Add qwen chatbot agent
2025-06-17 00:24:41 +02:00
Mervin Praison ca70d34ffe Merge pull request #659 from DhivyaBharathy-web/add-llama3-2-11b-vision-agent
Add llama3 2 11b vision agent
2025-06-17 00:20:23 +02:00
Mervin Praison 96563ffb04 Merge pull request #662 from DhivyaBharathy-web/add-Pixtral_12B_Vision_Model
Add pixtral 12 b vision model
2025-06-17 00:20:11 +02:00
Mervin Praison d7a89a5b5d Merge pull request #663 from DhivyaBharathy-web/add-Qwen2-5-VL_7B_Vision_Model
Add qwen2 5 vl 7 b vision model
2025-06-17 00:20:02 +02:00
DhivyaBharathy-web 7d0afb062e Resolve conflict by deleting Mistral notebook 2025-06-16 11:44:20 +00:00
DhivyaBharathy-web 3ede63d3d9 Resolve conflict by deleting Mistral notebook 2025-06-16 11:30:59 +00:00
DhivyaBharathy-web db58770b46 Resolve conflict by deleting Mistral notebook 2025-06-16 11:11:32 +00:00
MervinPraison 9066668121 Refactor Claude Code Action to streamline prompt handling by reading directly from the prompt file, enhancing clarity and efficiency in command execution. 2025-06-16 09:57:01 +01:00
MervinPraison 8e5b6a9d38 Refactor Claude Code Action by removing unnecessary timeout and custom instructions handling, streamlining command argument preparation for improved clarity and efficiency. 2025-06-16 09:41:00 +01:00
MervinPraison b16086c17d Update Claude Code Action to enhance input options and streamline prompt extraction from GitHub context. Remove redundant GitHub token and MCP installation steps in workflow for improved clarity and efficiency. 2025-06-16 09:39:06 +01:00
MervinPraison f50a2448df Refactor Claude Code Action to auto-generate prompts from GitHub context when no input is provided, improving usability and functionality. Update workflow to remove redundant prompt generation step, streamlining the process. 2025-06-16 09:13:23 +01:00
MervinPraison b1ff7a9500 Update GitHub Actions workflow by standardising GitHub token reference and adding a step to generate prompts from GitHub context, enhancing functionality and clarity. 2025-06-16 09:10:37 +01:00
DhivyaBharathy c4829d45a4 Merge branch 'main' into add-qwen-chatbot-agent 2025-06-16 13:04:42 +05:30
DhivyaBharathy f4479fa1f4 Add files via upload 2025-06-16 13:00:35 +05:30
DhivyaBharathy-web f008aa1c3b Add Qwen2.5-VL_7B_Vision_Model Agent notebook 2025-06-16 07:20:55 +00:00
MervinPraison 3abb084209 Refactor Claude Code Action by consolidating functionality into a composite action, removing Dockerfile and entrypoint script, and enhancing input descriptions for clarity and usability. 2025-06-16 08:16:05 +01:00
DhivyaBharathy-web 617efcc96d Add LLaMA3-2_11B_Vision Agent notebook 2025-06-16 07:15:16 +00:00
MervinPraison 41bec67b51 Refine Claude workflow by directly executing the 'claude' script with Node to bypass BusyBox environment issues, enhancing reliability in CI execution. 2025-06-16 07:59:11 +01:00
MervinPraison 91361eee17 Enhance Claude workflow by adding debugging steps for environment verification, checking for the presence of the 'claude' command, and implementing automatic installation if not found, ensuring smoother execution in CI mode. 2025-06-16 07:56:35 +01:00
MervinPraison aa1356629b Update Claude workflow by modifying Docker image reference format, enhancing environment variable debugging, and updating GitHub token reference for improved clarity and reliability. 2025-06-16 07:54:53 +01:00
MervinPraison ac86a8dd76 Fix GHCR authentication issue in Claude workflow by updating login method and adding a logout step for improved reliability. 2025-06-16 07:50:37 +01:00
MervinPraison ab679e040e Add Docker pull test step to Claude workflow for verification of successful image retrieval after login. 2025-06-16 07:49:57 +01:00
MervinPraison c2fded7a89 Refactor Claude workflow by removing redundant debugging and testing steps, updating GitHub token usage for improved security and clarity. 2025-06-16 07:45:03 +01:00
Mervin Praison 4966ec1ae1 Merge pull request #658 from MervinPraison/develop
Enhance Claude workflow by adding environment variable for GitHub tok…
2025-06-16 08:26:16 +02:00
MervinPraison c31870a991 Enhance Claude workflow by adding environment variable for GitHub token and implementing package visibility check and Docker authentication tests for improved reliability and security. 2025-06-16 07:25:57 +01:00
Mervin Praison 67f4a89062 Merge pull request #657 from MervinPraison/develop
Add debugging steps to Claude workflow for environment verification a…
2025-06-16 08:24:07 +02:00
MervinPraison a898bbb7d1 Add debugging steps to Claude workflow for environment verification and Docker testing 2025-06-16 07:23:50 +01:00
Mervin Praison 107d33deb7 Merge pull request #656 from MervinPraison/develop
Update Claude Code action to restrict package permissions and remove …
2025-06-16 08:21:21 +02:00
MervinPraison 9d963e4eeb Update Claude Code action to restrict package permissions and remove Docker image build step for streamlined workflow. 2025-06-16 07:21:02 +01:00
Mervin Praison 56b296b8d6 Merge pull request #655 from MervinPraison/develop
Update Claude Code action to enable package writing and add Docker im…
2025-06-16 08:18:07 +02:00
MervinPraison fddf999688 Update Claude Code action to enable package writing and add Docker image build and push step for enhanced deployment capabilities. 2025-06-16 07:14:29 +01:00
Mervin Praison 6374aba783 Merge pull request #654 from MervinPraison/develop
Update Claude Code action to use GitHub token for authentication, enh…
2025-06-16 08:13:03 +02:00
MervinPraison 9408d699e8 Update Claude Code action to use GitHub token for authentication, enhancing security and consistency in the workflow. 2025-06-16 07:12:10 +01:00
Mervin Praison 6358671ab9 Merge pull request #652 from MervinPraison/develop
Enhance Claude Code action by adding environment variable verificatio…
2025-06-15 07:43:51 +02:00
MervinPraison f5bd55bb9a Enhance Claude Code action by adding environment variable verification and updating Docker setup for improved reliability 2025-06-15 06:43:34 +01:00
Mervin Praison a93c571f33 Merge pull request #651 from MervinPraison/develop
Update Claude Code action reference to use local action for improved …
2025-06-15 07:42:13 +02:00
MervinPraison 8ea0e4c831 Update Claude Code action reference to use local action for improved maintainability 2025-06-15 06:41:42 +01:00
Mervin Praison 8a1dc24794 Merge pull request #650 from MervinPraison/develop
Update Claude Code action reference to use quotes for consistency
2025-06-15 07:39:30 +02:00
MervinPraison b331229578 Update Claude Code action reference to use quotes for consistency 2025-06-15 06:39:12 +01:00
Mervin Praison 7af52735cf Merge pull request #649 from MervinPraison/develop
Add GitHub Container Registry login step and update Claude Code actio…
2025-06-15 07:37:42 +02:00
MervinPraison 2902fec42e Add GitHub Container Registry login step and update Claude Code action reference 2025-06-15 06:37:28 +01:00
Mervin Praison 64f752a8e0 Merge pull request #648 from MervinPraison/develop
Update Docker image reference in Claude Code action for consistency
2025-06-15 07:35:30 +02:00
MervinPraison d994fb5047 Update Docker image reference in Claude Code action for consistency 2025-06-15 06:34:52 +01:00
Mervin Praison 760fb9530b Merge pull request #647 from MervinPraison/develop
Refactor Claude Code integration to use local action instead of Docke…
2025-06-15 07:33:04 +02:00
MervinPraison de165975b0 Refactor Claude Code integration to use local action instead of Docker image for improved maintainability 2025-06-15 06:32:43 +01:00
Mervin Praison dfd74a2fe7 Merge pull request #646 from MervinPraison/develop
Develop
2025-06-15 07:29:30 +02:00
MervinPraison 9265ca08a2 Update Claude Code integration to use Docker image and add GitHub token for authentication 2025-06-15 06:28:57 +01:00
MervinPraison 665df753fd Remove CLAUDE_CODE_INTEGRATION_PRAISONAI_AGENTS.md as it is no longer needed for the integration of Claude Code with PraisonAI Agents. This deletion simplifies the documentation and reflects the current state of the project. 2025-06-15 05:55:55 +01:00
Mervin Praison 94d991f4ec Merge pull request #643 from MervinPraison/develop
Update PraisonAI and dependencies to version 2.2.33
2025-06-14 08:45:31 +02:00
MervinPraison 632cf68423 Update PraisonAI and dependencies to version 2.2.33
- Updated PraisonAI version from 2.2.32 to 2.2.33 across multiple Dockerfiles and relevant files.
- Adjusted dependency versions in pyproject.toml and other files for consistency.
- Enhanced README documentation to reflect the updated version.

This change integrates the latest features and improvements from PraisonAI while ensuring compatibility with existing code.
2025-06-14 07:45:15 +01:00
Mervin Praison d956c605f7 Merge pull request #635 from MervinPraison/claude/issue-634-20250610_115418
feat: Refactor Claude Code integration to use PraisonAI Agents
2025-06-14 08:43:35 +02:00
Mervin Praison 7e3de10f32 Rename test_claude_code_integration.py to src/praisonai/tests/unit/test_claude_code_integration.py 2025-06-14 07:41:20 +01:00
Mervin Praison 79883f1af2 Merge pull request #642 from MervinPraison/develop
Update PraisonAI and dependencies to version 2.2.32
2025-06-14 08:39:04 +02:00
MervinPraison a098eb0150 Update PraisonAI and dependencies to version 2.2.32
- Updated PraisonAI version from 2.2.31 to 2.2.32 across multiple Dockerfiles and relevant files.
- Adjusted dependency versions in pyproject.toml and other files for consistency.
- Enhanced README documentation to reflect the updated version.

This change integrates the latest features and improvements from PraisonAI while ensuring compatibility with existing code.
2025-06-14 07:38:45 +01:00
Mervin Praison b9ce3b4ccb Merge pull request #641 from MervinPraison/develop
Allow to configure reflection prompt
2025-06-14 08:36:28 +02:00
claude[bot]andMervin Praison 58b44280df feat: add self-reflection support with configurable prompt to achat method
- Implement complete self-reflection logic in achat method to match chat method
- Support configurable reflect_prompt parameter in async operations  
- Add reflection loop with min/max limits and error handling
- Update method docstring to reflect new self-reflection capability
- Ensure consistent behavior between chat and achat methods

Co-authored-by: Mervin Praison <[email protected]>
2025-06-14 06:26:49 +00:00
MervinPraison 4dba09d6b1 Merge remote-tracking branch 'leo-origin/feature/add-reflection-prompt' into test-reflection-prompt 2025-06-14 07:20:09 +01:00
Mervin Praison a538513bec Merge pull request #640 from MervinPraison/develop
Develop
2025-06-14 08:17:26 +02:00
MervinPraison 4fb79207cf Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-06-14 07:16:44 +01:00
MervinPraison 0b444fae34 Merge branch 'develop' of https://github.com/MervinPraison/PraisonAI into develop 2025-06-14 07:16:26 +01:00
MervinPraison bd34e45bbc Update PraisonAI and dependencies to version 2.2.31
- Updated PraisonAI version from 2.2.30 to 2.2.31 across multiple Dockerfiles and the Ruby formula.
- Adjusted dependency versions in pyproject.toml and other relevant files for consistency.
- Enhanced README documentation to reflect the updated version.

This change ensures that the latest features and improvements from PraisonAI are integrated while maintaining compatibility with existing code.
2025-06-14 07:16:25 +01:00
Mervin Praison f4f051e57e Merge pull request #638 from krkead/patch-2
Update chainlit_ui.py to work with newer chainlit versions
2025-06-14 08:13:56 +02:00
Mervin Praison 3c2610cc3c Merge pull request #639 from krkead/patch-1
Update agents.py to work with newer chainlit versions
2025-06-14 08:13:44 +02:00
krkead 9788454134 Update chainlit_ui.py to work with newer chainlit versions
The previous payload modification was incorrect
2025-06-13 18:04:52 -03:00
krkead e618004e60 Update agents.py to work with newer chainlit versions 2025-06-13 18:02:35 -03:00
Mervin Praison 384803ba8e Merge pull request #637 from DhivyaBharathy-web/add-mistral-agent
Add Mistral v0.3 Conversational Agent – Conceptual Workflow
2025-06-12 06:01:21 +02:00
DhivyaBharathy 1a306988cf Delete examples/cookbooks/Mistral_v0_3_Conversational_Demo.ipynb 2025-06-11 16:22:41 +05:30
DhivyaBharathy-web d3bb366a51 Add Mistral 7B Instruction Agent notebook 2025-06-11 10:49:16 +00:00
DhivyaBharathy e579e84b52 Add files via upload 2025-06-11 16:13:42 +05:30
leovs09 61440403f5 add agent constructor params description 2025-06-11 00:48:51 +02:00
leovs09 b615782175 Allow to configure reflection prompt 2025-06-11 00:24:59 +02:00
claude[bot]andMervinPraison 35199979f0 feat: Refactor Claude Code integration to use PraisonAI Agents
- Replace litellm direct usage with praisonaiagents framework
- Implement Claude Code as a custom tool that agents can decide to use
- Add --claudecode CLI flag support: `praisonai code --claudecode`
- Create intelligent agent that chooses when to use Claude Code vs regular responses
- Maintain full backward compatibility with litellm fallback
- Add UI toggle switch for enabling/disabling Claude Code
- Implement git operations with automatic branch creation and PR URLs
- Add comprehensive error handling and streaming support
- Include test script and detailed documentation

Key improvements:
- Agent-driven decision making instead of manual detection logic
- Better tool coordination and flexibility
- Minimal code changes with maintained compatibility
- Enhanced user experience with intelligent tool selection

Co-Authored-By: MervinPraison <[email protected]>
2025-06-10 12:02:19 +00:00
DhivyaBharathy eeb77cfd20 Add files via upload 2025-06-10 16:15:43 +05:30
Mervin Praison 00d7994601 Merge pull request #633 from DhivyaBharathy-web/add-nlp-asr-agent
Add NLP + ASR Agent (Official BERT Large + Whisper Large V3)
2025-06-10 08:55:08 +01:00
DhivyaBharathy 10aa49addc Merge branch 'main' into add-nlp-asr-agent 2025-06-10 12:05:50 +05:30
DhivyaBharathy-web 79c9cf8bf9 Add NLP + ASR Agent (Official BERT Large + Whisper Large V3) notebook 2025-06-10 06:32:31 +00:00
DhivyaBharathy f4cb62a288 Merge branch 'main' into add-qwen-chatbot-agent 2025-06-10 11:55:04 +05:30
DhivyaBharathy dde6ec4a6a Update qwen_colab_agent.ipynb 2025-06-10 11:52:40 +05:30
DhivyaBharathy-web c8b2414f5b Add Qwen Agent notebook 2025-06-10 06:17:23 +00:00
Mervin Praison a9416fb7fc Merge pull request #631 from MervinPraison/claude/issue-630-20250609_145612
feat: add remote agent connectivity with Google ADK-like API
2025-06-09 20:43:47 +01:00
Mervin Praison 547b40ee72 Rename test_remote_agent.py to src/praisonai/tests/unit/test_remote_agent.py 2025-06-09 20:43:32 +01:00
claude[bot]andMervinPraison 4fc35d1b10 feat: add remote agent connectivity with Google ADK-like API
- Enhanced Session class to support remote agent URLs
- Added agent_url parameter for direct agent connectivity  
- Implemented HTTP client for remote agent communication
- Added connection testing and validation
- Provided send_message() alias for Google ADK compatibility
- Created comprehensive examples and documentation
- Maintained full backward compatibility
- Added proper error handling for remote operations

Fixes #630

Co-authored-by: MervinPraison <[email protected]>
2025-06-09 15:02:42 +00:00
Mervin Praison c72d74987b Merge pull request #625 from DhivyaBharathy-web/add-mistral7b-agent
Add mistral7b agent
2025-06-08 00:14:37 +01:00
DhivyaBharathy 430ec6571a Update MistralTechAgent.ipynb 2025-06-07 14:22:57 +05:30
DhivyaBharathy e88288773a Add files via upload 2025-06-07 14:15:47 +05:30
DhivyaBharathy-web 9af03e3fef Add Mistral-7B-Instruct-v0.1 Instruction Agent notebook 2025-06-07 08:43:22 +00:00
Mervin Praison 7a7560621b Merge pull request #624 from MervinPraison/develop
Develop
2025-06-07 01:27:46 +01:00
MervinPraison 531c58ac70 Update PraisonAI and dependencies to version 2.2.31 and praisonaiagents to version 0.0.104
- Updated PraisonAI version in Dockerfiles and Ruby formula.
- Adjusted dependency versions in pyproject.toml and uv.lock for consistency.
- Enhanced README to reflect the new versioning.

This change ensures compatibility with the latest features and improvements while maintaining existing functionality.
2025-06-07 01:27:29 +01:00
MervinPraison 274ade8154 Disable litellm telemetry across multiple modules for improved performance and consistency
- Added environment variable to disable litellm telemetry in __init__.py, llm.py, and memory.py.
- Ensured telemetry is disabled after importing litellm to prevent unnecessary data collection.

This change enhances control over telemetry features while maintaining existing functionality.
2025-06-07 00:24:28 +01:00
Mervin Praison 83f4f874e9 Merge pull request #622 from DhivyaBharathy-web/add-groq-Llama3-agent
Add Groq Llama3-8b-8192 Agent notebook
2025-06-06 23:38:03 +01:00
MervinPraison 99cd88dd30 Enhance telemetry support and update dependencies
- Added 'posthog>=4.0.0' to dependencies and optional 'telemetry' section in pyproject.toml.
- Updated blog_agent to use llm_config for improved clarity.
- Disabled memory in PraisonAIAgents instantiation for better control.
- Introduced telemetry support with lazy loading and fallback functions in __init__.py.

This update improves the integration of telemetry features while maintaining existing functionality.
2025-06-06 17:52:43 +01:00
DhivyaBharathy 1d22818662 Add files via upload 2025-06-06 15:28:14 +05:30
DhivyaBharathy-web 4f38e7250a Add Groq Llama3-8b-8192 Agent notebook 2025-06-06 09:52:36 +00:00
Mervin Praison b736567375 Merge pull request #618 from MervinPraison/revert-617-claude/issue-612-20250606_060924
Revert "fix: prevent duplicate Task and Response display when using litellm with memory"
2025-06-06 07:28:27 +01:00
Mervin Praison d014ea8d18 Revert "fix: prevent duplicate Task and Response display when using litellm with memory" 2025-06-06 07:28:13 +01:00
Mervin Praison fd6db3ccfa Merge pull request #617 from MervinPraison/claude/issue-612-20250606_060924
fix: prevent duplicate Task and Response display when using litellm with memory
2025-06-06 07:24:32 +01:00
claude[bot]andMervinPraison 1f2f26c5cf fix: prevent duplicate Task and Response display when using litellm with memory
- Add suppress_display parameter to LLM.get_response() method (default: False)
- Update all display_interaction calls in LLM class to respect suppress_display flag
- Agent class now passes suppress_display=True to prevent LLM duplicate displays
- Agent handles display centrally to ensure single display per interaction
- Maintains full backward compatibility while fixing issue #612

Co-authored-by: MervinPraison <[email protected]>
2025-06-06 06:16:39 +00:00
Mervin Praison 1965f296b0 Merge pull request #614 from MervinPraison/revert-613-claude/issue-612-20250605_213542
Revert "fix: prevent duplicate Task and Response display when using litellm with memory"
2025-06-06 06:43:34 +01:00
Mervin Praison cc7036784b Revert "fix: prevent duplicate Task and Response display when using litellm with memory" 2025-06-06 06:43:21 +01:00
Mervin Praison 826a68c33e Merge pull request #613 from MervinPraison/claude/issue-612-20250605_213542
fix: prevent duplicate Task and Response display when using litellm with memory
2025-06-06 06:41:16 +01:00
claude[bot]andMervinPraison 88ceba804b fix: prevent duplicate Task and Response display when using litellm with memory
- Add display_interaction parameter to LLM.get_response() method (default: True)
- Update all internal display_interaction calls in LLM class to respect new parameter  
- Modify agent calls to pass display_interaction=False when using custom LLM instances
- Maintains backward compatibility while fixing duplicate displays (fixes #612)

Co-authored-by: MervinPraison <[email protected]>
2025-06-05 21:45:59 +00:00
Mervin Praison dc5b10fba8 Merge pull request #611 from MervinPraison/develop
Update PraisonAI version to 2.2.30 across Dockerfiles and related files
2025-06-05 18:18:04 +01:00
MervinPraison f0172e8339 Update PraisonAI version to 2.2.30 across Dockerfiles and related files
- Incremented the version of PraisonAI from 2.2.29 to 2.2.30 in Dockerfiles (Dockerfile, Dockerfile.chat, Dockerfile.dev, Dockerfile.ui).
- Updated the version in the README.md and pyproject.toml files to reflect the new version.
- Adjusted the deploy.py script to install the updated version of PraisonAI.
- Ensured consistency across all relevant files for seamless integration.
2025-06-05 18:17:47 +01:00
Mervin Praison 5c498a12de Merge pull request #610 from MervinPraison/claude/issue-605-20250605_165941
fix: resolve Memory import error with litellm compatibility
2025-06-05 18:16:11 +01:00
Mervin Praison 88410881e1 Rename test_session_import.py to src/praisonai/tests/unit/test_session_import.py 2025-06-05 18:10:43 +01:00
Mervin Praison 791d59f96e Rename test_memory_import.py to src/praisonai/tests/unit/test_memory_import.py 2025-06-05 18:10:25 +01:00
Mervin Praison cdbe1303ad Rename test_comprehensive_import.py to src/praisonai/tests/unit/test_comprehensive_import.py 2025-06-05 18:10:10 +01:00
claude[bot]andMervinPraison b63f931bea feat: add Memory to main package exports and comprehensive tests
- Export Memory class from main praisonaiagents package
- Add Memory to __all__ list for proper package API
- Create comprehensive test suite to verify all import scenarios
- Tests original failing import from GitHub issue
- Tests direct Memory imports and instantiation

Co-authored-by: MervinPraison <[email protected]>
2025-06-05 17:02:47 +00:00
claude[bot]andMervinPraison ff25b96f91 fix: resolve Memory import error by implementing litellm compatibility
- Add LITELLM_AVAILABLE flag for proper dependency detection
- Implement litellm → openai fallback pattern for all embedding operations
- Update search_short_term, store_long_term, search_long_term embedding calls
- Update calculate_quality_metrics to use litellm → openai fallback
- Add graceful degradation when neither litellm nor openai is available
- Fixes ImportError: cannot import name 'Memory' from 'praisonaiagents.memory'

Co-authored-by: MervinPraison <[email protected]>
2025-06-05 17:02:03 +00:00
Mervin Praison 603f0ea008 Merge pull request #609 from MervinPraison/develop
Develop
2025-06-05 17:55:15 +01:00
MervinPraison db38b55174 Update PraisonAI version to 2.2.29 across Dockerfiles and related files
- Incremented the version of PraisonAI from 2.2.28 to 2.2.29 in Dockerfiles (Dockerfile, Dockerfile.chat, Dockerfile.dev, Dockerfile.ui).
- Updated the version in the README.md and pyproject.toml files to reflect the new version.
- Adjusted the deploy.py script to install the updated version of PraisonAI.
- Ensured consistency across all relevant files for seamless integration.
2025-06-05 17:54:57 +01:00
MervinPraison cebd175d61 Update versioning and dependencies in project files
- Incremented version of PraisonAI from 0.0.99 to 0.0.101 in pyproject.toml and uv.lock.
- Added 'litellm' dependency to memory requirements for enhanced functionality.
- Updated .gitignore to include 'CopilotKit*' for better file management.
- Optimised TaskOutput instantiation in agent.py for clarity.
- Refined memory handling in memory.py to utilise LiteLLM for consistency.
- Improved model extraction logic in task.py for better fallback handling.
2025-06-05 17:53:38 +01:00
Mervin Praison 01ff75e573 Merge pull request #606 from DhivyaBharathy-web/add-qwen2-5-agent
Add Qwen2.5 Instruction Agent notebook using Hugging Face Transformers
2025-06-05 17:43:36 +01:00
Mervin Praison 28629f2203 Merge pull request #607 from DhivyaBharathy-web/add-gemma2b-instruction-agent
Add Gemma2B_Instruction_Agent to Cookbooks
2025-06-05 17:43:19 +01:00
Mervin Praison ac5c463362 Merge pull request #602 from DhivyaBharathy-web/add-predictive-maintenance-notebook
Add predictive maintenance notebook
2025-06-05 17:43:05 +01:00
Mervin Praison 84dc57583e Merge pull request #608 from DhivyaBharathy-web/add-tinyllama-model-agent
Add tinyllama model agent
2025-06-05 17:42:50 +01:00
DhivyaBharathy 460e8b45a7 Merge branch 'main' into add-tinyllama-model-agent 2025-06-05 19:30:02 +05:30
DhivyaBharathy f6bbbd7cd6 Update TinyLlama_1_1B_model_SimpleAIAgent.ipynb 2025-06-05 19:29:06 +05:30
DhivyaBharathy 8a435571f4 Add files via upload 2025-06-05 19:10:44 +05:30
DhivyaBharathy 204106daa8 Merge branch 'main' into add-gemma2b-instruction-agent 2025-06-05 16:47:50 +05:30
DhivyaBharathy 6a1e14f97a Merge branch 'main' into add-qwen2-5-agent 2025-06-05 16:47:02 +05:30
DhivyaBharathy 333777b991 Merge branch 'main' into add-predictive-maintenance-notebook 2025-06-05 16:46:13 +05:30
DhivyaBharathy b02cd85290 Update Gemma2B_Instruction_Agent.ipynb 2025-06-05 16:27:38 +05:30
DhivyaBharathy 3bc0c2b533 Update Gemma2B_Instruction_Agent.ipynb 2025-06-05 16:26:56 +05:30
DhivyaBharathy 68d4f34bb7 Update Gemma2B_Instruction_Agent.ipynb 2025-06-05 16:26:37 +05:30
DhivyaBharathy a24d900a8c Add files via upload 2025-06-05 16:22:33 +05:30
DhivyaBharathy-web 552a10df9e Add Qwen2.5 Instruction Agent notebook 2025-06-05 10:49:32 +00:00
DhivyaBharathy 9c57aa3165 Update Qwen2_5_InstructionAgent.ipynb 2025-06-05 15:16:04 +05:30
DhivyaBharathy 40fe92f1d0 Update Qwen2_5_InstructionAgent.ipynb 2025-06-05 15:14:56 +05:30
DhivyaBharathy 179cc9566d Update Qwen2_5_InstructionAgent.ipynb 2025-06-05 15:09:09 +05:30
DhivyaBharathy d9cf9ba534 Add files via upload 2025-06-05 15:07:47 +05:30
DhivyaBharathy-web 4ec0366e79 Add Qwen2.5 Instruction Agent notebook 2025-06-05 09:26:46 +00:00
Mervin Praison d6a3bd1240 Merge pull request #604 from MervinPraison/develop
Update PraisonAI version to 2.2.28 across Dockerfiles and related files
2025-06-04 22:59:48 +01:00
MervinPraison 0a18e27f54 Update PraisonAI version to 2.2.28 across Dockerfiles and related files
- Updated the version of PraisonAI from 2.2.27 to 2.2.28 in Dockerfiles (Dockerfile, Dockerfile.chat, Dockerfile.dev, Dockerfile.ui).
- Modified the version in the README.md and pyproject.toml files to reflect the new version.
- Adjusted the deploy.py script to install the updated version of PraisonAI.
- Ensured consistency across all relevant files for seamless integration.
2025-06-04 22:59:30 +01:00
DhivyaBharathy b824d950b5 Add files via upload 2025-06-04 20:32:10 +05:30
Mervin Praison a5b768c213 Merge pull request #601 from MervinPraison/develop
Develop
2025-06-04 15:50:06 +01:00
MervinPraison 068bdbebc5 Update PraisonAI version to 2.2.27 across Dockerfiles and related files
- Updated the version of PraisonAI from 2.2.26 to 2.2.27 in Dockerfiles (Dockerfile, Dockerfile.chat, Dockerfile.dev, Dockerfile.ui).
- Modified the version in the README.md and pyproject.toml files to reflect the new version.
- Adjusted the deploy.py script to install the updated version of PraisonAI.
- Ensured consistency across all relevant files for seamless integration.
2025-06-04 15:49:47 +01:00
MervinPraison 4d80d795f8 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-06-04 15:48:15 +01:00
MervinPraison 2e3b5cd29b Merge branch 'develop' of https://github.com/MervinPraison/PraisonAI into develop 2025-06-04 15:48:08 +01:00
MervinPraison d948b6de2c Refactor agent guardrails and update versioning
- Removed the outdated agent_guardrails_example.py file.
- Introduced a new guardrail_agents_example.py file with improved structure and user-friendly naming.
- Updated version in pyproject.toml from 0.0.97 to 0.0.98.
- Added revision information in uv.lock for better dependency tracking.
- Imported asyncio in agent.py for enhanced functionality.
2025-06-04 15:47:14 +01:00
Mervin Praison 3adb06950c Merge pull request #599 from MervinPraison/develop
Update test workflow to use custom test runner for 'fast' pattern and…
2025-06-04 14:21:02 +01:00
claude[bot]andClaude e45e85975c feat: implement Agent-level guardrail support
- Add guardrail and max_guardrail_retries parameters to Agent constructor
- Implement _setup_guardrail() method supporting function and LLM-based guardrails  
- Add _process_guardrail() method for validation processing
- Create _apply_guardrail_with_retry() method with automatic retry logic
- Integrate guardrail processing into all major return points in chat() method
- Support both regular responses and reasoning content validation
- Update agent_guardrails_example.py with comprehensive demonstrations
- Enhance CLAUDE.md documentation with Agent-level guardrail usage
- Add test file for Agent guardrail functionality validation

Agent-level guardrails apply to ALL outputs from the agent, providing
consistent validation across all agent interactions with configurable
retry logic and support for both function-based and string-based 
LLM guardrails.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-06-04 11:57:22 +00:00
Mervin Praison 8a7935dc2c Merge pull request #600 from DhivyaBharathy-web/code-analysis-agent
Add code analysis agent notebook
2025-06-04 12:40:08 +01:00
DhivyaBharathy b31edc90d5 Update Code_Analysis_Agent.ipynb 2025-06-04 16:58:52 +05:30
DhivyaBharathy d2841ccb3a Merge branch 'MervinPraison:main' into main 2025-06-04 16:53:54 +05:30
DhivyaBharathy-web e22fda805f Add code analysis agent notebook 2025-06-04 11:20:39 +00:00
MervinPraison 2cde2fd731 Update test workflow to use custom test runner for 'fast' pattern and refine guardrail functionality in Task class
- Changed the test command in the GitHub Actions workflow to run a specific test runner script with a 'fast' pattern.
- Introduced guardrail functionality in the Task class to validate task outputs, including error handling and retry logic for guardrail validation failures.
- Enhanced the initialization of guardrail parameters and ensured proper type checking for guardrail functions.
2025-06-04 12:10:01 +01:00
Mervin Praison f7534681e5 Merge pull request #598 from MervinPraison/develop
Develop
2025-06-04 12:09:21 +01:00
MervinPraison 8c9e3e34cb agent sequential thinking 2025-06-04 11:52:53 +01:00
MervinPraison c470494d76 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-06-04 10:32:57 +01:00
Mervin Praison fdf3cac3e7 Merge pull request #596 from MervinPraison/codex/add-mcp-tool-to-agent-creation
Add MCP SSE tooling example
2025-06-04 10:32:06 +01:00
Mervin Praison ec98cd12c8 Merge pull request #597 from DhivyaBharathy-web/add-hackathon-agent-notebook
Add Hackathon Agent Notebook
2025-06-04 10:29:50 +01:00
DhivyaBharathy-web f318ef02a9 Add Hackathon Agent Notebook 2025-06-04 09:19:01 +00:00
claude[bot]andMervinPraison f086566a2d feat: improve MCP SSE tooling with comprehensive error handling and type safety
- Add comprehensive error handling to MCP initialization and tool execution
- Implement resource cleanup mechanisms with close() method and connection state tracking
- Fix interface typo: MCPPToolInfo -> MCPToolInfo
- Add schemaProperties getter to improve type safety in example code
- Prevent re-initialization of MCP client with guard clause
- Add debug logging throughout MCP lifecycle
- Improve example code with proper error handling for network failures
- Add better parameter mapping with object/positional argument support
- Include validation warnings for missing tools and argument mismatches
- Remove unused MCPTool import from example
- Add proper resource cleanup in finally block

These changes address the ENETUNREACH error mentioned in PR description by providing
graceful error handling when the MCP SSE server is unavailable.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2025-06-04 08:23:07 +00:00
Mervin Praison 6de011b69e Add MCP SSE example and dependency 2025-06-04 09:05:08 +01:00
MervinPraison 89d7821bc9 Update test workflow to use custom test runner for 'all' pattern 2025-06-04 07:38:10 +01:00
MervinPraison 9bff7eddbd Update coverage workflow to include installation of duckduckgo_search and knowledge dependencies from praisonai-agents 2025-06-04 07:18:25 +01:00
MervinPraison 82e5f11acf Enhance test workflows by replacing test runner with pytest for improved coverage reporting and adding Codecov upload steps for comprehensive, core, and quick validation tests. 2025-06-04 07:14:18 +01:00
Mervin Praison 0a4aaeb80d Merge pull request #595 from MervinPraison/develop
Update PraisonAI version to 2.2.26 across Dockerfiles and related con…
2025-06-04 07:08:32 +01:00
MervinPraison 70915e2535 Update PraisonAI version to 2.2.26 across Dockerfiles and related configurations 2025-06-04 07:06:23 +01:00
Mervin Praison f35dd76623 Merge pull request #594 from MervinPraison/codex/find-and-fix-bug-in-codebase
Fix redundant tool invocation
2025-06-04 07:03:42 +01:00
Mervin Praison fccd1197a8 Merge pull request #593 from anupamme/fix-yaml.docker-compose.security.writable-filesystem-service.writable-filesystem-service-docker-docker-compose.dev.yml-349c
Updated docker/docker-compose.dev.yml to fix security vulnerability [yaml.docker-compose.security.writable-filesystem-service.writable-filesystem-service]
2025-06-04 07:00:41 +01:00
Mervin Praisonandcoderabbitai[bot] 9390da7099 Update docker/docker-compose.dev.yml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-04 06:50:43 +01:00
Mervin Praison 8044fd7927 fix duplicate tool execution 2025-06-04 06:48:38 +01:00
anupamme cd5ba2017e fix: yaml.docker-compose.security.writable-filesystem-service.writable-filesystem-service-docker-docker-compose.dev.yml 2025-06-04 04:56:10 +00:00
Mervin Praison 8c6773b86e Merge pull request #592 from anupamme/fix-yaml.docker-compose.security.no-new-privileges.no-new-privileges-docker-docker-compose.dev.yml-7eaa
Updated docker/docker-compose.dev.yml to fix security vulnerability [yaml.docker-compose.security.no-new-privileges.no-new-privileges]
2025-06-04 05:27:56 +01:00
Mervin Praison 01539581c9 Update docker-compose.dev.yml 2025-06-04 05:27:00 +01:00
Mervin Praison bef8713769 Update docker-compose.dev.yml 2025-06-04 05:26:25 +01:00
Mervin Praisonandcoderabbitai[bot] f84445949e Update docker/docker-compose.dev.yml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-04 05:24:38 +01:00
anupamme 7c74df7cf9 fix: yaml.docker-compose.security.no-new-privileges.no-new-privileges-docker-docker-compose.dev.yml 2025-06-04 04:17:02 +00:00
Mervin Praison f576afa22c Merge pull request #590 from MervinPraison/claude/issue-588-20250603_160140
feat: enhance stateful agents with Session class and convenience methods
2025-06-04 05:04:54 +01:00
claude[bot]andMervinPraison 79c4ef1de3 fix: enhance stateful agents with SQLite compatibility and improved API
- Fix SQLite query compatibility in session state restoration
- Add type safety to increment_state and improve append_to_state
- Change API from session.create_agent() to session.Agent() (backward compatible)
- Clean up code style: remove unused imports, trailing whitespace, fix f-strings
- Fix missing limit parameter in search_knowledge method
- Update examples to use new API

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2025-06-04 03:52:09 +00:00
Mervin Praison 47e7c5b272 Delete docs/mint.json 2025-06-03 19:14:08 +01:00
Mervin Praison ec9310b1d1 Delete docs/features/stateful-agents.mdx 2025-06-03 19:13:57 +01:00
Mervin Praison 359bfd3759 Merge pull request #589 from MervinPraison/develop
chore: remove deprecated documentation files
2025-06-03 19:10:18 +01:00
MervinPraison c57e4724c1 chore: remove deprecated documentation files
- Deleted various obsolete documentation files to streamline the codebase.
- Ensured minimal code changes while maintaining the integrity of the remaining documentation.
2025-06-03 19:09:57 +01:00
claude[bot]andClaude 0b4739a6f9 feat: enhance stateful agents with Session class and convenience methods
Add minimal enhancements to PraisonAI's existing stateful capabilities:

- Add Session helper class for unified session management
- Add 9 convenience methods to PraisonAIAgents for enhanced state management
- Add comprehensive stateful agents documentation with examples
- Add 3 practical examples demonstrating session, workflow, and memory capabilities
- Maintain backward compatibility - all existing code continues to work

The implementation leverages existing robust infrastructure (Memory, Agent, Process classes)
rather than duplicating functionality, providing better developer experience through
improved APIs and documentation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-06-03 16:11:07 +00:00
Mervin Praison e90c78219d Merge pull request #586 from MervinPraison/develop
refactor: streamline test functions in test_scheduler.py
2025-06-03 16:28:49 +01:00
MervinPraison a640f0710d chore: add knowledge dependencies installation in python-package.yml
- Included installation of knowledge dependencies from praisonai-agents in the python-package workflow.
- Ensured minimal code changes while enhancing the functionality of the workflow.
2025-06-03 16:23:14 +01:00
MervinPraison 7216afbf13 chore: add knowledge dependencies installation in unittest.yml
- Included installation of knowledge dependencies from praisonai-agents in the unittest workflow.
- Ensured minimal code changes while enhancing the functionality of the testing process.
2025-06-03 16:15:34 +01:00
MervinPraison 3f7ea07fa2 chore: add knowledge dependencies installation in workflow files
- Included installation of knowledge dependencies from praisonai-agents in test-comprehensive.yml, test-extended.yml, and test-real.yml.
- Ensured minimal code changes while enhancing the functionality of the workflows.
2025-06-03 16:07:34 +01:00
MervinPraison 5d6792762c refactor: enhance test functions and error handling in approval tests
- Updated test functions to use `execute_command` and `write_file` for improved clarity and consistency.
- Added mock patches for auto-approval callbacks to streamline testing processes.
- Enhanced error handling to assert failures directly, ensuring better test reliability.
- Maintained adherence to minimal code change principles while improving overall test structure.
2025-06-03 16:05:22 +01:00
MervinPraison 092113cedd test update 2025-06-03 15:59:32 +01:00
MervinPraison 314eed51d5 refactor: standardise import paths and enhance error handling in test files
- Updated import paths in multiple test files for consistency and clarity.
- Improved error handling in approval tests to assert failures directly.
- Ensured minimal code changes while maintaining existing functionality and readability.
2025-06-03 14:54:41 +01:00
MervinPraison df26978b3c refactor: improve test structure and error handling in approval tests
- Enhanced readability by formatting command execution in `test_agent_with_auto_approval`.
- Updated import path handling in `test_approval_basic` for consistency.
- Simplified error handling in various test functions to assert failures directly.
- Ensured adherence to minimal code change principles while maintaining functionality.
2025-06-03 14:38:15 +01:00
MervinPraison 0ba0a6415c Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-06-03 13:49:26 +01:00
MervinPraison 0bd8e9f535 fix: ensure newline at end of file in test_graph_memory.py
- Added a newline at the end of the file to comply with standard coding practices.
- Maintained existing functionality while adhering to the principle of minimal code change.
2025-06-03 12:43:55 +01:00
MervinPraison 2dc02ed5a6 refactor: enhance test structure in test_scheduler.py
- Simplified test function structure for improved clarity and maintainability.
- Removed redundant error handling to streamline code execution.
- Ensured adherence to minimal code change principles while maintaining functionality.
2025-06-03 12:26:11 +01:00
MervinPraison ea4a2f3b69 refactor: streamline test functions in test_scheduler.py
- Removed unnecessary try-except blocks in test functions for cleaner code.
- Optimised the structure of test cases for better readability and maintainability.
- Ensured consistent import statements and improved error handling in test execution.
- Maintained functionality while adhering to the principle of minimal code change.
2025-06-03 11:25:35 +01:00
Mervin Praison 4df08daf36 Merge pull request #585 from MervinPraison/claude/issue-142-20250603_084931
fix: add Windows compatibility for shell commands in AICoder
2025-06-03 10:17:48 +01:00
Mervin Praisonandcoderabbitai[bot] a156c2e4a2 Update src/praisonai/praisonai/ui/components/aicoder.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-03 09:59:17 +01:00
claude[bot]andMervinPraison d039c2395b fix: add Windows compatibility for shell commands in AICoder
- Add platform import for OS detection
- Implement get_shell_command() method that wraps commands with 'cmd /c' on Windows
- Update execute_command() to use cross-platform command wrapper
- Fixes issue #142 where Unix commands could fail on Windows systems

Co-authored-by: MervinPraison <[email protected]>
2025-06-03 08:51:16 +00:00
Mervin Praison e6bd8d73e4 Merge pull request #584 from MervinPraison/claude/issue-192-20250603_080328
feat: add Azure OpenAI realtime API support via OPENAI_BASE_URL
2025-06-03 09:46:36 +01:00
Mervin Praison e3e4de9f13 Merge pull request #583 from DhivyaBharathy-web/main
Add FunctionAgent Workflow Notebook to Cookbooks
2025-06-03 09:46:04 +01:00
DhivyaBharathy 25b06caa75 Merge branch 'main' into main 2025-06-03 13:48:09 +05:30
claude[bot]andMervinPraison 0a4470dd17 feat: add Azure OpenAI realtime API support via OPENAI_BASE_URL
Replace Azure-specific environment variables with generic OPENAI_* variables:
- OPENAI_BASE_URL: Custom base URL for Azure OpenAI or other providers
- OPENAI_MODEL_NAME: Model name configuration
- OPENAI_API_KEY: API key (already supported)

Features:
- Automatic WebSocket URL conversion for Azure OpenAI endpoints
- Backward compatibility with existing MODEL_NAME variable
- Enhanced OpenAI client configuration in tools
- Updated documentation with Azure configuration examples

Resolves #192

Co-authored-by: MervinPraison <[email protected]>
2025-06-03 08:06:17 +00:00
DhivyaBharathy b65fae4b38 Update FunctionAgent_Workflow.ipynb 2025-06-03 12:43:38 +05:30
DhivyaBharathy-web aa6ef5a94d Added FunctionAgent_Workflow notebook 2025-06-03 07:07:47 +00:00
Mervin Praison cb551debfe Merge pull request #582 from MervinPraison/develop
Develop
2025-06-03 07:55:41 +01:00
MervinPraison fabd852002 chore: update PraisonAI version to 2.2.25 across Dockerfiles and documentation
- Updated the version of PraisonAI from 2.2.24 to 2.2.25 in all relevant Dockerfiles.
- Adjusted version references in README.md and various documentation files.
- Ensured consistency in package versioning for improved stability and performance.
2025-06-03 07:55:27 +01:00
MervinPraison 99de9f4d4f refactor: replace AsyncAsyncWebCrawler with AsyncWebCrawler in chat.py and code.py
- Updated import statements in chat.py and code.py to use AsyncWebCrawler for consistency.
- Modified default model name in realtime.py to include a specific date for clarity.
- Enhanced connection handling in RealtimeAPI to improve websocket connection checks and error handling.
- Added ensure_connected method in RealtimeClient for better connection management.
- Removed outdated realtimedocs.txt file to streamline the codebase.
2025-06-03 07:53:44 +01:00
Mervin Praison daaf92cbeb Merge pull request #581 from MervinPraison/claude/issue-289-20250603_061712
feat: Add domain context solution using existing features
2025-06-03 07:27:29 +01:00
claude[bot]andMervinPraison d8375cb50b feat: Add domain context solution using existing PraisonAI features
Fixes #289 - Multi-agent context issue

This solution demonstrates how to solve the domain context problem where tools 
default to "example.com" instead of user-specified domains. Uses 4 existing 
PraisonAI features:

1. Custom tool wrappers with domain injection
2. Agent instructions with domain context
3. Task context parameter for domain info
4. Shared memory for context persistence

Key benefits:
- No core SDK changes required
- Uses only existing framework features  
- Multi-layer context reliability
- 100% backward compatible
- Works for hierarchical and other processes

Co-authored-by: MervinPraison <[email protected]>
2025-06-03 06:22:53 +00:00
Mervin Praison 36ea8d381e Merge pull request #577 from DhivyaBharathy-web/add-arxiv-agent-notebook
Add arxiv agent notebook example to cookbooks
2025-06-02 11:49:40 +01:00
DhivyaBharathy 8a8f96e5e5 Update arXiv_agent_notebook.ipynb 2025-06-02 15:53:11 +05:30
DhivyaBharathy 7234587829 Update arXiv_agent_notebook.ipynb 2025-06-02 15:28:47 +05:30
DhivyaBharathy d916d0926a Update arXiv_agent_notebook.ipynb 2025-06-02 15:25:56 +05:30
DhivyaBharathy cd09b2de96 Update arXiv_agent_notebook.ipynb 2025-06-02 15:24:29 +05:30
DhivyaBharathy 58b8ad1969 Add files via upload 2025-06-02 15:22:04 +05:30
DhivyaBharathy-web 5e5b6672eb Add arxiv agent notebook example to cookbooks 2025-06-02 09:16:15 +00:00
Mervin Praison f7ce10b92e Merge pull request #566 from MervinPraison/claude/issue-12-20250601_032826
feat: Add human-in-the-loop approval system for dangerous tool operations
2025-06-02 09:42:59 +01:00
Mervin Praison eead19802d Merge pull request #576 from DhivyaBharathy-web/main
Add DuckDuckGo PraisonAI Agent Notebook
2025-06-02 09:40:25 +01:00
MervinPraison 208c8aad3b feat: enhance approval system with context-aware auto-approval
This commit introduces a context-aware auto-approval mechanism for the approval system, allowing non-interactive execution in CI environments. It modifies the test files to include a skip condition for interactive approvals and updates the approval callback logic to support automatic approvals when user input is not required.

Files modified:
- Updated test_approval_agent_integration.py to include auto-approval logic
- Updated test_approval_basic.py to include skip condition for interactive tests
- Updated test_approval_interactive.py to include auto-approval logic
- Enhanced approval.py with context management for approval tracking
- Modified agent.py to prevent double approval in context

This change improves the usability of the approval system in automated workflows while maintaining security.
2025-06-02 09:35:09 +01:00
DhivyaBharathy fb2b086dd5 Update DuckDuckGo_PraisonAI_Agent_Notebook.ipynb 2025-06-02 13:44:41 +05:30
DhivyaBharathy 75972372a6 Update DuckDuckGo_PraisonAI_Agent_Notebook.ipynb 2025-06-02 12:29:34 +05:30
DhivyaBharathy-web 108053bb32 Add DuckDuckGo PraisonAI Agent Notebook 2025-06-02 06:37:45 +00:00
MervinPraison fbddda54ba fix: update import paths in approval agent test files
This commit modifies the import paths in the test files for the approval agent to ensure they correctly reference the local development path. The changes streamline the path structure for better integration with the existing codebase.

Files modified:
- Updated import paths in test_approval_agent_integration.py
- Updated import paths in test_approval_basic.py
- Updated import paths in test_approval_interactive.py
2025-06-01 07:16:28 +01:00
MervinPraison 83427ca929 chore: remove obsolete test_approval_basic.py file
This commit deletes the outdated test_approval_basic.py file, which contained basic tests for the human approval system. The tests are no longer necessary as the functionality has been integrated into other components.

Files modified:
- Deleted test_approval_basic.py
2025-06-01 07:15:18 +01:00
Mervin Praison 36e5047e53 Merge pull request #574 from MervinPraison/claude/issue-444-20250601_050501
fix: resolve Knowledge RAG errors with mem0 API compatibility
2025-06-01 06:23:50 +01:00
claude[bot]andMervinPraison 05d8136433 fix: resolve Knowledge RAG errors with mem0 API compatibility
- Fix CustomMemory._add_to_vector_store method signature to support optional parameters with defaults
- Add backward compatibility for different message formats  
- Update memory.add() call to use correct messages format for mem0 API
- Add fallback mechanism to support both new and legacy API formats
- Resolves "takes 4 positional arguments but 5 were given" error
- Resolves "missing 1 required positional argument: 'infer'" error

Fixes #444

Co-authored-by: MervinPraison <[email protected]>
2025-06-01 05:09:01 +00:00
Mervin Praison af9b251b59 Merge pull request #573 from MervinPraison/claude/issue-107-20250601_045023
feat: integrate Mem0 graph memory support
2025-06-01 06:02:44 +01:00
Mervin Praison c8a6744469 Rename test_graph_memory.py to src/praisonai/tests/unit/test_graph_memory.py 2025-06-01 06:01:31 +01:00
claude[bot]andMervinPraison 678fd462c3 feat: integrate Mem0 graph memory support
- Add graph memory configuration support to Memory class
- Enhanced Knowledge class with graph store support  
- Added optional graph dependency group in pyproject.toml
- Comprehensive examples demonstrating graph memory usage
- Maintained full backward compatibility
- Added test scripts to verify implementation

Supports Neo4j and Memgraph as graph store providers.
Install with: pip install "praisonaiagents[graph]"

Co-authored-by: MervinPraison <[email protected]>
2025-06-01 04:56:24 +00:00
Mervin Praison ba03a0d893 Merge pull request #572 from MervinPraison/claude/issue-421-20250531_210257
feat: support LiteLLM provider-specific parameters
2025-06-01 05:42:39 +01:00
Mervin Praison 3be4c4c70e Merge pull request #571 from MervinPraison/develop
chore: update PraisonAI version to 2.2.24 across Dockerfiles and docu…
2025-06-01 05:38:39 +01:00
MervinPraison 709640240f chore: update PraisonAI version to 2.2.24 across Dockerfiles and documentation
- Updated the version of PraisonAI from 2.2.23 to 2.2.24 in all relevant Dockerfiles.
- Adjusted version references in README.md and various documentation files.
- Ensured consistency in package versioning for improved stability and performance.
2025-06-01 05:36:48 +01:00
Mervin Praison 93d526eb7b Merge pull request #570 from MervinPraison/claude/issue-122-20250601_041558
feat: add --merge CLI parameter for merging agents.yaml files
2025-06-01 05:33:20 +01:00
Mervin Praison 624a2cfa17 Merge pull request #567 from MervinPraison/claude/issue-121-20250531_210355
fix: prevent CLI conflicts when PraisonAI is used as library
2025-06-01 05:30:06 +01:00
Mervin Praison 4d2a6a2e2e Merge pull request #569 from MervinPraison/claude/issue-466-20250601_041120
feat: Add Mem0 built-in reranker support to Knowledge Agent
2025-06-01 05:29:01 +01:00
claude[bot]andMervinPraison a1bdb056a0 refactor: use argparse.Namespace instead of custom DefaultArgs class
Replace the custom DefaultArgs class with argparse.Namespace for better 
maintainability and consistency with argparse conventions. This addresses
the code review suggestion to use idiomatic Python patterns and avoid
duplication of argument handling logic.

Co-authored-by: MervinPraison <[email protected]>
2025-06-01 04:27:44 +00:00
Mervin Praison b4a6401bae Merge pull request #568 from MervinPraison/claude/issue-460-20250601_040421
fix: resolve MCP function signature parameter ordering issue
2025-06-01 05:25:20 +01:00
claude[bot]andMervinPraison 772ce7d2e2 feat: add --merge CLI parameter for merging agents.yaml files
- Add --merge flag to CLI with description for merging behavior
- Default behavior remains overwrite (backwards compatible)
- When --merge is used, preserves existing agents and adds new ones
- Implements intelligent conflict resolution by renaming duplicates
- Combines topics when both existing and new topics are present
- Added comprehensive error handling for invalid YAML files

Usage:
- praisonai --init "topic" (overwrites existing agents.yaml)
- praisonai --init "topic" --merge (merges with existing agents.yaml)

Co-authored-by: MervinPraison <[email protected]>
2025-06-01 04:19:11 +00:00
claude[bot]andMervinPraison 20c2d28f35 feat: Add Mem0 built-in reranker support to Knowledge Agent
- Add rerank parameter to Knowledge.search() method with backward compatibility
- Update memory search methods to pass rerank parameter to Mem0
- Add reranker configuration options with enabled/default_rerank settings
- Support all Mem0 advanced retrieval options (keyword_search, filter_memories)
- Create comprehensive example demonstrating reranker usage and performance
- Maintains full backward compatibility - existing code works unchanged
- Addresses issue #466 for improved RAG relevance with minimal latency impact

Co-authored-by: MervinPraison <[email protected]>
2025-06-01 04:14:24 +00:00
claude[bot]andMervinPraison f8589e4363 fix: resolve MCP function signature parameter ordering issue
Fix ValueError "non-default argument follows default argument" in MCP tool 
wrapper creation by ensuring required parameters come before optional 
parameters in function signatures.

- Separate required and optional parameters during signature creation
- Maintain backward compatibility and preserve all functionality
- Resolves GitHub MCP server initialization failures

Fixes #460

Co-authored-by: MervinPraison <[email protected]>
2025-06-01 04:05:36 +00:00
claude[bot]andMervinPraison 97d368d2e2 feat: Add human-in-the-loop approval system for dangerous tool operations
Implements human approval framework for dangerous operations like shell commands,
code execution, and file operations to enhance security and user control.

Key features:
- @require_approval decorator for marking dangerous tools  
- Risk-based approval (critical, high, medium, low)
- Console approval interface with rich formatting
- Custom approval callbacks for automated policies
- Async/sync support for all workflows
- Runtime configuration of approval requirements

Protected operations:
- Critical: execute_command, kill_process, execute_code
- High: write_file, delete_file, move_file, copy_file
- Medium: evaluate, crawl, scrape_page

Files modified:
- New approval.py module with core framework
- Enhanced main.py with approval callback support
- Modified agent.py to check approvals before tool execution
- Added @require_approval decorators to dangerous tools
- Comprehensive example and test implementations

Resolves: #12

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: MervinPraison <[email protected]>
2025-06-01 03:42:06 +00:00
Mervin Praison 49d9d40199 Merge pull request #565 from MervinPraison/claude/issue-97-20250531_205330
fix: implement litellm handling in code.py same as llm.py
2025-06-01 04:27:46 +01:00
claude[bot]andMervinPraison 445cc037ce fix: prevent CLI conflicts when PraisonAI is used as library
Adds minimal detection in parse_args() to skip CLI parsing when imported
as a library (e.g., by Fabric). Returns default args instead of trying
to parse external application's CLI arguments.

- Only 20 lines added to fix the specific Fabric compatibility issue
- Zero breaking changes - all existing CLI and library usage preserved
- Addresses the root cause from issue #121

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 21:07:12 +00:00
claude[bot]andMervinPraison c4e7b7dc7f feat: support LiteLLM provider-specific parameters
- Add extra_settings to LLM completion parameters
- Enables passing Ollama num_ctx and other provider params
- Maintains backward compatibility
- Addresses issue #421

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 21:05:41 +00:00
claude[bot]andMervinPraison 9e7c172f55 fix: implement litellm handling in code.py same as llm.py
Apply minimal changes to fix LiteLLM provider error:
- Add litellm configuration with drop_params and modify_params
- Add _build_completion_params() helper function
- Update acompletion calls to use proper parameter handling

This prevents "list index out of range" errors when using model names
like "gemini" without provider prefix by leveraging litellm's built-in
parameter validation and modification capabilities.

Fixes #97

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 20:55:14 +00:00
Mervin Praison d89570b085 Merge pull request #564 from MervinPraison/develop
chore: update PraisonAI version to 2.2.23 across Dockerfiles and docu…
2025-05-31 17:09:32 +01:00
MervinPraison ee5dfddccd chore: update PraisonAI version to 2.2.23 across Dockerfiles and documentation
- Updated the PraisonAI version from 2.2.22 to 2.2.23 in all relevant Dockerfiles.
- Adjusted version references in README.md, local-development.mdx, and other documentation files.
- Ensured consistency in versioning for deployment scripts and project files.

This change maintains compatibility with the latest features and fixes in PraisonAI.
2025-05-31 17:08:37 +01:00
Mervin Praison a3bfc6f795 Merge pull request #563 from MervinPraison/claude/issue-459-20250531_155633
fix: resolve MCP tools not working in Streamlit applications (issue #459)
2025-05-31 17:05:57 +01:00
Mervin Praison ebc130854d Merge pull request #562 from MervinPraison/claude/issue-5-20250531_154718
feat: add deployment scheduling functionality
2025-05-31 17:04:49 +01:00
Mervin Praison f40a5c1359 Rename schedule_config.yaml.example to src/praisonai/schedule_config.yaml.example 2025-05-31 17:04:06 +01:00
Mervin Praison 3284f7bbc6 Rename test_scheduler.py to src/praisonai/tests/unit/test_scheduler.py 2025-05-31 17:03:34 +01:00
claude[bot]andMervinPraison 87928611f7 fix: resolve MCP tools not working in Streamlit applications (issue #459)
This commit provides working examples and comprehensive documentation for using MCP tools with Streamlit, without modifying core MCP implementation.

Key fixes:
- Proper session state management to prevent agent re-initialization
- Use standard LLM format instead of provider/model format
- Comprehensive error handling and user feedback
- Working examples with troubleshooting guidance

Files added:
- examples/python/ui/mcp-streamlit-airbnb.py - Complete working Streamlit app
- examples/python/ui/mcp-streamlit-simple.py - Simple fixed version of original code
- docs/ui/streamlit/mcp-streamlit.mdx - Comprehensive documentation and troubleshooting

The root issue was improper usage patterns in Streamlit, not the core MCP implementation.

Co-authored-by: MervinPraison <[email protected]>

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-05-31 15:59:21 +00:00
Mervin Praison 2727bf5992 Merge pull request #561 from MervinPraison/claude/issue-170-20250531_154607
fix: resolve crawling NoneType concatenation error in realtime tools
2025-05-31 16:58:03 +01:00
claude[bot]andMervinPraison 45d04163c3 feat: add deployment scheduling functionality
- Add DeploymentScheduler with provider-agnostic design
- Support interval-based scheduling (daily, hourly, */6h, 3600s)
- CLI integration with --schedule and --schedule-config options
- Backward compatible with existing --deploy behavior
- Thread-safe scheduler with retry mechanism
- Example configuration file for scheduled deployments
- Test suite for validation

Addresses issue #5: --deploy schedule runs

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 15:53:57 +00:00
claude[bot]andMervinPraison 477d0d2e26 fix: resolve crawling NoneType concatenation error in realtime tools
- Fix "can only concatenate str (not "NoneType") to str" error in web crawling
- Update process_tavily_results and fallback_to_duckduckgo to use proper async patterns
- Add null checks for crawl_result.markdown to prevent NoneType errors
- Use async context manager with AsyncWebCrawler and await crawler.arun()
- Match the working async pattern used in chat.py

Fixes #170

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 15:48:02 +00:00
Mervin Praison 77394f5e5f Merge pull request #560 from MervinPraison/develop
Develop
2025-05-31 16:44:03 +01:00
MervinPraison 29e533c18c chore: remove unsloth training dependency from pyproject.toml
- Cleared the train dependencies list by removing unsloth[colab-new]>=2024.11.7.
- Commented out the unsloth dependency to maintain a record without affecting functionality.
2025-05-31 16:43:46 +01:00
MervinPraison 48dbea0566 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-31 12:42:45 +01:00
Mervin Praison 969d6697e1 Merge pull request #559 from MervinPraison/claude/issue-232-20250531_060542
fix: add dependency check for train command to prevent confusing errors
2025-05-31 12:42:22 +01:00
Mervin Praisonandcoderabbitai[bot] 787d2508b1 Update src/praisonai/pyproject.toml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-05-31 12:41:18 +01:00
claude[bot]andMervinPraison ec42dc92e4 feat: add unsloth training dependencies to pyproject.toml
- Add train optional dependencies with unsloth[colab-new]>=2024.11.7
- Update Poetry extras to include unsloth for train command
- Enables pip install "praisonai[train]" for training dependencies
- Maintains backward compatibility

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 10:45:40 +00:00
claude[bot]andMervinPraison 5b7bae2f43 fix: add dependency check for train command to prevent confusing errors
- Add TRAIN_AVAILABLE flag to track unsloth dependency availability
- Add dependency validation in both parse_args() and main() methods
- Show clear error message with installation instructions when dependencies missing
- Follow same pattern as other commands (chat, code, call, realtime) for consistency
- Fixes issue where train command would show "train not available" without helpful context

Resolves #232

Co-authored-by: MervinPraison <[email protected]>
2025-05-31 06:07:31 +00:00
MervinPraison 69a1efac47 fix(tests): update expected name in tool call parsing test for malformed JSON
- Changed the expected function name in the test for malformed JSON from 'hello_world' to 'unknown_function' to reflect correct error handling behaviour.
- Adjusted the Python path in the test file to point to the correct source directory for the praisonai-agents module.
2025-05-31 06:51:09 +01:00
Mervin Praison e6381139ec Merge pull request #558 from MervinPraison/develop
Develop
2025-05-30 18:10:59 +01:00
MervinPraison aca2a58971 chore: update PraisonAI version to 2.2.22 across Dockerfiles and documentation
- Updated the version of PraisonAI from 2.2.21 to 2.2.22 in all relevant Dockerfiles.
- Adjusted README and local development documentation to reflect the new version.
- Ensured consistency in versioning across all instances where PraisonAI is referenced.
2025-05-30 18:10:42 +01:00
MervinPraison 7a07ebd05e Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 18:06:46 +01:00
Mervin Praison 418d6c810b Merge pull request #557 from MervinPraison/claude/issue-471-20250530_151237
fix(ollama): resolve tool-call issues with local Ollama models
2025-05-30 18:04:17 +01:00
Mervin Praison 8bcfdfe713 Update and rename test_ollama_fix.py to src/praisonai/tests/unit/test_ollama_fix.py 2025-05-30 18:01:53 +01:00
claude[bot]andMervinPraison 57f2fa0471 fix(ollama): resolve tool-call issues with local Ollama models
- Fix tool parameter logic in agent.py to handle empty tools list properly
- Add comprehensive Ollama provider detection via model name and env vars
- Implement centralized tool call argument parsing with error handling
- Add consistent JSON error handling for all providers (sync and async)
- Users no longer need to pass tools to both agents AND tasks

Fixes #471

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 15:17:06 +00:00
MervinPraison 2fdffd2d8d playwright mcp 2025-05-30 15:56:30 +01:00
Mervin Praison 471a6a106c Update article_generation_agents.ipynb 2025-05-30 15:41:18 +01:00
Mervin Praison 7c51c3aad1 Update article_generation_agents.ipynb 2025-05-30 15:40:48 +01:00
Mervin Praison dfa261f5ef Merge pull request #556 from MervinPraison/develop
chore: update PraisonAI version to 2.2.21 across Dockerfiles and docu…
2025-05-30 15:36:44 +01:00
MervinPraison 9a97f0b80f chore: update PraisonAI version to 2.2.21 across Dockerfiles and documentation
- Updated the version of PraisonAI from 2.2.20 to 2.2.21 in all relevant Dockerfiles.
- Adjusted README and local development documentation to reflect the new version.
- Ensured consistency in versioning across all instances where PraisonAI is referenced.
2025-05-30 15:36:03 +01:00
Mervin Praison eef9a5f7ae Merge pull request #555 from MervinPraison/claude/issue-18-20250530_125354
feat: Add comprehensive secondary market research agent system
2025-05-30 14:24:29 +01:00
Mervin Praison 510e9b1797 Merge pull request #554 from MervinPraison/claude/issue-23-20250530_125338
Add CSV processing examples for issue #23
2025-05-30 14:22:23 +01:00
Mervin Praison 89f48cf7a2 Merge pull request #553 from MervinPraison/develop
chore: update PraisonAI version to 2.2.20 across Dockerfiles and docu…
2025-05-30 14:16:47 +01:00
MervinPraison 97fb7fdd52 chore: update PraisonAI version to 2.2.20 across Dockerfiles and documentation
- Updated the version of PraisonAI from 2.2.19 to 2.2.20 in all relevant Dockerfiles.
- Adjusted README and local development documentation to reflect the new version.
- Ensured consistency in versioning across all instances where PraisonAI is referenced.
2025-05-30 14:16:19 +01:00
Mervin Praison ea4cb42324 Merge pull request #552 from MervinPraison/claude/issue-115-20250530_125352
fix: resolve ForwardRef TypeError for praisonai code command
2025-05-30 14:14:11 +01:00
claude[bot]andMervinPraison 43da66d129 feat: Add comprehensive secondary market research agent system
- Multi-agent system with 6 specialized research agents
- Customizable parameters for company, geography, industry, and sections
- YAML configuration for easy setup and customization
- FastAPI integration with async job processing and REST API
- Professional report generation suitable for business decision-making
- Jupyter notebook with multiple implementation examples
- Complete documentation and usage guidelines

Addresses issue #18 - Secondary market research agent with customization

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 13:00:21 +00:00
claude[bot]andMervinPraison e1a61959ea feat: Add comprehensive CSV processing examples for issue #23
- Add simple CSV URL processor for basic use cases
- Add comprehensive CSV processing with 4 different methods
- Add complete documentation with setup and troubleshooting
- Address GitHub issue #23: "How to pass in a CSV file"
- Support sequential processing of URLs and other CSV data
- Include validation, error handling, and multiple processing patterns

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 12:58:39 +00:00
Mervin Praison 71c5b929b7 Merge pull request #551 from MervinPraison/develop
Develop
2025-05-30 13:57:04 +01:00
claude[bot]andMervinPraison c9edf19907 fix: resolve ForwardRef TypeError for praisonai code command
Fixes #115

Resolves TypeError: ForwardRef._evaluate() missing recursive_guard argument when running `praisonai code`.

## Changes
- Moved crewai import from module level to conditional import in handle_direct_prompt
- The `code` command doesn't need crewai, only chainlit and other UI dependencies
- Follows existing pattern for optional dependencies

## Testing
- `praisonai code` now works without requiring crewai installation
- Direct prompt functionality still works when crewai is available

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 12:56:57 +00:00
MervinPraison 6cdc79f4a2 fix: update import path for database_config module in unit tests
- Adjusted the import statement in test_database_config.py to reference the correct module path.
- Ensures that the tests can locate the database_config functionalities properly.
2025-05-30 13:56:49 +01:00
MervinPraison fdda350b72 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 13:33:56 +01:00
Mervin Praison 85f748d5d1 Merge pull request #549 from DhivyaBharathy-web/add-langchain-praisonai-agents-notebook
Add LangChain + PraisonAI agents Colab notebook
2025-05-30 13:33:50 +01:00
MervinPraison bf24548598 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 13:33:24 +01:00
Mervin Praison a1622a2a79 Merge pull request #550 from MervinPraison/claude/issue-17-20250530_113738
feat: add piped input support to CLI
2025-05-30 13:32:57 +01:00
DhivyaBharathy-web 209faff03c Add LangChain + PraisonAI agents Colab notebook 2025-05-30 11:49:03 +00:00
Mervin Praison ad67089813 Merge pull request #548 from MervinPraison/claude/issue-201-20250530_113510
fix: move OpenAI API key validation from import-time to runtime
2025-05-30 12:41:49 +01:00
claude[bot]andMervinPraison 3e44eadd37 feat: add piped input support to CLI
Implement piped command functionality similar to fabric project, allowing:
- echo "content" | praisonai "command"
- cat file.txt | praisonai --auto "task"
- echo "question" | praisonai

Added read_stdin_if_available() method to detect and read piped input,
and modified main() to handle piped content in three scenarios:
1. Command + piped input
2. Direct prompt + piped input  
3. Only piped input

Fixes #17

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 11:39:42 +00:00
claude[bot]andMervinPraison 764e9aa838 fix: move OpenAI API key validation from import-time to runtime in call.py
- Removes import-time API key requirement that prevented GUI startup
- Moves validation to run_server() function where it's actually needed
- Allows PraisonAI to start without OpenAI API key for non-voice features
- Users can now configure API key through existing GUI interfaces
- Follows existing codebase patterns for conditional feature validation

Fixes #201

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 11:39:28 +00:00
Mervin Praison ccfc92564e Merge pull request #547 from MervinPraison/claude/issue-140-20250529_041935
fix: add fallback mechanism for conda run failure in training
2025-05-30 12:33:06 +01:00
MervinPraison 1f61000922 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 12:30:26 +01:00
Mervin Praison 2164f3e658 Merge pull request #546 from MervinPraison/claude/issue-190-20250530_111525
fix: add console scripts to project.scripts section for pip compatibility
2025-05-30 12:30:18 +01:00
MervinPraison 739a9ff8b5 docker 2025-05-30 12:28:49 +01:00
MervinPraison dbe63cbbc9 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 12:27:33 +01:00
Mervin Praison f4bff11e83 Merge pull request #545 from MervinPraison/claude/issue-130-20250530_105428
feat: implement comprehensive Docker support and package publishing for issue #130
2025-05-30 12:27:23 +01:00
Mervin Praison 6552f61322 Update __init__.py 2025-05-30 12:26:57 +01:00
Mervin Praison d5d898ff1b Update __init__.py 2025-05-30 12:26:15 +01:00
Mervin Praison 4df8d122fc Update __init__.py 2025-05-30 12:25:51 +01:00
Mervin Praison 766e5789e3 Update __init__.py 2025-05-30 12:25:14 +01:00
Mervin Praison f9585e83cb Delete src/praisonai/praisonai/inc/directory_manager.py 2025-05-30 12:24:57 +01:00
claude[bot]andMervinPraison e019bab987 fix: address critical security and implementation issues
- Remove automatic directory initialization on package import to prevent unexpected file operations
- Add DOCKER_CONTAINER=true environment variable to all Dockerfiles
- Fix hardcoded password security issue in docker-compose.dev.yml
- Prevent api.py overwrite in main Dockerfile by checking if file exists
- Use non-editable pip install in production Dockerfile for praisonaiagents
- Move package installations from runtime commands to Dockerfile build stage for better efficiency

These fixes address the critical issues identified in the code review while maintaining the core functionality.

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 11:20:27 +00:00
claude[bot]andMervinPraison 54072a1d55 fix: add console scripts to project.scripts section for pip compatibility
- Add [project.scripts] section with praisonai, setup-conda-env, and praisonai-call entry points
- Fixes issue where praisonai command was not found when installing with pip instead of Poetry
- Entry points were only defined in [tool.poetry.scripts] which pip ignores
- Maintains compatibility with both pip and Poetry installation methods

Fixes #190

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 11:17:09 +00:00
Mervin Praison 16ddcb8644 Merge pull request #544 from MervinPraison/claude/issue-246-20250530_105609
fix: add targeted o1 model support for system messages
2025-05-30 12:06:16 +01:00
MervinPraison e0b9739b66 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 12:04:03 +01:00
claude[bot]andMervinPraison 1bb6c8ca61 fix: add targeted o1 model support for system messages
- Add `_needs_system_message_skip()` method to detect legacy o1 models
- Skip system messages only for specific models: o1-preview, o1-mini, o1-mini-2024-09-12
- Update all 4 system message handling locations in LLM class
- Maintains backward compatibility for all other models
- Fixes 400 error for legacy o1 models that don't support system messages

Fixes #246

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 11:03:18 +00:00
claude[bot]andMervinPraison a242a26353 feat: implement directory management solution for issue #130
- Add DirectoryManager class to organize files in ~/.praison/
- Automatic migration of existing configuration files from root
- Environment variable management for proper config paths
- Solves directory clutter issue (chainlit.md, .chainlit, public)

Co-Authored-By: MervinPraison <[email protected]>
2025-05-30 11:01:42 +00:00
claude[bot]andMervinPraison ff4f63fc54 feat: add Docker documentation and development setup
- Comprehensive Docker setup guide and documentation
- Environment template for easy configuration
- Development Docker Compose with hot reload
- Interactive quick-start script for user convenience

Co-Authored-By: MervinPraison <[email protected]>
2025-05-30 11:01:35 +00:00
claude[bot]andMervinPraison 48707686f0 feat: update Docker configurations for improved multi-service setup
- Add new praisonaiagents Dockerfile
- Update docker-compose.yml with multi-service orchestration
- Align versions across all Dockerfiles
- Add directory management environment variables
- Support for ~/.praison/ configuration directory

Co-Authored-By: MervinPraison <[email protected]>
2025-05-30 11:01:23 +00:00
MervinPraison 1a414989bf Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-30 11:59:17 +01:00
Mervin Praison 141535c160 Merge pull request #543 from MervinPraison/claude/issue-238-20250528_161801
feat: add camera integration examples and documentation
2025-05-30 11:58:29 +01:00
MervinPraison 6911d6ad64 fix: Update import path for database_config module in unit tests
- Adjusted the sys.path in test_database_config.py to correctly locate the database_config module.
- Ensured compatibility with the module's new location for improved test functionality.
2025-05-30 11:51:29 +01:00
Mervin Praison 6b4be5ca2f Merge pull request #542 from MervinPraison/develop
chore: Update praisonai version to 2.2.19 across Dockerfiles and rela…
2025-05-30 11:46:35 +01:00
MervinPraison a5d08f8f33 chore: Update praisonai version to 2.2.19 across Dockerfiles and related configurations
- Increment praisonai version from 2.2.18 to 2.2.19 in Dockerfiles and deployment scripts
- Update version in pyproject.toml for praisonaiagents from 0.0.91 to 0.0.92
- Ensure consistency across all relevant files for the new version

This update addresses compatibility and feature improvements associated with the latest praisonai release.
2025-05-30 11:46:15 +01:00
Mervin Praison 8e0fa939a4 Merge pull request #540 from MervinPraison/claude/issue-240-20250528_161140
fix: Add DeepSeek compatibility fallback for hierarchical process mode
2025-05-30 11:42:07 +01:00
Mervin Praison 359d02bd56 Merge pull request #537 from MervinPraison/claude/issue-335-20250529_033521
fix: Add FORCE_SQLITE environment variable to bypass production database detection
2025-05-30 11:12:41 +01:00
Mervin Praison 7630e35622 Rename test_database_config.py to src/praisonai/tests/unit/test_database_config.py 2025-05-30 11:12:21 +01:00
claude[bot]andMervinPraison 1fc3a22335 refactor: centralize FORCE_SQLITE logic to eliminate code duplication
- Create shared database_config module with utility functions
- Eliminate duplicated FORCE_SQLITE parsing logic between db.py and sql_alchemy.py  
- Improve maintainability by centralizing database configuration logic
- Add comprehensive test coverage for all scenarios

Addresses reviewer feedback from CodeRabbit and Gemini Code Assist

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 10:09:52 +00:00
claude[bot]andMervinPraison 3d56de7d64 fix: Resolve async client usage and improve error handling in DeepSeek fallback
- Fix critical async client usage by importing and using AsyncOpenAI for async methods
- Add proper exception chaining with 'from' clauses and detailed logging
- Implement JSON parsing error handling with specific exception types
- Replace hardcoded JSON structure prompts with dynamic schema generation
- Enhance fallback mechanism robustness for DeepSeek compatibility

Fixes identified issues:
- Lines 168 & 181: Async methods now use proper AsyncOpenAI clients
- Lines 124 & 164: Exception handling now chains errors properly
- Lines 158-160 & 192-194: JSON parsing wrapped in try-catch blocks
- Lines 119 & 145: Dynamic prompt generation from Pydantic schemas

Co-authored-by: MervinPraison <[email protected]>
2025-05-30 09:48:12 +00:00
Mervin Praison 6008f5c9b6 Merge pull request #541 from MervinPraison/claude/issue-337-20250528_160403
feat: Add SearxNG search tool for privacy-focused web searches
2025-05-30 10:38:22 +01:00
Mervin Praison 6b9a186751 Merge pull request #539 from DhivyaBharathy-web/add-advanced-react-agent-notebook
Add Advanced ReAct Agent notebook to cookbooks
2025-05-30 09:16:32 +01:00
Mervin Praison ce0e46b7f4 Merge pull request #538 from DhivyaBharathy-web/add-joke-agent-notebook
Add Joke Agent notebook to cookbooks
2025-05-30 09:15:46 +01:00
DhivyaBharathy-web 74563a2fbb Add Advanced ReAct Agent notebook to cookbooks 2025-05-29 13:46:48 +00:00
DhivyaBharathy-web 92324d55d2 Add Joke Agent notebook to cookbooks 2025-05-29 07:32:17 +00:00
Mervin Praison 280c66ad94 Merge pull request #535 from MervinPraison/claude/issue-332-20250528_161954
fix: improve API key validation for LM Studio and local servers
2025-05-29 05:45:14 +01:00
claude[bot]andMervinPraison dc9faba1c9 refactor: improve API key validation with constants and enhanced local server detection
- Add LOCAL_SERVER_API_KEY_PLACEHOLDER constant for consistency
- Improve error messages to clearly distinguish default OpenAI vs local servers
- Enhance local server detection with urlparse for localhost/127.0.0.1 handling
- Remove hardcoded "nokey" fallback that masked missing API key issues
- Maintain full backward compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2025-05-29 04:41:10 +00:00
Mervin Praison 10d9f00fd5 Update models.py 2025-05-29 05:30:08 +01:00
Mervin Praison 5c9ac6f222 Merge branch 'main' into claude/issue-332-20250528_161954 2025-05-29 05:27:36 +01:00
Mervin Praisonandgemini-code-assist[bot] 8ea7c3289f Update src/praisonai/praisonai/inc/models.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-05-29 05:22:03 +01:00
Mervin Praison 2ac83534d8 Merge pull request #536 from MervinPraison/claude/issue-307-20250528_161908
fix: resolve asyncio event loop error in memory callbacks
2025-05-29 05:21:20 +01:00
claude[bot]andMervinPraison ba5af94dcb fix: add fallback mechanism for conda run failure in training
- Add robust conda environment detection and setup validation
- Implement fallback to direct Python execution when conda fails
- Maintain backward compatibility while improving reliability
- Handle cases where conda is not available or environment setup fails

Fixes #140

Co-authored-by: MervinPraison <[email protected]>
2025-05-29 04:20:59 +00:00
Mervin Praison b1d9ef567b Merge pull request #534 from MervinPraison/develop
2.2.18
2025-05-29 04:52:31 +01:00
MervinPraison e633ad959d chore: update PraisonAI version and enhance environment variable handling
- Upgraded PraisonAI version from 2.2.17 to 2.2.18 across multiple Dockerfiles and configuration files for improved functionality.
- Enhanced GitHub Actions workflow by exporting additional environment variables related to the OpenAI API, improving integration and debugging capabilities.

These changes aim to ensure better performance and reliability in the workflow and API interactions.
2025-05-29 04:51:53 +01:00
MervinPraison 27065af652 chore: enhance API key handling and testing in workflows
- Introduced a dummy class for SecretStr to handle cases where Pydantic is not available, ensuring compatibility in minimal contexts.
- Added a utility function to display API key values more securely, improving the visibility of sensitive information during testing.
- Updated test cases to ensure the OPENAI_API_KEY is available for subprocess commands, enhancing the reliability of tests that require real API interactions.

These changes aim to improve the robustness of API key handling and enhance the testing framework's functionality.
2025-05-29 04:38:51 +01:00
claude[bot]andMervinPraison 46585a88e6 fix: Add FORCE_SQLITE environment variable to bypass production database detection
- Add FORCE_SQLITE flag in both db.py and sql_alchemy.py
- When FORCE_SQLITE=true, ignores DATABASE_URL and SUPABASE_DATABASE_URL
- Forces SQLite usage to prevent accidental production database connections
- Maintains backward compatibility with default behavior (FORCE_SQLITE=false)
- Resolves database conflict issues in production environments

Fixes #335

Co-authored-by: MervinPraison <[email protected]>
2025-05-29 03:36:38 +00:00
Mervin Praison 312d1a8734 Merge pull request #532 from MervinPraison/develop
Develop
2025-05-28 18:41:01 +01:00
MervinPraison 311034e78b chore: update PraisonAI dependencies and enhance model testing in workflows
- Upgraded PraisonAI version from 2.2.16 to 2.2.17 across multiple Dockerfiles and configuration files for improved functionality.
- Enhanced the testing of the PraisonAIModel by explicitly passing the API key and base URL, improving integration with CrewAI.
- Added error handling during model instantiation to provide clearer feedback on failures, enhancing debugging capabilities.

These changes aim to ensure better performance and reliability in the workflow and model interactions.
2025-05-28 18:40:48 +01:00
MervinPraison 509d8492ec chore: add debugging steps for PraisonAI API key validation in GitHub Actions workflow
- Introduced additional checks to verify the presence and validity of the OpenAI API key within the workflow.
- Added a new step to directly test the PraisonAI API key usage, enhancing visibility into the API key configuration and its integration with the PraisonAI model.
- These changes aim to improve debugging capabilities and ensure proper API key handling during the workflow execution.
2025-05-28 18:33:25 +01:00
MervinPraison cb4ee28e7e chore: enhance GitHub Actions workflows with environment variable debugging
- Added steps to set and debug environment variables related to the OpenAI API in the GitHub Actions workflows.
- Included checks for the availability of the API key and its fallback mechanism, improving visibility during execution.
- Enhanced dependency installation commands for better integration with the existing setup.

These changes aim to streamline the workflow and provide clearer insights into the environment configuration.
2025-05-28 18:27:08 +01:00
MervinPraison 7f23daf670 chore: enhance testing workflow and API test execution
- Added new steps to the GitHub Actions workflow to run real API tests and end-to-end tests with the actual OpenAI API key.
- Removed API key validation checks from test cases, allowing all tests to run regardless of API key status.
- Streamlined test cases for better readability and maintainability.

These changes improve the testing process and ensure comprehensive test coverage.
2025-05-28 18:17:55 +01:00
MervinPraison 223650dad5 chore: update .gitignore to include additional test directories for CrewAI
- Added entries to the .gitignore file to ensure that integration and end-to-end test directories for CrewAI are not ignored.
- This change enhances the visibility of relevant test files during the development process.
2025-05-28 18:08:16 +01:00
MervinPraison 1e23d76742 chore: add debugging steps to GitHub Actions workflow for CrewAI tests
- Introduced a new debugging section to display the directory structure and contents relevant to CrewAI tests.
- Enhanced the test execution process by attempting multiple methods to run CrewAI tests, providing clearer feedback on failures.

These changes aim to improve visibility and troubleshooting during the testing process.
2025-05-28 18:03:38 +01:00
MervinPraison 83adac3709 chore: enhance GitHub Actions workflow and test cases
- Added debugging steps to check API key availability and log environment variables in the GitHub Actions workflow.
- Updated test cases to remove API key validation checks, ensuring all tests run regardless of API key status.
- Renamed test steps for clarity and improved readability.

These changes improve the testing process and provide better insights during execution.
2025-05-28 17:58:44 +01:00
MervinPraison e3a5f87a1f chore: enhance test workflow and API key handling
- Added PYTHONPATH to the GitHub Actions environment for improved module accessibility.
- Updated legacy test command to skip execution if the API key is invalid, providing clearer output.
- Optimised command execution in test cases for better readability and maintainability.

These changes improve the testing process and ensure better handling of API key scenarios.
2025-05-28 17:53:00 +01:00
MervinPraison 63f94c6a4d refactor: streamline API test skipping and result validation in test cases
- Updated test cases to provide clearer messages for skipping tests due to invalid/test API keys.
- Simplified result validation by asserting non-null results instead of checking for specific output strings.
- Removed redundant exception handling for API errors, focusing on essential functionality.

This change enhances readability and maintainability of the test code.
2025-05-28 17:32:34 +01:00
claude[bot]andMervinPraison ecb4974333 fix: improve API key validation for LM Studio and local servers
- Replace hardcoded "xxxx" fallback in main.py with proper validation
- Replace hardcoded "nokey" fallback in models.py with proper validation  
- Add automatic detection and support for local servers (LM Studio, etc.)
- Provide clear error messages when API keys are missing
- Support multiple base URL environment variable patterns

Fixes #332

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 16:23:06 +00:00
claude[bot]andMervinPraison 955a05be59 feat: add camera integration examples and documentation
- Add comprehensive camera integration examples in examples/python/camera/
  - camera-basic.py: Single frame capture and analysis
  - camera-continuous.py: Continuous monitoring system
  - camera-multi-agent.py: Multi-agent parallel analysis
  - camera-video-analysis.py: Video recording and temporal analysis
  - README.md: Complete documentation for all examples

- Add camera integration documentation in docs/features/camera-integration.mdx
  - Complete integration patterns and use cases
  - Configuration options and best practices
  - Troubleshooting guide and security considerations
  - Links to example code

- Update docs/mint.json to include camera integration in navigation

Addresses issue #238 regarding multimodel agent camera input

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 16:22:02 +00:00
MervinPraison b95b88d0cb Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-28 17:20:57 +01:00
claude[bot]andMervinPraison f6526ab127 fix: resolve asyncio event loop error in memory callbacks
- Replace deprecated asyncio.get_event_loop() with asyncio.get_running_loop()
- Add proper RuntimeError handling for non-main threads (Streamlit)
- Fix memory dependency checking to use warnings instead of exceptions
- Improves compatibility with Python 3.10+ and threaded environments

Fixes #307

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 16:20:44 +00:00
Mervin Praison 9b155e54e2 Merge pull request #531 from MervinPraison/claude/issue-247-20250528_143914
fix: resolve PydanticSchemaGenerationError for List[Any] and BaseModel fields
2025-05-28 17:20:30 +01:00
claude[bot]andMervinPraison 66dc2e3c48 fix: Add DeepSeek compatibility fallback for hierarchical process mode
- Add JSON fallback when structured output fails
- Implements minimal code change solution for issue #240  
- Maintains compatibility with both OpenAI and DeepSeek APIs
- Uses try-catch to gracefully fallback from structured output to JSON mode
- Enhanced prompts for better JSON parsing reliability

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 16:14:48 +00:00
claude[bot]andMervinPraison 90c3a90752 feat: Add SearxNG search tool for privacy-focused web searches
- Implement SearxNG search tool following PraisonAI patterns
- Add comprehensive documentation with setup instructions
- Include working examples for both tools and agents
- Support configurable SearxNG URL and search parameters
- Integrate with existing tools registry and documentation
- Provide privacy-focused alternative to traditional search engines

Addresses issue #337

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 16:07:30 +00:00
Mervin Praison a2d7629492 Merge pull request #530 from MervinPraison/claude/issue-311-20250528_143819
fix: Memory error with wrong LLM model #311
2025-05-28 17:05:58 +01:00
Mervin Praison a904673325 Merge pull request #529 from MervinPraison/claude/issue-388-20250528_154600
fix: resolve Python 3.8 compatibility issue with tuple type annotation
2025-05-28 16:56:42 +01:00
Mervin Praison a6d1ef93e0 Merge pull request #528 from MervinPraison/claude/issue-393-20250528_143351
fix: update chainlit Action constructor to use payload parameter
2025-05-28 16:54:12 +01:00
Mervin Praison d1989159bc Merge pull request #526 from MervinPraison/claude/issue-394-20250528_143330
fix: Support OPENAI_BASE_URL and MODEL_NAME for Ollama integration
2025-05-28 16:53:04 +01:00
Mervin Praison b2a0f5b341 Merge pull request #527 from MervinPraison/claude/issue-457-20250528_143145
fix: correct knowledge_sources parameter in AutoAgents
2025-05-28 16:52:54 +01:00
claude[bot]andMervinPraison caabe553ce fix: resolve Python 3.8 compatibility issue with tuple type annotation
- Change `tuple[List[Agent], List[Task]]` to `Tuple[List[Agent], List[Task]]` in autoagents.py:258
- Add `Tuple` import to typing imports
- Add `requires-python = ">=3.8"` to pyproject.toml

Fixes #388

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 15:47:23 +00:00
MervinPraison f62601ed47 Add API key validation check to skip tests when invalid key is provided 2025-05-28 16:05:33 +01:00
claude[bot]andMervinPraison 402796020c fix: resolve PydanticSchemaGenerationError for List[Any] and BaseModel fields
- Add arbitrary_types_allowed=True to LoopItems model in process.py
- Add arbitrary_types_allowed=True to TaskOutput model in main.py  
- Add arbitrary_types_allowed=True to AgentConfig and AutoAgentsConfig models in autoagents.py
- Import ConfigDict from pydantic in all affected files

Fixes #247

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 14:45:13 +00:00
claude[bot]andMervinPraison 3a30c3813d fix: Pass agent's LLM model to memory quality metrics calculation
Fixes issue where memory system was using hardcoded gpt-4o model instead of user's configured LLM (e.g., llama3 with Ollama). The calculate_quality_metrics method now receives the agent's LLM configuration to use the correct model for quality evaluation.

Resolves #311

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 14:42:56 +00:00
Mervin Praison 8e16621f46 Merge pull request #525 from MervinPraison/claude/issue-404-20250524_061713
Fix TypeError in AutoAgents: change knowledge_sources to knowledge parameter
2025-05-28 15:39:24 +01:00
claude[bot] f86e9ef470 docs: Update Ollama integration documentation with new environment variables
- Added standard OpenAI SDK environment variables (OPENAI_BASE_URL, MODEL_NAME)
- Documented alternative patterns (OLLAMA_API_BASE) from community feedback
- Added complete usage example with praisonai --init
- Maintained backward compatibility documentation for legacy patterns

Related to #394 - Now users have clear documentation on how to properly
configure Ollama with the fixed environment variable support.
2025-05-28 14:38:43 +00:00
claude[bot] c4058143aa chore: Remove temporary test file after verifying Ollama fix
The test file was created to verify the Ollama integration fix works correctly
and is no longer needed in the repository.
2025-05-28 14:38:21 +00:00
claude[bot]andMervinPraison 6b4ed568a8 fix: Support OPENAI_BASE_URL and MODEL_NAME environment variables for Ollama integration
- Fixed auto.py to check OPENAI_BASE_URL before OPENAI_API_BASE
- Added support for MODEL_NAME environment variable (community requested)
- Added support for OLLAMA_API_BASE environment variable  
- Applied same fixes to cli.py for consistency
- Added comprehensive test script to verify the fix

Fixes #394 - Users can now use standard OpenAI SDK environment variables:
- OPENAI_BASE_URL=http://localhost:11434/v1 
- MODEL_NAME=deepseek-r1:14b
- OPENAI_API_KEY=NA

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 14:38:15 +00:00
claude[bot]andMervinPraison 1ba540f0ab fix: update chainlit Action constructor to use payload parameter
- Replace deprecated 'value' parameter with 'payload' in cl.Action constructor
- Fixes ValidationError when executing 'python -m praisonai ui'
- Updates both agents.py and chainlit_ui.py files
- Resolves compatibility issue with chainlit 2.5.5

Resolves #393

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 14:35:20 +00:00
claude[bot]andMervinPraison ce4103d311 fix: correct knowledge_sources parameter in AutoAgents
- Fixed parameter name mismatch in AutoAgents._create_agents_and_tasks()
- Changed 'knowledge_sources' to 'knowledge' when passing to Agent constructor
- Resolves TypeError when using AutoAgents with DuckDuckGo tool

Fixes #457

Co-authored-by: MervinPraison <[email protected]>
2025-05-28 14:33:40 +00:00
Mervin Praison a21c9ea15a Merge pull request #524 from MervinPraison/develop
Remove unused agent files and clean up test directory by deleting obs…
2025-05-28 14:49:08 +01:00
MervinPraison 422d638cd4 Refactor mock completion function in mini agents tests for improved clarity and functionality 2025-05-28 14:13:02 +01:00
MervinPraison baa5caf3c3 Update test mocks in mini agents to use the correct model class path 2025-05-27 10:21:15 +01:00
MervinPraison 4a51cae4f8 Update test mocks for mini agents to reference the correct class path 2025-05-27 10:19:07 +01:00
MervinPraison caa4473871 Update GitHub Actions workflow to use absolute paths for agent scripts 2025-05-27 10:08:57 +01:00
MervinPraison acdfc54302 Fix file paths and add test mocking for mini agents sequential tests 2025-05-27 09:57:37 +01:00
MervinPraison 3856be09df Remove unused agent files and clean up test directory by deleting obsolete test scripts and configuration files. 2025-05-27 09:49:57 +01:00
Mervin Praison 81f0f49d15 Merge pull request #523 from MervinPraison/develop
Reorganize examples directory structure and update file paths
2025-05-27 07:56:34 +01:00
MervinPraison 13e425e0ac Reorganize examples directory structure and update file paths 2025-05-27 07:56:14 +01:00
Mervin Praison 9c9a8b249e Merge pull request #522 from MervinPraison/develop
Develop
2025-05-27 07:32:17 +01:00
MervinPraison ff4ab536af Moved cookbook examples to examples/cookbooks directory and reorganized YAML files 2025-05-27 07:31:59 +01:00
MervinPraison 7a7b9bd0d4 Reorganize docs structure and update package dependencies for v2.2.16 2025-05-27 07:15:50 +01:00
Mervin Praison 8900fdcc95 Merge pull request #521 from MervinPraison/develop
Restructure
2025-05-27 07:08:47 +01:00
MervinPraison e7f7b1239c Add initial README with package description and directory structure 2025-05-27 07:06:17 +01:00
MervinPraison 9596b49f3c Update GitHub Actions workflow directory paths and add package README.md 2025-05-27 07:04:51 +01:00
MervinPraison 6fa66157ae Add cd src/praisonai before package installation in CI workflows 2025-05-27 06:57:53 +01:00
MervinPraison c50e3d94b5 Remove PYTHONPATH from workflows and update test coverage path to praisonai 2025-05-27 06:42:49 +01:00
MervinPraison 0ef82bdf7e Restructure 2025-05-27 06:34:35 +01:00
Mervin Praison a7ce92f9ce Merge pull request #520 from MervinPraison/claude/issue-481-20250527_044929
feat: Add AWS Bedrock integration support
2025-05-27 06:13:04 +01:00
Mervin Praison f36415d4ea Merge pull request #519 from MervinPraison/develop
Update version to 2.2.16 across project files
2025-05-27 06:10:32 +01:00
MervinPraison 13c3e31458 Update version to 2.2.16 across project files
- Incremented PraisonAI version from 2.2.15 to 2.2.16 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Updated dependency version for `praisonaiagents` from 0.0.88 to 0.0.89.
- Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
2025-05-27 06:10:01 +01:00
Mervin Praison 41d550c4a5 Merge pull request #518 from MervinPraison/claude/issue-484-20250527_043953
feat: Add context management for workflow loops
2025-05-27 05:54:45 +01:00
Mervin Praison ac570e5b93 Rename test_context_management.py to tests/unit/test_context_management.py 2025-05-27 05:54:18 +01:00
claude[bot]andMervinPraison 65e389af03 feat: Add AWS Bedrock integration support
- Add comprehensive AWS Bedrock documentation with setup guide
- Support for Anthropic Claude, Amazon Titan, Cohere, and Meta models via Bedrock
- Include IAM permissions, regional availability, and cost optimization guidance
- Add Python example demonstrating multi-model usage
- Add YAML cookbook example for multi-agent workflows
- Update navigation to include AWS Bedrock in models section
- Maintain backward compatibility through existing LiteLLM integration

Resolves #481

Co-authored-by: MervinPraison <[email protected]>
2025-05-27 04:53:40 +00:00
claude[bot]andMervinPraison a5465882ee feat: Add context management for workflow loops to prevent context length issues
- Add retain_full_context parameter to Task class (default False)
- By default, only include most recent previous task in context
- Maintain backwards compatibility with retain_full_context=True
- Add _build_task_context helper method to Process class  
- Update both async and sync workflow methods to use new context building
- Add test script to verify functionality

Fixes context accumulation issue in workflow loops where all previous
task results were being appended, causing exponential context growth.

Co-authored-by: MervinPraison <[email protected]>
2025-05-27 04:47:37 +00:00
Mervin Praison f86b03e5d8 Merge pull request #517 from MervinPraison/develop
Update version to 2.2.15 across project files
2025-05-27 05:47:27 +01:00
MervinPraison 397a466f55 Update version to 2.2.15 across project files
- Incremented PraisonAI version from 2.2.14 to 2.2.15 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Updated dependency version for `praisonaiagents` from 0.0.87 to 0.0.88.
- Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
2025-05-27 05:36:34 +01:00
Mervin Praison 36c3066ba4 Merge pull request #515 from MervinPraison/claude/issue-514-20250526_155559
fix: Add asyncio import to local scope in launch() method
2025-05-26 20:00:06 +01:00
claude[bot]andMervinPraison df06e794b3 fix: Add asyncio import to local scope in launch() method
This fixes the NameError: cannot access free variable 'asyncio' where it is not associated with a value in enclosing scope error that occurs at line 1563.

The issue was that the handle_agent_query function (containing line 1563) is defined inside a try/except block that imports FastAPI dependencies but didn't include asyncio. Added import asyncio to the try block and removed redundant import from line 1659.

Fixes #514

Co-authored-by: MervinPraison <[email protected]>
2025-05-26 15:59:29 +00:00
Mervin Praison 71fe678d66 Merge pull request #513 from MervinPraison/develop
Update version to 2.2.14 across project files
2025-05-25 06:47:58 +01:00
MervinPraison c8875eec81 Update version to 2.2.14 across project files
- Incremented PraisonAI version from 2.2.13 to 2.2.14 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
2025-05-25 06:47:32 +01:00
Mervin Praison f88204d2e8 Merge pull request #512 from MervinPraison/develop
Update version to 2.2.13 across project files
2025-05-24 23:18:37 +01:00
MervinPraison fc01a80956 Update version to 2.2.13 across project files
- Incremented PraisonAI version from 2.2.12 to 2.2.13 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
2025-05-24 23:18:09 +01:00
Mervin Praison cd91565b12 Merge pull request #511 from MervinPraison/develop
Update version to 2.2.12 across project files
2025-05-24 22:59:55 +01:00
MervinPraison d233d4597c Update version to 2.2.12 across project files
- Incremented PraisonAI version from 2.2.11 to 2.2.12 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
2025-05-24 22:59:36 +01:00
Mervin Praison a9fabce0ea Merge pull request #510 from MervinPraison/develop
Develop
2025-05-24 22:46:10 +01:00
MervinPraison 6bcd3ba9bd Update version to 2.2.11 across project files
- Incremented PraisonAI version from 2.2.10 to 2.2.11 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy across the project.
2025-05-24 22:45:46 +01:00
MervinPraison 37028b0dd2 Enhance backup process for root configuration files in GitHub Actions workflow
- Updated echo statements to provide clearer context regarding the backup of `agents.yaml` and `tools.py`, preventing default file resolution interference during tests.
- Ensured minimal changes to existing code while improving clarity and user understanding of the backup process.
2025-05-24 22:38:10 +01:00
MervinPraison 6807d0e017 Add backup and restore steps for root configuration files in GitHub Actions workflow
- Introduced steps to back up and restore `agents.yaml` and `tools.py` during the workflow execution, preventing interference and ensuring a clean environment for tests.
- Added comprehensive execution debug step to provide detailed insights into the execution path and configuration status.
- Ensured minimal changes to existing code while enhancing the debugging and testing process for configuration management.
2025-05-24 22:35:23 +01:00
MervinPraison bca845d771 Add debug steps for logging level and researcher role detection in GitHub Actions workflow
- Introduced a new environment variable for log level and additional steps to search for the 'Researcher' role in YAML files, enhancing visibility during the workflow execution.
- Added a step to trace the AutoGen execution path, providing insights into framework decisions and available roles.
- Ensured minimal changes to existing code while improving the debugging and testing process for configuration and role management.
2025-05-24 22:07:21 +01:00
Mervin Praison 0596d2da2e Merge pull request #509 from MervinPraison/develop
Develop
2025-05-24 22:02:07 +01:00
MervinPraison 368498452c Add debug steps for YAML loading and framework detection in GitHub Actions workflow
- Introduced new steps in `unittest.yml` to debug YAML file loading and framework detection, providing detailed output on available YAML files and their content.
- Enhanced error handling to ensure visibility of issues during framework detection.
- Ensured minimal changes to existing code while improving the debugging process for configuration and role management.
2025-05-24 22:01:42 +01:00
MervinPraison 47e5ad2a65 Update version to 2.2.10 across project files
- Incremented PraisonAI version from 2.2.9 to 2.2.10 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Updated `litellm` dependency version from `1.41.8` to `1.68.0` across multiple files to ensure compatibility and improvements.
- Ensured minimal changes to existing code while maintaining versioning accuracy and optimising dependency management.
2025-05-24 21:58:27 +01:00
MervinPraison eb346be5f8 Add debug step for PraisonAIModel API key handling in GitHub Actions workflow
- Introduced a new step in `unittest.yml` to debug the handling of the PraisonAIModel API key, providing detailed output on its status and configuration.
- Ensured minimal changes to existing code while enhancing the testing process for API key integration and error visibility.
2025-05-24 21:53:47 +01:00
MervinPraison 62ab76f3e9 Add API key validation step in GitHub Actions workflow
- Introduced a new step in `unittest.yml` to validate the OpenAI API key by making a minimal API call, providing feedback on its status.
- Ensured minimal changes to existing code while enhancing the testing process for API configurations.
2025-05-24 21:50:48 +01:00
MervinPraison ac26c5fbe8 Add debug and test steps in GitHub Actions workflow
- Introduced a new step in `unittest.yml` to debug Python environment variables, checking the status of OpenAI API keys and other related variables for better visibility.
- Added a test step for direct PraisonAI execution to validate local functionality.
- Ensured minimal changes to existing code while enhancing the testing and debugging process in the workflow.
2025-05-24 21:45:36 +01:00
MervinPraison 22c10ff6ac Enhance error handling in test cases for API authentication
- Added try-except blocks in `test_agents_playbook.py` to handle API authentication errors gracefully, allowing tests to skip when encountering specific exceptions.
- Ensured minimal changes to existing code while improving robustness in test execution.
2025-05-24 21:40:25 +01:00
Mervin Praison 494f835e73 Merge pull request #508 from MervinPraison/develop
Develop
2025-05-24 21:36:27 +01:00
MervinPraison 3686eb2eaa Update version to 2.2.9 across project files
- Incremented PraisonAI version from 2.2.8 to 2.2.9 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Enhanced model retrieval logic in `agents_generator.py` for improved fallback handling.
- Ensured minimal changes to existing code while maintaining versioning accuracy and optimising model configuration.
2025-05-24 21:35:30 +01:00
MervinPraison 58c63f0dd4 Update LLM models in agents-advanced.yaml for consistency
- Replaced existing LLM model references with "openai/gpt-4o-mini" across various roles to standardise the configuration.
- Ensured minimal changes to existing code while enhancing model uniformity.
2025-05-24 21:20:43 +01:00
MervinPraison 7bf5c0a4d8 Add debug step for API key status in GitHub Actions workflow
- Introduced a new step in `unittest.yml` to check the availability of the OpenAI API key, providing feedback on its status and fallback usage.
- Ensured minimal changes to existing code while enhancing the debugging process for API configurations.
2025-05-24 21:16:47 +01:00
Mervin Praison 082d802fd9 Merge pull request #507 from MervinPraison/develop
Develop
2025-05-24 21:13:54 +01:00
MervinPraison 8cd926a244 Update version to 2.2.8 across project files
- Incremented PraisonAI version from 2.2.7 to 2.2.8 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy.
2025-05-24 21:13:31 +01:00
MervinPraison 987f63f032 Update environment variable setup in GitHub Actions workflows
- Modified `test-comprehensive.yml`, `test-core.yml`, `test-extended.yml`, and `test-frameworks.yml` to include default values for OpenAI API configuration, enhancing robustness during testing.
- Ensured minimal changes to existing code while improving the handling of environment variables.
2025-05-24 20:53:59 +01:00
Mervin Praison bec938883d Merge pull request #506 from MervinPraison/develop
Update version to 2.2.7 across project files
2025-05-24 18:15:04 +01:00
MervinPraison 76079a92fe Update version to 2.2.7 across project files
- Incremented PraisonAI version from 2.2.6 to 2.2.7 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Updated Python version specification in `test-comprehensive.yml` to focus solely on Python 3.11.
- Ensured minimal changes to existing code while maintaining versioning accuracy.
2025-05-24 18:13:59 +01:00
Mervin Praison c14fb2ee5d Merge pull request #505 from MervinPraison/develop
Update version to 2.2.6 across project files
2025-05-24 17:39:59 +01:00
MervinPraison 31c9a6a994 Update version to 2.2.6 across project files
- Incremented PraisonAI version from 2.2.5 to 2.2.6 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Updated test command patterns in GitHub Actions workflows for improved clarity and functionality.
- Ensured minimal changes to existing code while maintaining versioning accuracy.
2025-05-24 17:39:41 +01:00
Mervin Praison b5b4370cc8 Merge pull request #504 from MervinPraison/develop
Update Python version format in GitHub Actions workflow
2025-05-24 17:28:59 +01:00
MervinPraison 745f82b9c4 Update version to 2.2.5 across project files
- Incremented PraisonAI version from 2.2.4 to 2.2.5 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy.
2025-05-24 17:28:26 +01:00
MervinPraison 6845c7b0f6 Update Python version format in GitHub Actions workflow
- Changed the Python version specification in `test-comprehensive.yml` from unquoted to quoted strings for consistency and improved readability.
- Ensured minimal changes to existing code while enhancing clarity in the workflow configuration.
2025-05-24 17:20:27 +01:00
Mervin Praison e7be52722e Merge pull request #503 from MervinPraison/develop
Develop
2025-05-24 17:10:20 +01:00
MervinPraison e673189454 Update version to 2.2.4 across project files
- Incremented PraisonAI version from 2.2.3 to 2.2.4 in `pyproject.toml`, `uv.lock`, and all relevant Dockerfiles for consistency.
- Ensured minimal changes to existing code while maintaining versioning accuracy.
2025-05-24 17:09:45 +01:00
MervinPraison ab9192c57e Enhance GitHub Actions workflows and update test assertions
- Added environment variable setup in `test-extended.yml` for OpenAI API configuration.
- Updated test command in `unittest.yml` to use a pattern for faster execution.
- Refined assertions in `test_base_url_api_base_fix.py` to reflect changes in parameter naming from `base_url` to `api_base`.
- Improved mock tool listing in `test_mcp_integration.py` for clarity.
- Adjusted knowledge update logic in `test_rag_integration.py` to handle existing knowledge more effectively.
- Ensured minimal changes to existing code while enhancing test clarity and functionality.
2025-05-24 17:03:52 +01:00
Mervin Praison 819874275f Merge pull request #502 from MervinPraison/develop
Update GitHub Actions workflows to remove Python 3.9 support
2025-05-24 16:31:46 +01:00
MervinPraison 0a36fdb966 Update GitHub Actions workflows to remove Python 3.9 support
- Modified workflow files to exclude Python 3.9 from the test matrix, focusing on Python 3.10 and 3.11 for improved compatibility.
- Ensured minimal changes to existing code while streamlining the testing process.
2025-05-24 16:29:14 +01:00
Mervin Praison 768549bb52 Merge pull request #501 from MervinPraison/develop
Develop
2025-05-24 16:00:41 +01:00
MervinPraison 5d1bc19e15 Update version to 2.2.3 and enhance test configurations
- Incremented PraisonAI version from 2.2.2 to 2.2.3 in `pyproject.toml`, `uv.lock`, and Dockerfiles for consistency.
- Updated `.gitignore` to include exceptions for CrewAI test directories.
- Added new test markers in `pytest.ini` for better categorisation of tests.
- Enhanced GitHub Actions workflows to include new test patterns for AutoGen and CrewAI frameworks.
- Refactored test runner to improve clarity and user experience, including warnings for real tests and full execution tests.
- Ensured minimal changes to existing code while improving overall test structure and documentation.
2025-05-24 15:59:57 +01:00
MervinPraison 05a114f939 Update GitHub Actions workflows to use actions/setup-python@v5
- Modified multiple workflow files to upgrade actions/setup-python from version 4 to version 5 for improved functionality and consistency.
- Ensured minimal changes to existing code while enhancing the setup process for Python environments.
2025-05-24 14:00:02 +01:00
MervinPraison 4b9d291d16 Update GitHub Actions workflows to use latest action versions
- Upgraded actions/checkout to version 4 and actions/setup-python to version 5 across multiple workflow files for improved functionality.
- Updated actions/upload-artifact to version 4 in relevant workflows to enhance artifact management.
2025-05-24 13:54:03 +01:00
MervinPraison 5eb8862a7e Update dependencies and refactor test functions for clarity
- Added `pytest-asyncio` as a dependency in `pyproject.toml` for improved async testing capabilities.
- Updated GitHub Actions workflow to include `pytest-cov` for coverage reporting.
- Renamed test functions in `advanced_example.py` and `basic_example.py` for better clarity and user-friendliness.
- Removed unused event loop fixture from `conftest.py` to streamline test setup.
- Enhanced assertions in various tests to ensure better error reporting and maintainability.
2025-05-24 13:48:22 +01:00
MervinPraison 0bacff3997 Add simple test runner and basic diagnostic tests
- Introduced a new simple test runner (`simple_test_runner.py`) that operates without pytest dependency at import time.
- Added a basic diagnostic test script (`test_basic.py`) to validate Python and module imports.
- Updated `README.md` to include new test runner instructions and troubleshooting tips for pytest import issues.
- Enhanced `test_runner.py` to conditionally import pytest and fallback to subprocess if not available, maintaining existing functionality.
- Ensured backward compatibility with existing tests and workflows.
2025-05-24 13:14:24 +01:00
MervinPraison ac8e6daadf Refactor GitHub Actions workflow for quick validation tests
- Renamed workflow from 'Run specific unittest' to 'Quick Validation Tests'.
- Introduced a new job 'quick-test' for streamlined testing.
- Added installation of pytest and pytest-asyncio for enhanced testing capabilities.
- Updated test command to run legacy example tests using pytest with improved output options.
- Included environment variable for PYTHONPATH to facilitate module resolution.
2025-05-24 13:08:14 +01:00
MervinPraison f4cf97abdb Update GitHub Actions workflow to use latest action versions and improve installation commands
- Upgraded actions/checkout and actions/setup-python to version 4.
- Changed UV installation method to use a script for better integration.
- Modified dependency installation commands to include the --system flag for UV.
- Enhanced unittest command to run with verbose output for clearer test results.
2025-05-24 08:25:23 +01:00
Mervin Praison 2f0e3c0507 Merge pull request #498 from MervinPraison/develop
Update version numbers and dependencies to 2.2.2 and 0.0.87 across pr…
2025-05-24 08:23:33 +01:00
MervinPraison 5e11f7566d Update version numbers and dependencies to 2.2.2 and 0.0.87 across project files
- Incremented PraisonAI version from 2.2.1 to 2.2.2 in pyproject.toml, uv.lock, Dockerfiles, and documentation.
- Updated praisonaiagents version from 0.0.85 to 0.0.87 in relevant files.
- Adjusted installation commands in GitHub Actions workflow to use 'uv' for dependency management.
- Enhanced test scripts to return meaningful results for better assertion checks.
2025-05-24 08:22:57 +01:00
Mervin Praison 66a8c9e074 Merge pull request #497 from MervinPraison/claude/issue-467-20250524_055552
Claude/issue 467 20250524 055552
2025-05-24 07:33:18 +01:00
Mervin Praison 2ef8250d49 Delete tests/test_base_url_api_base_fix.py 2025-05-24 07:33:11 +01:00
Mervin Praison 090f1d1339 Merge pull request #493 from MervinPraison/claude/issue-411-20250524_055043
Fix Mini Agents sequential task data passing issue
2025-05-24 07:31:19 +01:00
Mervin Praison e299a5aaf3 Merge pull request #495 from MervinPraison/claude/issue-410-20250524_055025
Fix agent tool calls expecting strings for integer parameters
2025-05-24 07:30:42 +01:00
Mervin Praison 15bda4df81 Rename test_mini_agents_sequential.py to tests/unit/agent/test_mini_agents_sequential.py 2025-05-24 07:25:32 +01:00
Mervin Praison 57fdc5e4ed Rename test_mini_agents_fix.py to tests/unit/agent/test_mini_agents_fix.py 2025-05-24 07:25:12 +01:00
claude[bot]andMervinPraison 54cb01426f Fix undefined variable in _cast_arguments logging statement
- Replace undefined `function_name` with `getattr(func, '__name__', 'unknown function')`
- This prevents NameError when type casting fails and provides robust function name extraction
- Addresses CodeRabbit review feedback

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 06:22:54 +00:00
Mervin Praison f3d61459fe Delete test_type_casting.py 2025-05-24 07:19:06 +01:00
claude[bot]andMervinPraison ff309010b9 Fix TypeError in AutoAgents: change knowledge_sources to knowledge parameter
- The Agent constructor expects 'knowledge' parameter, not 'knowledge_sources'
- This fixes the TypeError: Agent.__init__() got an unexpected keyword argument 'knowledge_sources'
- Resolves issue #404

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 06:18:58 +00:00
claude[bot]andMervinPraison 53d7d7e7f7 Improve Mini Agents code quality based on review feedback
- Add TaskStatus enum for consistent status string handling
- Create centralized process_task_context() helper function to eliminate code duplication
- Fix poetry.lock sync issue by regenerating lock file
- Maintain existing functionality while improving maintainability

Addresses review feedback from CodeRabbit and Gemini reviewers about:
1. Hardcoded status strings (now use TaskStatus enum)
2. Code duplication between async/sync methods (now use shared helper)
3. CI failure due to poetry lock mismatch (regenerated lock file)

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 06:18:32 +00:00
Mervin Praison c133e24816 Merge pull request #496 from MervinPraison/claude/issue-467-20250524_060326
Add comprehensive integration test for base_url to api_base mapping
2025-05-24 07:14:53 +01:00
Mervin Praison 318131bb92 Merge pull request #494 from MervinPraison/claude/issue-410-20250524_060223
Create unit test structure and add test_type_casting.py
2025-05-24 07:08:11 +01:00
claude[bot]andMervinPraison 6cfa8f30d7 Add comprehensive integration test for base_url to api_base mapping
Addresses Issue #467: Organize test suite with proper directory structure

- Created tests/integration/ directory following TypeScript test patterns
- Added comprehensive test_base_url_api_base_fix.py as integration test
- Tests specific KoboldCPP and OpenAI-compatible endpoint scenarios
- Includes backward compatibility and environment variable tests
- Mock-based testing for reliable CI/CD

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 06:05:32 +00:00
claude[bot]andMervinPraison f6b1517aa0 Create unit test structure and add test_type_casting.py
- Created tests/unit/ directory structure following TypeScript pattern
- Added comprehensive test_type_casting.py in tests/unit/agent/
- Tests cover integer, float, boolean, mixed types, and edge cases
- Tests include graceful fallback for conversion failures
- Ready for when _cast_arguments method is implemented

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 06:04:56 +00:00
claude[bot]andMervinPraison 624837356e Add comprehensive test suite for base_url to api_base mapping fix
- Addresses Issue #467: litellm compatibility with OpenAI-compatible endpoints
- Tests specific KoboldCPP and OpenAI-compatible endpoint scenarios
- Includes backward compatibility and environment variable tests
- Mock-based testing to avoid external dependencies
- Verifies both base_url and api_base parameters are properly passed to litellm

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 05:58:19 +00:00
claude[bot]andMervinPraison df12ae032f Fix Mini Agents sequential task data passing issue
- Improved context processing to validate task completion status
- Fixed context formatting from space-separated to newline-separated 
- Added better error handling for incomplete tasks
- Enhanced debugging with verbose logging
- Added test scripts to verify the fix

This resolves the issue where output from previous tasks was not 
properly passed to subsequent tasks in Mini Agents sequential workflows.

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 05:57:15 +00:00
claude[bot]andMervinPraison c405aaf121 Fix agent tool calls expecting strings for integer parameters
Added type casting utility to Agent class that converts arguments to their expected types based on function signatures:
- Converts string arguments to int, float, bool when annotations are present
- Graceful fallback if conversion fails
- Preserves existing behavior for non-annotated parameters

Fixes #410

Co-authored-by: MervinPraison <[email protected]>
2025-05-24 05:54:12 +00:00
Mervin Praison 03e2bb94f2 Merge pull request #492 from MervinPraison/claude/issue-469-20250523_220748
Fix UnicodeDecodeError in Docker for MCP Google Maps
2025-05-23 23:21:23 +01:00
claude[bot]andMervinPraison 5e3e503dd9 Fix UnicodeDecodeError in Docker for MCP Google Maps initialization
- Add explicit UTF-8 encoding to all subprocess.run() calls in npx_mcp_wrapper_main.py
- Set UTF-8 environment variables (PYTHONIOENCODING, LC_ALL, LANG) in both MCP classes  
- Add UTF-8 encoding to temporary script file creation
- Ensure environment variables are passed to subprocess calls

This resolves the 'ascii' codec can't decode byte 0xc2 error that occurs during
MCP server initialization in Docker containers with minimal locale settings.

Fixes #469

Co-authored-by: MervinPraison <[email protected]>
2025-05-23 22:12:35 +00:00
Mervin Praison 633d724eb2 Merge pull request #485 from MervinPraison/develop
Increment version to 0.0.84 in `pyproject.toml` and `uv.lock`, update…
2025-05-23 23:00:34 +01:00
MervinPraison 5cfda3fa54 Increment version to 2.2.1 in pyproject.toml, uv.lock, and Dockerfiles, and update praisonaiagents version to 0.0.85 across relevant files for improved functionality and compatibility. 2025-05-23 23:00:10 +01:00
MervinPraison 370cb108f2 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI into develop 2025-05-23 22:54:18 +01:00
Mervin Praison 83cb80e907 Merge pull request #487 from MervinPraison/claude/issue-482-20250523_112045
fix: Pass base_url, api_key, and other essential parameters to all litellm calls
2025-05-23 13:37:08 +01:00
claude[bot]andMervinPraison f385de04e0 fix: Pass base_url, api_key, and other essential parameters to all litellm calls
- Add _build_completion_params() method to centralize parameter handling
- Update all 24+ litellm.completion() and litellm.acompletion() calls to use the new method
- Fix async/sync inconsistencies in get_response_async() method
- Ensure base_url, api_key, api_version, timeout, and other configured parameters are consistently passed to litellm
- Resolves connection issues for Ollama and other providers using custom base URLs

Fixes #482

Co-authored-by: MervinPraison <[email protected]>
2025-05-23 11:28:45 +00:00
Mervin Praison 18695543e5 Merge pull request #486 from MervinPraison/add-claude-github-actions-1747999126084
Add Claude Code GitHub Workflow
2025-05-23 12:20:13 +01:00
Mervin Praison 267f223a3e Add Claude PR Assistant workflow 2025-05-23 12:18:47 +01:00
MervinPraison 02bd52a06d Increment version to 0.0.84 in pyproject.toml and uv.lock, update agent functionality in mcp-sse.py and openai-mcp.py for improved task handling, and enhance timeout management in MCP tools for better performance. 2025-05-22 15:35:45 +01:00
Mervin Praison 076576af85 Merge pull request #480 from MervinPraison/develop
v2.2 with MCP SSE and STDIO
2025-05-17 05:03:27 +01:00
MervinPraison 17547073ec v2.2 with MCP SSE and STDIO 2025-05-15 16:01:28 +01:00
Mervin Praison 124a95d7d0 Merge pull request #479 from MervinPraison/develop
Remove agent names and version constraints in MCP server documentation
2025-05-15 12:04:45 +01:00
MervinPraison 8ca4e3285d Remove agent names and version constraints in MCP server documentation 2025-05-15 12:04:07 +01:00
Mervin Praison 5eac60dab3 Merge pull request #478 from MervinPraison/develop
2.1.6
2025-05-15 07:54:46 +01:00
MervinPraison 59ee7cbbe5 Add MCP server examples and deployment docs with version bump to 2.1.6 2025-05-15 07:54:17 +01:00
MervinPraison 81517b58e5 Increment version to 0.0.82 in pyproject.toml and uv.lock, and enhance agent launch functionality in agents.py to support both HTTP and MCP protocols, including improved endpoint management, healthcheck capabilities, and error handling for agent execution. 2025-05-15 07:42:53 +01:00
Mervin Praison c1a8338a24 Merge pull request #477 from MervinPraison/develop
multi agents deploy
2025-05-14 13:08:57 +01:00
MervinPraison dba5a49569 multi agents deploy 2025-05-14 13:08:18 +01:00
Mervin Praison 6dab69e9d7 Merge pull request #476 from MervinPraison/develop
Add multi-agent API functionality in `multi-agents-api.py` and `multi…
2025-05-14 12:50:13 +01:00
MervinPraison 90563207f7 Add multi-agent API functionality in multi-agents-api.py and multi-agents-group-api.py, increment version to 0.0.80 in pyproject.toml and uv.lock, and enhance agent launch logic in agents.py with improved endpoint management and healthcheck capabilities. 2025-05-14 12:49:58 +01:00
Mervin Praison 46330b0487 Merge pull request #475 from MervinPraison/develop
v2.1.4
2025-05-14 10:49:01 +01:00
MervinPraison a133f0d5e2 Update package versions and add deployment documentation 2025-05-14 10:48:27 +01:00
MervinPraison fb22e6e1c7 Refactor agent launch functionality in multi-agent-api.py to remove blocking parameters, update version to 0.0.79 in pyproject.toml and uv.lock, and enhance server startup logic in agent.py with healthcheck endpoint and improved thread management. 2025-05-14 09:13:40 +01:00
Mervin Praison e938fe63ea Merge pull request #473 from emmanuel-ferdman/main
Resolve Python Logger warnings
2025-05-14 06:33:25 +01:00
Mervin Praison ef96e53843 Merge pull request #474 from MervinPraison/develop
Increment version to 0.0.78 in `pyproject.toml`, add API dependencies…
2025-05-14 06:32:05 +01:00
MervinPraison 036c463a43 Increment version to 0.0.78 in pyproject.toml, add API dependencies for FastAPI and Uvicorn, and implement HTTP API launch functionality in agent.py for enhanced agent interaction. 2025-05-14 06:30:42 +01:00
Emmanuel Ferdman 0e6b4aefc3 Resolve Python Logger warnings
Signed-off-by: Emmanuel Ferdman <[email protected]>
2025-05-13 14:08:22 -07:00
Mervin Praison bbb9f677ae Merge pull request #472 from MervinPraison/develop
Add STDIO MCP documentation and update navigation menu
2025-05-13 16:40:35 +01:00
MervinPraison 0da201b3b6 Add STDIO MCP documentation and update navigation menu 2025-05-13 16:40:20 +01:00
Mervin Praison a7b85043e1 Merge pull request #470 from elandau1260/add_repot_path_to_env
Added PRAISONAI_CODE_REPO_PATH env variable to point code to differen…
2025-05-13 14:55:28 +01:00
Mervin Praison dc393e1211 Merge pull request #456 from MervinPraison/develop
Increment version to 0.0.77 in `pyproject.toml` and update `markitdow…
2025-05-13 14:47:44 +01:00
MervinPraison fdff17faf9 MCP SSE Docs 2025-05-13 14:46:11 +01:00
MervinPraison b3d893fae1 Implement SSEMCPClient and SSEMCPTool for MCP server interaction, enhance logging configuration, and increment version to 0.0.77 in pyproject.toml and uv.lock for improved functionality. 2025-05-13 14:29:41 +01:00
MervinPraison d92dede515 Re-add mcp-sse-direct-agent.py without API key 2025-05-13 14:01:35 +01:00
MervinPraison a1882233dc mcp sse 2025-05-13 13:55:32 +01:00
Ed Landau aa6b6ac62e Added PRAISONAI_CODE_REPO_PATH env variable to point code to different repot 2025-05-02 13:01:21 -07:00
MervinPraison c540ba34fb Increment version to 0.0.76 in pyproject.toml and update markitdown dependency to include all extras in uv.lock for enhanced functionality. 2025-04-08 12:05:03 +01:00
Mervin Praison 0abb1b659a Merge pull request #455 from MervinPraison/develop
Increment version to 0.0.75 in `pyproject.toml` and update Python com…
2025-04-08 11:49:15 +01:00
MervinPraison 81adb28688 Increment version to 0.0.75 in pyproject.toml and update Python compatibility requirements in uv.lock to support Python 3.11 and above. 2025-04-08 11:48:53 +01:00
Mervin Praison 5fbe6e948c Merge pull request #450 from ihsankursadunal/add-to-vector-store-fifth-positional-argument
RAG knowledge positional argument error fix
2025-04-08 11:48:11 +01:00
Mervin Praison 6128e4c885 Merge pull request #454 from MervinPraison/develop
Add new Databutton and Research agents in `databutton-mcp.py` and `mc…
2025-04-08 11:35:34 +01:00
MervinPraison 0e563989ed Add new Databutton and Research agents in databutton-mcp.py and mcp-llama4.py, respectively. Increment version to 0.0.74 in pyproject.toml and update Python requirements in uv.lock for compatibility with Python 3.13. 2025-04-08 11:34:37 +01:00
Mervin Praison 510a853e05 Merge pull request #453 from chonknick/update-chonkie-v102
Fix: breaking change with Chonkie `v1.0.2` — `WordChunker` not found
2025-04-08 11:32:13 +01:00
Bhavnick @ chonkie.ai d6084cb7ce Update chonkie dependency version to 1.0.2 in pyproject.toml and requirements.txt for improved compatibility. 2025-04-07 23:45:26 +05:30
Bhavnick @ chonkie.ai 8d4b1c411b Enhance chunking method: Disable unsupported context parameters and add warning for future support. Track in https://github.com/chonkie-inc/chonkie/issues/21 2025-04-07 23:38:37 +05:30
bhavnicksm 3be05c855b Fix: Remove WordChunker + Disable OverlapRefinery (temporarily) 2025-04-07 23:18:43 +05:30
bhavnicksm 3e5a2f76f4 Update chonkie version to the latest v1.0.2 2025-04-07 23:18:14 +05:30
ihsankursadunal 8eee881d2e RAG knowledge positional argument error fix 2025-04-06 13:09:35 +03:00
Mervin Praison d75f4be41a Merge pull request #448 from MervinPraison/develop
Develop
2025-04-03 06:47:51 +01:00
MervinPraison 9ea89448ef Increment version number to 0.0.73 in pyproject.toml and uv.lock to reflect recent updates. 2025-04-03 06:47:35 +01:00
MervinPraison 0a5e2df278 Merge PR #409: Support chat without stream while maintaining stream=True as default 2025-04-03 06:30:23 +01:00
MervinPraison cc3b64f89b fix: keep default stream=True while supporting stream=False option 2025-04-03 06:30:04 +01:00
Mervin Praison 546dc5a441 Merge pull request #391 from yiranwu0/main
Update AG2 reference
2025-04-02 21:44:22 +01:00
Mervin Praison bd7422c7ca Merge pull request #443 from MervinPraison/develop
Add WhatsApp and Perplexity MCP Integrations
2025-04-02 09:54:17 +01:00
MervinPraison 0c2c6da8dd Add WhatsApp and Perplexity MCP Integrations
- Included new MCP tools for WhatsApp and Perplexity in `mint.json` for enhanced functionality.
- Updated installation instructions in `openrouter.mdx` and `xai.mdx` to specify the correct package format.
- Added detailed documentation for WhatsApp and Perplexity integrations, including setup steps and example scripts.
- Incremented version number to 0.0.72 in `pyproject.toml` and `uv.lock` to reflect recent changes.
2025-04-02 09:54:02 +01:00
Mervin Praison b43688086f Merge pull request #442 from MervinPraison/develop
Update to version 2.1.1
2025-04-01 22:22:06 +01:00
MervinPraison 820619e8d9 Update to version 2.1.1
- Incremented version number to 2.1.1 in `pyproject.toml`, `praisonai.rb`, and `uv.lock` to reflect recent changes.
- Updated dependency version for `praisonaiagents` to 0.0.71 in `pyproject.toml` and `uv.lock`.
- Modified Dockerfile and deployment scripts to install the updated version of `praisonai`.
- Added new documentation files for various MCP integrations, including Anthropic, Gemini, Groq, Mistral, Ollama, OpenAI, and XAI.
- Introduced example scripts for each MCP integration to facilitate user understanding and implementation.
- Enhanced the LLM class to process tool results based on the original user query for improved response accuracy.
2025-04-01 22:21:50 +01:00
Mervin Praison 94202adddd Merge pull request #441 from MervinPraison/develop
Version 2.1
2025-04-01 21:14:15 +01:00
MervinPraison c7911629b1 Version 2.1 2025-04-01 21:13:30 +01:00
Mervin Praison 5a4e3ba707 Merge pull request #440 from MervinPraison/develop
Update LLM and MCP Integration
2025-04-01 17:54:05 +01:00
MervinPraison 641057b622 Update LLM and MCP Integration
- Changed the LLM model from "groq/llama-3.3-70b-versatile" to "groq/llama-3.2-90b-vision-preview" in `groq-mcp.py` for improved performance.
- Added a new example script `ollama-python.py` for stock price retrieval using the Ollama model.
- Incremented version number to 0.0.70 in `pyproject.toml` to reflect recent changes.
- Updated Python version requirement in `uv.lock` to support Python 3.11 and above for better compatibility.
- Enhanced the LLM class to handle tool calls specifically for Ollama models, ensuring proper processing of tool results.
2025-04-01 17:53:45 +01:00
Mervin Praison db1dbf142e Merge pull request #438 from MervinPraison/develop
groq support included
2025-04-01 13:51:43 +01:00
MervinPraison d9a19ae277 groq support included 2025-04-01 13:51:24 +01:00
Mervin Praison 3c9d889b4f Merge pull request #437 from MervinPraison/develop
Add MCP Integration and Update Documentation
2025-03-31 13:24:04 +01:00
MervinPraison 2f324e74db Add MCP Integration and Update Documentation
- Added `mcp` dependency to `pyproject.toml` for enhanced functionality.
- Introduced new example scripts for various MCP tools, including `fetch-mcp.py`, `git-mcp.py`, `ollama.py`, `sentry-mcp.py`, and `time-mcp.py`, to demonstrate their usage.
- Updated `airbnb.mdx` to reflect the addition of the Airbnb tool to the AI agent.
- Enhanced the `Agent` class to support MCP tools and ensure proper integration with custom LLMs.
- Improved logging for better debugging and tool management.
- Incremented version number to 0.0.68 in `pyproject.toml` for release clarity.
2025-03-31 13:23:49 +01:00
Mervin Praison c22fef3e6d Merge pull request #436 from MervinPraison/develop
Enhance MCP Documentation and Integration
2025-03-31 09:47:52 +01:00
MervinPraison 53bee19948 Enhance MCP Documentation and Integration
- Updated `mint.json` to include additional MCP pages for improved navigation.
- Added new documentation files for various MCP integrations, including AWS KB Retrieval, Everart, Filesystem, Google Drive, GitHub, GitLab, Google Maps, Memory, PostgreSQL, Puppeteer, Redis, Sequential Thinking, Slack, and Stock Price.
- Introduced example scripts for each MCP integration to facilitate user understanding and implementation.
- Ensured consistency in documentation format and clarity in instructions for setting up and using MCP tools.
2025-03-31 09:47:38 +01:00
kevin666aa 798fe68908 update reference 2025-03-30 16:40:06 -04:00
kevin666aa 95796cd4c7 Merge remote-tracking branch 'upstream/main' 2025-03-30 16:22:40 -04:00
Mervin Praison b447b7e6eb Merge pull request #434 from MervinPraison/develop
Add Gradio UI for Airbnb Booking Assistant
2025-03-29 20:55:04 +00:00
MervinPraison 29dfe4b192 Add Gradio UI for Airbnb Booking Assistant
- Introduced a new Gradio interface in `airbnb.mdx` and `ui.py` for searching and booking apartments on Airbnb.
- Implemented the `search_airbnb` function to handle user queries and display results.
- Enhanced user experience with a clear input prompt and structured output format.
2025-03-29 20:54:38 +00:00
Mervin Praison aca95b1713 Merge pull request #433 from MervinPraison/develop
Update navigation and MCP integration
2025-03-29 19:18:34 +00:00
MervinPraison b4cc3d7a8e Update navigation and MCP integration
- Added "MCP" section to `mint.json` for improved documentation navigation.
- Integrated environment variable for `BRAVE_API_KEY` in `mcp-npx-brave.py` to enhance security and flexibility.
- Updated search agent prompt for better clarity.
2025-03-29 19:17:27 +00:00
Mervin Praison c6c27e58a6 Merge pull request #432 from MervinPraison/develop
adding other changes
2025-03-29 17:59:16 +00:00
MervinPraison ae21881522 adding other changes 2025-03-29 17:58:51 +00:00
Mervin Praison 68efb982af Merge pull request #429 from MervinPraison/develop
Add MCP integration for stock price retrieval
2025-03-29 17:58:05 +00:00
MervinPraison c539306b96 Increment version number in pyproject.toml to 2.0.81 2025-03-29 17:57:31 +00:00
MervinPraison c2f2d43d0d adding mcp 2025-03-29 17:57:10 +00:00
MervinPraison 7847515b4b adding mcp npx 2025-03-29 17:55:09 +00:00
Mervin Praison 1f2c412521 Merge pull request #428 from asiffarhankhan/main
Add .py files for all existing .mdx tools, Add .mdx, .py for the new AgentQL tool
2025-03-26 06:06:06 +00:00
asiffarhankhan 355fe1e59c Add local test file 2025-03-23 12:26:56 +05:30
asiffarhankhan 2ed64adc48 Remove API key from code 2025-03-23 12:19:55 +05:30
asiffarhankhan b8bc8583b1 Add agentql tool 2025-03-23 12:13:04 +05:30
asiffarhankhan 51a3a065c4 Add Python Files for existing MDX tools 2025-03-23 04:52:18 +05:30
Mervin Praison 4ba8745544 Merge pull request #427 from bhavnicksm/update-chonkie-config
Fix: `tokenizer` is not recognized error with `chonkie.RecursiveChunker`
2025-03-20 06:03:10 +00:00
bhavnicksm efc347f507 Update chonkie dependency version to ensure compatibility 2025-03-20 05:45:05 +05:30
bhavnicksm 72a162c722 Refactor tokenizer parameter in Chunking class for consistency and clarity 2025-03-20 05:41:02 +05:30
bhavnicksm 734a632dd4 Update chonkie dependency version in requirements.txt 2025-03-20 05:35:11 +05:30
MervinPraison dfaa3ed671 Add MCP integration for stock price retrieval
- Introduced multiple new files for MCP agent functionality, including `mcp-agents-detailed.py`, `mcp-agents.py`, `mcp-basic.py`, `mcp-multiagents.py`, and `mcp-test.py`.
- Implemented a dedicated `MCP` class for managing connections and tool execution.
- Created an asynchronous function to retrieve stock prices using MCP tools.
- Added example agents for stock price checking and web searching.
- Updated `pyproject.toml` and `uv.lock` to reflect version increment to 0.0.66.
- Ensured backward compatibility and improved tool function generation for better usability.
2025-03-18 18:23:39 +00:00
Mervin Praison 175b55704d Merge pull request #425 from asiffarhankhan/main
Add Bearly, Azure and Jina Code Interpreter
2025-03-18 16:56:19 +00:00
asiffarhankhan 084d1a2820 Add Azure and Jina, Bearly Code Interpreter 2025-03-17 23:46:41 +05:30
asiffarhankhan 8518c3ae9d Add Azure and Jina Code Inerpreter 2025-03-17 23:33:33 +05:30
Mervin Praison ac95c0000b Merge pull request #419 from asiffarhankhan/main
Add SearchAPI, YouSearch, TavillySearch tools
2025-03-17 13:38:39 +00:00
asiffarhankhan 8447e02f5d Merge branch 'main' of github.com:asiffarhankhan/PraisonAI 2025-03-15 15:07:38 +05:30
asiffarhankhan 3e612f61dc Add SearchAPI, YouSearch, TavillySearch tools 2025-03-15 15:06:07 +05:30
Mervin Praison b39c04dfb5 Merge pull request #417 from asiffarhankhan/main
Add MDX for Google and Jina Search
2025-03-14 04:46:44 +00:00
asiffarhankhan 8fc367ee6d Add "YOUR_API_KEY" placeholder to empty API variable 2025-03-12 14:26:43 +05:30
asiffarhankhan f7f157d3e7 Update Jina Search to MDX format 2025-03-12 14:19:49 +05:30
asiffarhankhan 05ede2a366 Add Google, Jina Search tools 2025-03-12 14:14:06 +05:30
Mervin Praison f8a2a93400 Merge pull request #416 from MervinPraison/develop
Add playground documentation to navigation
2025-03-11 10:34:12 +00:00
MervinPraison 1a77826a21 Add playground documentation to navigation
- Updated `mint.json` to include the "playground" page in the documentation navigation
- Positioned under the "Other Features" group for easy access
2025-03-11 10:33:54 +00:00
Mervin Praison adfd982547 Merge pull request #415 from MervinPraison/develop
updates
2025-03-11 09:43:36 +00:00
MervinPraison facd52103e updates 2025-03-11 09:42:04 +00:00
Mervin Praison 06d3d3decb Merge pull request #414 from MervinPraison/develop
Add course documentation for AI Agents
2025-03-11 04:59:27 +00:00
MervinPraison 7f35ac6113 Add course documentation for AI Agents
- Created a comprehensive course on AI Agents covering 20 lessons
- Included documentation for course topics like agent architecture, tools, memory, multi-agent systems, and deployment
- Added structured MDX files for each lesson with code examples, explanations, and best practices
- Updated `mint.json` to include new course navigation and pages
- Provided a step-by-step learning path for understanding and building AI agents
2025-03-11 04:58:56 +00:00
Mervin Praison e68fbb46f6 Merge pull request #413 from MervinPraison/develop
Add documentation for additional search tools
2025-03-11 04:10:25 +00:00
MervinPraison 50a7bf6c91 Add documentation for additional search tools
- Updated `mint.json` to include new search tools
- Added documentation pages for DuckDuckGo, Exa, Google Serper, Serp, and Wikipedia search tools
- Included installation instructions, overview, and example code for each search tool
2025-03-11 04:10:02 +00:00
Yuga Sun eaf337b301 fix: remove default stream value for agent 2025-03-11 04:07:40 +00:00
Mervin Praison bce6e424d8 Merge pull request #412 from asiffarhankhan/main
Add search based tools using wikipedia, serper, serp, brave, exa, duckduckgo
2025-03-11 04:01:30 +00:00
asiffarhankhan 5cad05dc0d Align .py files with existing .mdx files 2025-03-11 00:37:40 +05:30
asiffarhankhan 3ecc722866 Add search based tools using wikipedia, serper, serp, brave, exa, duckduckgo 2025-03-11 00:32:02 +05:30
Yuga Sun 2f73cf1882 fix: support chat without stream 2025-03-10 08:00:05 +00:00
Mervin Praison c881fb3280 Merge pull request #408 from MervinPraison/develop
Refactor tools documentation with comprehensive examples and improved…
2025-03-10 06:20:01 +00:00
MervinPraison 15f9cbbe47 Refactor tools documentation with comprehensive examples and improved structure
- Updated tools documentation with new tabbed interface
- Added detailed code and no-code examples for tool creation
- Simplified tool registration and agent configuration examples
- Improved readability and provided step-by-step guidance for tool implementation
2025-03-10 06:19:41 +00:00
Mervin Praison f431347793 Merge pull request #407 from MervinPraison/develop
Add Langchain external search tool examples for PraisonAI agents
2025-03-10 06:03:11 +00:00
MervinPraison e0725c1296 Add Langchain external search tool examples for PraisonAI agents
- Introduced example scripts for Brave Search, Google Trends, and SerpAPI
- Demonstrated multi-agent workflows using external search tools
- Added API key configuration instructions for each search tool
- Included examples of research and content generation agents using search capabilities
2025-03-10 06:02:45 +00:00
Mervin Praison b40295efb9 Merge pull request #406 from MervinPraison/develop
Add external search tool documentation for PraisonAI agents
2025-03-10 05:54:34 +00:00
MervinPraison 2f7769d334 Add external search tool documentation for PraisonAI agents
- Updated `mint.json` to include new external tools section
- Expanded `langchain_tools.mdx` with more comprehensive examples and explanations
- Added documentation pages for BraveSearch, Google Trends, and SerpAPI tools
- Included installation, setup, and usage examples for external search tools
- Organized new documentation under the "External Tools" group
2025-03-10 05:54:13 +00:00
Mervin Praison c326aaf015 Merge pull request #405 from MervinPraison/develop
Add TypeScript documentation and examples for AI agent tools
2025-03-04 20:52:08 +00:00
MervinPraison 03874553eb Add TypeScript documentation and examples for AI agent tools
- Expanded documentation for TypeScript AI agents with tool registration examples
- Added new documentation pages for custom tools in TypeScript
- Updated installation and quickstart guides to include TypeScript sections
- Created example scripts demonstrating single and multi-agent tool usage
- Introduced new documentation for external tools like Google Trends
2025-03-04 20:51:53 +00:00
Mervin Praison 97ae6647c9 Merge pull request #403 from MervinPraison/develop
Expand tool registration documentation and examples
2025-03-03 08:25:09 +00:00
MervinPraison 046fb7cbe7 Expand tool registration documentation and examples
- Added comprehensive TypeScript documentation for tool registration methods in `docs/js/typescript.mdx`
- Created new README example file `examples/README-tool-examples.md` with detailed tool registration approaches
- Updated example scripts to demonstrate direct function tool registration
- Refined agent tool registration logic to support multiple function registration styles
- Bumped package version to 1.0.19
2025-03-03 08:24:46 +00:00
Mervin Praison afdd6ab6f8 Merge pull request #402 from MervinPraison/develop
Enhance agent tool function registration with direct function support
2025-03-03 08:13:52 +00:00
MervinPraison 4581486a81 Enhance agent tool function registration with direct function support
- Added support for directly registering tool functions without global declaration
- Implemented auto-generation of tool definitions for registered functions
- Created new example scripts demonstrating direct function tool registration
- Updated package version to 1.0.18
- Expanded Agent configuration to support `toolFunctions` property
- Added type exports for improved type safety
2025-03-03 08:13:31 +00:00
Mervin Praison e10b991fab Merge pull request #401 from MervinPraison/develop
npm 1.0.17 praisonai
2025-03-03 07:52:40 +00:00
MervinPraison 2d790f79a9 Add tool call support for agents with multi-tool and single-tool test cases
- Enhanced OpenAI service to support tool calls in chat and text generation methods
- Updated Agent classes to register and process tool functions dynamically
- Added new test cases for single and multi-tool agent interactions
- Improved type safety and conversion for OpenAI tool and message formats
- Bumped package version to 1.0.17
2025-03-03 07:52:07 +00:00
MervinPraison ec04dd7a91 test 7 2025-02-28 17:12:25 +00:00
MervinPraison bd49416f2b test 6 2025-02-28 17:05:09 +00:00
MervinPraison da2e11921c test 5 2025-02-28 17:03:42 +00:00
MervinPraison 8287c3a3d4 test 4 2025-02-28 16:57:02 +00:00
MervinPraison 6904f86557 test 3 2025-02-28 16:54:54 +00:00
MervinPraison cbebb3a900 test 2 2025-02-28 16:53:48 +00:00
MervinPraison 413484ea9f test 2025-02-28 16:36:58 +00:00
MervinPraison 785317c4fa test 2025-02-28 11:56:13 +00:00
MervinPraison c70f9ebf1f Add package.json and update documentation requirements
- Created package.json for documentation with Mintlify dev and build scripts
- Updated requirements.in with additional documentation and tool dependencies
- Removed redundant requirements.txt file
- Added support for enhanced documentation generation and API documentation
2025-02-28 11:51:31 +00:00
Mervin Praison d278f2d2b2 Merge pull request #399 from MervinPraison/develop
Bump version to 2.0.80 and update praisonaiagents dependency
2025-02-28 10:25:47 +00:00
MervinPraison df4596a699 Bump version to 2.0.80 and update praisonaiagents dependency
- Updated version to 2.0.80 across multiple files including praisonai.rb, pyproject.toml, uv.lock, Dockerfile, and docs
- Upgraded praisonaiagents dependency from 0.0.64 to 0.0.65
- Enhanced agent start methods with optional return_dict parameter
- Improved result handling in start and astart methods to return final response by default
- Synchronized version updates across project configuration files
2025-02-28 10:25:32 +00:00
Mervin Praison dd0f47ec81 Merge pull request #398 from MervinPraison/develop
Bump version to 2.0.79 and update praisonaiagents dependency
2025-02-28 07:26:52 +00:00
MervinPraison e53017a2fe Bump version to 2.0.79 and update praisonaiagents dependency
- Updated version to 2.0.79 across multiple files including praisonai.rb, pyproject.toml, uv.lock, Dockerfile, and docs
- Upgraded praisonaiagents dependency from 0.0.63 to 0.0.64
- Updated example agent scripts for Anthropic and Gemini LLMs
- Added parameter modification support in LLM initialization
- Synchronized version updates across project configuration files
2025-02-28 07:26:22 +00:00
Mervin Praison fe034ba8f4 Merge pull request #397 from MervinPraison/develop
Enhance Agent Tool Execution Logging and Debugging
2025-02-28 07:05:13 +00:00
MervinPraison 063e5780d6 Enhance Agent Tool Execution Logging and Debugging
- Added comprehensive debug logging for tool execution in LLM and Agent components
- Improved display of tool call messages with more detailed information
- Added logging for empty content and tool execution scenarios
- Enhanced error handling and logging in display functions
- Added new Anthropic LLM example script in src/praisonai-agents
- Bumped version to 2.0.78 and updated praisonaiagents dependency to 0.0.63
2025-02-28 07:04:50 +00:00
Mervin Praison 904e21ca87 Merge pull request #396 from MervinPraison/develop
v2.0.77
2025-02-27 09:12:33 +00:00
MervinPraison 526665ea11 Bump version to 2.0.77 and update praisonaiagents dependency
- Updated version to 2.0.77 across multiple files including praisonai.rb, pyproject.toml, uv.lock, Dockerfile, and docs
- Upgraded praisonaiagents dependency from 0.0.61 to 0.0.62
- Synchronized version updates across project configuration files
2025-02-27 09:11:18 +00:00
MervinPraison c2e97d2432 adding litellm tools fix 2025-02-27 09:08:22 +00:00
MervinPraison 60be6a1f99 Add Comprehensive Debug Logging to LLM and Agent Components
- Enhanced LLM and Agent classes with detailed debug logging capabilities
- Added parameter and configuration logging for get_response and chat methods
- Implemented time tracking for method execution in debug mode
- Masked sensitive information like API keys in logs
- Created new Wikipedia agent example script demonstrating agent initialization
2025-02-27 06:54:32 +00:00
kevin666aa 680949742e Merge remote-tracking branch 'upstream/main' 2025-02-13 15:44:32 -05:00
kevin666aa 560219dcd7 update 2025-02-13 13:39:48 -05:00
Mervin Praison 0ba7d2e834 Merge pull request #385 from MervinPraison/develop
Add Vision Model Upload Functionality and Enhance Training Workflow
2025-02-09 21:23:38 +00:00
MervinPraison 184b241395 Add Vision Model Upload Functionality and Enhance Training Workflow
- Introduced new upload_vision.py script for comprehensive model upload capabilities
- Extended train_vision.py with additional upload methods for Hugging Face and Ollama
- Added support for saving merged models, pushing GGUF models, and creating Ollama models
- Implemented flexible upload targeting with configurable options
- Enhanced model preparation and deployment workflow for vision models
2025-02-09 21:23:24 +00:00
Mervin Praison 4354e76fe5 Merge pull request #383 from MervinPraison/develop
Enhance Vision Model Training with Robust Dataset Conversion and Memo…
2025-02-09 02:46:01 +00:00
MervinPraison 4dd77efb75 Enhance Vision Model Training with Robust Dataset Conversion and Memory Optimization
- Significantly improved train_vision.py with more robust dataset conversion process
- Added detailed debugging and logging for dataset loading and conversion
- Implemented advanced memory management techniques for vision model training
- Enhanced tokenizer handling with fallback mechanisms
- Updated version to 2.0.76 across all relevant files
2025-02-09 02:45:47 +00:00
Mervin Praison 11db6e18ba Merge pull request #382 from MervinPraison/develop
Add Vision Model Training Support and Update Unsloth Dependency
2025-02-09 00:31:40 +00:00
MervinPraison 0d6f698e6c Add Vision Model Training Support and Update Unsloth Dependency
- Enhanced CLI to dynamically select training script based on model type (vision vs. standard)
- Added support for detecting vision models through flexible name matching
- Updated Unsloth dependency to latest commit
- Bumped version to 2.0.75 across all relevant files
2025-02-09 00:31:20 +00:00
Mervin Praison b8574f78e2 Merge pull request #381 from MervinPraison/develop
Bump version to 2.0.74 and refactor train.py template generation
2025-02-07 13:14:32 +00:00
MervinPraison e631774a0f Bump version to 2.0.74 and refactor train.py template generation
- Updated version to 2.0.74 across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, docs)
- Simplified training template generation in train.py
- Removed complex stop tokens and simplified template structure
- Dynamically built training arguments with improved configuration flexibility
2025-02-07 13:14:16 +00:00
Mervin Praison df735aa748 Merge pull request #378 from MervinPraison/develop
Enhance train.py with Configurable Training Parameters
2025-02-06 07:48:00 +00:00
MervinPraison 3bdf5b6c65 Enhance train.py with Configurable Training Parameters
- Updated version to 2.0.73 across multiple files
- Refactored TrainModel to use configurable training parameters with default fallbacks
- Improved flexibility of training configuration by allowing custom settings via config
- Dynamically set training arguments based on provided configuration
2025-02-06 07:47:40 +00:00
Mervin Praison 361fa67108 Merge pull request #377 from MervinPraison/develop
Bump version to 2.0.72 and enhance CLI configuration in train and cli…
2025-02-06 07:26:59 +00:00
MervinPraison c5abcf362a Bump version to 2.0.72 and enhance CLI configuration in train and cli modules
- Updated version to 2.0.72 across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, docs)
- Refined CLI configuration handling in cli.py for config.yaml generation
- Simplified train.py main function to always use provided config path
- Improved configuration flexibility for training and model setup
2025-02-06 07:26:41 +00:00
Mervin Praison 7ed2d99a11 Merge pull request #376 from MervinPraison/develop
Enhance train.py CLI configuration handling and bump version to 2.0.71
2025-02-06 07:19:11 +00:00
MervinPraison 81307da7c8 Enhance train.py CLI configuration handling and bump version to 2.0.71
- Updated version to 2.0.71 across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, docs)
- Modified train.py to use existing config.yaml when no CLI arguments are provided
- Improved CLI configuration flexibility for training command
2025-02-06 07:18:56 +00:00
Mervin Praison fb75153b5c Merge pull request #373 from MervinPraison/develop
Bump version to 2.0.70 and update configuration handling
2025-02-05 06:28:07 +00:00
MervinPraison cddcfcf170 Bump version to 2.0.70 and update configuration handling
- Updated version to 2.0.70 across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, docs)
- Enhanced CLI configuration handling in cli.py to load existing config when not creating a new one
- Minor improvements to configuration management and deployment scripts
2025-02-05 06:27:50 +00:00
Mervin Praison 398b0473e0 Merge pull request #372 from MervinPraison/develop
Update train.mdx with Wandb configuration and requirements
2025-02-05 05:07:23 +00:00
MervinPraison c5d260782a Update train.mdx with Wandb configuration and requirements
- Added detailed requirements for training, including Huggingface token and model details
- Included Wandb login and configuration instructions
- Updated documentation with environment variables for Wandb logging
2025-02-05 05:07:08 +00:00
Mervin Praison 116ac5a64d Merge pull request #370 from MervinPraison/develop
Add Wandb Support for Training and Bump Version to 2.0.69
2025-02-04 11:18:42 +00:00
MervinPraison abf6e2e8d1 Add Wandb Support for Training and Bump Version to 2.0.69
- Updated version to 2.0.69 across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, docs)
- Enhanced train.py with optional Wandb logging support
- Added environment variable-based Wandb configuration
- Implemented dynamic Wandb reporting and run naming
2025-02-04 11:18:20 +00:00
Mervin Praison cb2b3617fa Merge pull request #369 from MervinPraison/develop
Bump version to 2.0.68 and enhance Ollama model template generation
2025-02-04 11:10:50 +00:00
MervinPraison 6de67c7d0d Bump version to 2.0.68 and enhance Ollama model template generation
- Updated version across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, docs)
- Significantly improved train.py's prepare_modelfile_content() method
- Added comprehensive template and stop token mapping for multiple model architectures
- Implemented dynamic template selection based on model name
- Enhanced Ollama model file generation with more flexible configuration
2025-02-04 11:10:26 +00:00
Mervin Praison 5699d90894 Merge pull request #368 from MervinPraison/develop
Enhance train.py with Dynamic Stop Token Generation for Ollama Models
2025-02-04 10:33:19 +00:00
MervinPraison 2982e8ea9c Enhance train.py with Dynamic Stop Token Generation for Ollama Models
- Added intelligent stop token inference for various model architectures in train.py
- Implemented dynamic stop token selection based on model name
- Supported models include Phi, LLaVA, Mistral, Qwen, DeepSeek, and default models
- Updated Modelfile generation to include model-specific stop tokens
- Improved Ollama model preparation flexibility
2025-02-04 10:33:05 +00:00
Mervin Praison 9dd2146342 Merge pull request #367 from MervinPraison/develop
Bump version to 2.0.66 and remove TRAIN_AVAILABLE flag
2025-02-04 09:31:20 +00:00
MervinPraison f79184a6ee Bump version to 2.0.66 and remove TRAIN_AVAILABLE flag
- Updated version across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, deploy.py, docs)
- Removed TRAIN_AVAILABLE flag from cli.py
- Simplified CLI configuration by removing optional training feature check
2025-02-04 09:31:07 +00:00
Mervin Praison 0985e12ad4 Merge pull request #366 from MervinPraison/develop
Bump version to 2.0.65 and update deployment configurations
2025-02-04 08:05:06 +00:00
MervinPraison 0fbb7972e1 Bump version to 2.0.65 and update deployment configurations
- Updated version across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, deploy.py, docs)
- Enhanced Conda environment setup script with Ollama installation check
- Minor improvements to deployment and setup scripts
2025-02-04 08:04:44 +00:00
Mervin Praison 5744ae853e Merge pull request #365 from MervinPraison/develop
Develop
2025-02-04 07:36:59 +00:00
MervinPraison bd6e3da4ff Bump version to 2.0.64 and update dependencies
- Updated version across multiple files (praisonai.rb, pyproject.toml, uv.lock, Dockerfile, deploy.py, docs)
- Added TRAIN_AVAILABLE flag in cli.py for optional training feature
- Updated Conda environment setup script with latest dependencies
- Minor improvements to training and deployment configurations
2025-02-04 07:36:43 +00:00
MervinPraison f2f51d9e8b Refactor train.py with Enhanced Dataset Processing and Tokenization
- Completely rewrote training script with robust dataset handling
- Added support for ShareGPT and Alpaca-style datasets
- Implemented advanced formatting and tokenization functions
- Enhanced debug logging and error handling
- Simplified model preparation and training workflow
- Updated chat template and tokenization strategies
- Improved inference and model saving methods
2025-02-03 19:38:57 +00:00
Mervin Praison 4a1098603d Merge pull request #364 from MervinPraison/develop
cli docs
2025-02-03 07:41:14 +00:00
MervinPraison 5468e35bc1 cli docs 2025-02-03 07:40:46 +00:00
Mervin Praison b468267a87 Merge pull request #362 from MervinPraison/develop
Develop
2025-02-02 06:45:30 +00:00
MervinPraison 48141bbd9e update readme 2025-02-02 06:45:12 +00:00
MervinPraison b3cdf53d07 adding demo 2025-02-02 06:43:16 +00:00
Mervin Praison aa594ddc32 Merge pull request #361 from MervinPraison/develop
update read me 2
2025-02-02 06:30:57 +00:00
MervinPraison 5f330e8fb2 update read me 2 2025-02-02 06:30:37 +00:00
Mervin Praison ff94e128de Merge pull request #360 from MervinPraison/develop
update read me
2025-02-02 06:28:35 +00:00
MervinPraison 854a016fc5 update read me 2025-02-02 06:28:08 +00:00
Mervin Praison 12e8ed7b77 Merge pull request #359 from MervinPraison/develop
Update CLI Documentation with Latest LLM Model Option
2025-02-01 21:51:34 +00:00
MervinPraison 13c5f5537e Update CLI Documentation with Latest LLM Model Option
- Updated CLI documentation to reflect the latest LLM model option
- Changed example command to use `gpt-4o-mini` instead of `gpt-4-mini`
- Minor documentation refinement for CLI feature
2025-02-01 21:51:20 +00:00
Mervin Praison e7c1614ac8 Merge pull request #358 from MervinPraison/develop
Add CLI Documentation and Enhance CLI Functionality
2025-02-01 00:20:09 +00:00
MervinPraison 7cc6db2a34 Add CLI Documentation and Enhance CLI Functionality
- Added comprehensive CLI documentation in docs/features/cli.mdx
- Enhanced CLI functionality with new command-line options
- Implemented `--llm` flag to specify LLM models for direct prompts
- Updated CLI parsing to support flexible LLM model selection
- Improved direct prompt handling across different AI frameworks
- Bumped package version to 2.0.63
2025-02-01 00:19:44 +00:00
Mervin Praison b869bbc346 Merge pull request #357 from MervinPraison/develop
Enhance CLI with Direct Prompt Handling and Framework Flexibility
2025-02-01 00:01:27 +00:00
MervinPraison 5492be4412 Enhance CLI with Direct Prompt Handling and Framework Flexibility
- Added direct prompt handling in CLI for immediate task execution
- Implemented fallback mechanism to support multiple AI agent frameworks (PraisonAI, CrewAI, AutoGen)
- Updated CLI parsing to handle various input scenarios
- Simplified agent initialization for direct prompts
- Improved error messaging for framework installation
- Bumped package version to 2.0.62
2025-02-01 00:01:12 +00:00
Mervin Praison c2e33ef6a6 Merge pull request #355 from MervinPraison/develop
Add Image Generation AI Agents with Async Support
2025-01-31 17:26:37 +00:00
MervinPraison 5b2e0a9417 Add Image Generation AI Agents with Async Support
- Introduced new ImageAgent class for generating images using AI models
- Added image generation examples in examples/image/ directory
- Created documentation for image generation feature in docs/features/image-generation.mdx
- Updated package versions to 2.0.61
- Implemented synchronous and asynchronous image generation methods
- Added support for different image models and generation configurations
- Enhanced agent framework with specialized image generation capabilities
2025-01-31 17:26:20 +00:00
Mervin Praison 2f6d9ebcc9 Merge pull request #354 from MervinPraison/develop
Update TypeScript Documentation and Examples with Simplified Agent Wo…
2025-01-31 12:04:54 +00:00
MervinPraison 0610a5b3a4 Update TypeScript Documentation and Examples with Simplified Agent Workflows
- Refactored TypeScript documentation in docs/js/typescript.mdx with simplified code examples
- Updated example scripts in src/praisonai-ts/examples/ with concise, emoji-enhanced workflows
- Simplified multi-agent and single-agent example scripts
- Adjusted task-based agent examples to focus on brevity and creativity
- Updated package version to 1.0.15
- Improved logging and initialization of agents
2025-01-31 12:04:39 +00:00
Mervin Praison 7463744e62 Merge pull request #353 from MervinPraison/develop
Add JavaScript and TypeScript Documentation for PraisonAI SDK
2025-01-31 08:30:18 +00:00
MervinPraison c7428b8282 Add JavaScript and TypeScript Documentation for PraisonAI SDK
- Updated README.md with JavaScript code examples and installation instructions
- Added JavaScript documentation to docs/index.mdx, docs/installation.mdx, docs/introduction.mdx, and docs/quickstart.mdx
- Created new documentation pages for JavaScript, Node.js, and TypeScript in docs/js/
- Added example scripts for single and multi-agent workflows in src/praisonai-ts/examples/
- Updated package version to 1.0.14
- Enhanced PraisonAIAgents class to support auto-generated tasks and improved logging
- Simplified agent initialization and task generation
2025-01-31 08:30:01 +00:00
Mervin Praison ff1deb6b97 Merge pull request #352 from MervinPraison/develop
Update PraisonAI TypeScript SDK with Enhanced Logging, Examples, and …
2025-01-31 07:06:13 +00:00
MervinPraison bdbed2667d Update PraisonAI TypeScript SDK with Enhanced Logging, Examples, and Dependencies
- Upgraded package dependencies and versions
- Added new optional dependencies for enhanced logging and CLI experience
- Implemented PrettyLogger for improved console output
- Updated OpenAI service with more robust error handling and streaming
- Added new example scripts for single, multi-agent, and task-based workflows
- Enhanced logging and debugging capabilities
- Improved agent configuration and initialization
- Added CommonJS example scripts for easier integration
2025-01-31 07:05:56 +00:00
Mervin Praison 2810ec879c Merge pull request #351 from MervinPraison/develop
Add Development and Async TypeScript Documentation for PraisonAI Agen…
2025-01-31 05:31:00 +00:00
MervinPraison 04a8c621bb Add Development and Async TypeScript Documentation for PraisonAI Agents Framework
- Added new documentation pages for development setup and async TypeScript agents
- Updated docs/mint.json to include new navigation entries for JavaScript section
- Added development setup instructions and package structure overview
- Created new documentation for TypeScript async agent workflows
- Simplified and standardized example code across documentation pages
- Updated package version to 1.0.11
2025-01-31 05:30:41 +00:00
Mervin Praison 17cbadaf64 Merge pull request #350 from MervinPraison/develop
Update JavaScript and TypeScript Documentation for PraisonAI Agents F…
2025-01-31 04:55:36 +00:00
MervinPraison fbcdf84350 Update JavaScript and TypeScript Documentation for PraisonAI Agents Framework
- Added new documentation pages for JavaScript, Node.js, and TypeScript in docs/js/
- Updated docs/mint.json to include new navigation entries
- Simplified and standardized example code across documentation pages
- Updated package version to 1.0.8
- Refactored example scripts to use imported PraisonAI package
- Improved documentation structure and code examples for single, multi-agent, and task-based workflows
2025-01-31 04:55:23 +00:00
Mervin Praison ab3295caa1 Merge pull request #349 from MervinPraison/develop
Add TypeScript Examples for PraisonAI Agents SDK
2025-01-30 21:25:54 +00:00
MervinPraison 95517f5007 Add TypeScript Examples for PraisonAI Agents SDK
Expand the PraisonAI TypeScript SDK with comprehensive example scripts demonstrating various agent interaction patterns:

- Added single-agent and multi-agent example scripts
- Implemented chat and task-based agent workflows
- Created examples for parallel and sequential agent processing
- Updated package version to 1.0.7
- Enhanced Agent and PraisonAIAgents classes with improved method signatures
- Added examples covering scenarios like script writing, recipe generation, and research tasks
2025-01-30 21:25:31 +00:00
Mervin Praison 3800825b38 Merge pull request #348 from MervinPraison/develop
Add Node.js AI Agents Framework Documentation
2025-01-30 20:41:21 +00:00
MervinPraison f85e16ab87 Add Node.js AI Agents Framework Documentation
Update documentation to include a comprehensive guide for the PraisonAI Node.js framework:
- Added new JS documentation page in docs/js/js.mdx
- Updated docs/mint.json to include JS navigation and sidebar entry
- Removed praisonai-examples directory, consolidating examples into documentation
- Provided installation, usage, and development setup instructions for the framework
2025-01-30 20:41:00 +00:00
Mervin Praison dbdd3d3d9a Merge pull request #347 from MervinPraison/develop
Add PraisonAI TypeScript AI Agents Framework node.js AI Agents Framework
2025-01-30 20:30:25 +00:00
MervinPraison 1cc5dad01f Add PraisonAI TypeScript Examples and SDK Infrastructure
This commit establishes the TypeScript implementation of the PraisonAI Agents SDK, including:

- Created comprehensive example scripts in `praisonai-examples/`
- Implemented core SDK modules in `praisonai-ts/src/`
- Added multi-agent workflow examples (single, multi-agent, task-based)
- Developed base implementations for agents, tasks, tools, and LLM integration
- Configured TypeScript project with comprehensive package setup
- Implemented ArXiv search and download tools as initial tool example
- Added logging and utility modules for enhanced development experience

The commit provides a foundational TypeScript SDK with modular architecture and example scripts demonstrating agent interactions.
2025-01-30 20:27:33 +00:00
Mervin Praison 3797e4fe25 Merge pull request #346 from MervinPraison/develop
Remove Jupyter notebook agent examples from cookbooks/notebooks/yaml/
2025-01-30 07:04:34 +00:00
MervinPraison d840e7d0ef Remove Jupyter notebook agent examples from cookbooks/notebooks/yaml/
This commit removes a collection of Jupyter notebook files containing agent example implementations across various domains, including:

- Research and analysis
- Writing and creative tasks
- Job and recruitment workflows
- Trip planning
- Social media and content generation
- Search and information retrieval

The removal appears to be part of a broader reorganization of the project's example and cookbook materials, streamlining the repository structure.
2025-01-30 07:04:19 +00:00
Mervin Praison 6f9ca636aa Merge pull request #345 from MervinPraison/develop
Remove multiple Jupyter notebook agent examples from cookbooks
2025-01-30 07:03:19 +00:00
MervinPraison f254d9e290 Remove multiple Jupyter notebook agent examples from cookbooks
This commit removes a large collection of Jupyter notebook files in the `cookbooks/notebooks/` directory that contained various agent example implementations. These notebooks covered a wide range of use cases including:

- Research and analysis agents
- Writing and creative agents
- Job and recruitment agents
- Trip planning agents
- Social media and content generation agents
- Search and information retrieval agents

The removal appears to be part of a broader reorganization of the project's example and cookbook materials.
2025-01-30 07:03:06 +00:00
Mervin Praison 2e95279cd5 Merge pull request #344 from MervinPraison/develop
adding cookbooks
2025-01-30 07:02:19 +00:00
MervinPraison c218ad62ce adding cookbooks 2025-01-30 07:01:39 +00:00
Mervin Praison d10849085d Merge pull request #343 from MervinPraison/develop
adding js sdk
2025-01-30 06:55:13 +00:00
MervinPraison 9594426fc2 Add PraisonAI Agents SDK and Example Scripts
- Initialized PraisonAI Agents SDK project structure in `src/praisonai-agents/`
- Added comprehensive set of example scripts demonstrating agent capabilities
- Included core SDK modules for agents, tasks, tools, knowledge, and LLM integration
- Implemented various agent workflows including:
  - Chain of Thought reasoning
  - Web search
  - Code analysis
  - Memory management
  - Multi-agent coordination
- Created configuration files for development environment setup
- Added sample data and test files for agent interactions

The commit establishes a foundational SDK with diverse agent interaction examples and modular architecture.
2025-01-30 06:54:57 +00:00
MervinPraison 1c6fc71a06 adding js sdk 2025-01-30 06:52:54 +00:00
Mervin Praison d7289acc1d Merge pull request #340 from MervinPraison/develop
Add Hugging Face token export instruction to generate-reasoning docum…
2025-01-29 06:28:13 +00:00
MervinPraison 54a748b4c7 Add Hugging Face token export instruction to generate-reasoning documentation
- Updated docs/features/generate-reasoning.mdx to include HuggingFace token export step
- Expanded environment variable setup instructions for Hugging Face integration
2025-01-29 06:27:49 +00:00
Mervin Praison 9f62e9201a Merge pull request #339 from MervinPraison/develop
2.0.60
2025-01-29 05:59:25 +00:00
MervinPraison 1b69360d9f Bump PraisonAI version to 2.0.60 and update dependencies
- Updated version to 2.0.60 in Homebrew formula, pyproject.toml, and Docker files
- Upgraded praisonaiagents dependency from 0.0.56 to 0.0.60
- Added new documentation for generating reasoning data
- Included example script for chain-of-thought data generation
- Enhanced workflow task management and logging in process modules

The changes improve the framework's version management, documentation, and provide new tools for synthetic reasoning data generation.
2025-01-29 05:58:58 +00:00
MervinPraison 9bdc6545ad Enhance Workflow Task Management with Workflow Finished Flag and Improved Routing
- Added `workflow_finished` flag to `Process` class to enable early workflow termination
- Implemented more robust task routing logic in `process.py` for decision and loop tasks
- Updated task reset mechanism to respect `rerun` parameter
- Improved context clearing and task status management
- Enhanced logging for workflow progression and task transitions

The changes provide more flexible and controlled workflow execution, with better handling of task conditions and early termination scenarios.
2025-01-28 16:40:22 +00:00
MervinPraison 06cd909367 Add max_iter parameter and enhanced workflow task management with fallback mechanism
- Updated `orchestrator-workers.py` to include `max_iter=10` parameter in workflow initialization
- Enhanced `process.py` with a new `_find_next_not_started_task()` method to provide fallback task selection
- Implemented comprehensive logging for workflow cycles, task status, and iteration tracking
- Added retry counter and fallback mechanism to handle scenarios with incomplete or stalled tasks
- Improved workflow termination logic with detailed final summary logging

The changes improve workflow reliability, prevent potential infinite loops, and provide more robust task management in complex multi-agent scenarios.
2025-01-28 11:26:32 +00:00
MervinPraison 67aeece7fc Bump praisonaiagents package version to 0.0.58
- Updated version in `pyproject.toml` and `uv.lock`
- Incremented package version for continued development and improvements
2025-01-27 19:19:40 +00:00
MervinPraison ef67d0753c Enhance Workflow Task Management with Detailed Logging and Loop Task Handling
- Updated `.cursorrules` with comprehensive technical overview of workflow execution challenges
- Refactored `cot-agents.py` to:
  - Add Pydantic model for structured output
  - Improve task description and condition handling
  - Add output validation for chain of thought generation
- Enhanced `process.py` with:
  - Extensive debug logging for task execution
  - Improved loop task and subtask management
  - More detailed logging of task status and progression

The changes improve workflow reliability, provide deeper insights into task execution, and prevent infinite loops in complex task workflows.
2025-01-27 19:18:49 +00:00
MervinPraison f374f9f791 Enhance COT Agent Workflow with Improved Task Management and Logging
- Refactored `cot-agents.py` to include:
  - New `write_csv` and `count_questions` functions
  - Added `TotalQuestionsEvaluator` agent for tracking question count
  - Improved task workflow with decision and loop task types
- Updated `process.py` to support:
  - Enhanced logging for task execution
  - Better handling of loop and decision tasks
  - Improved subtask creation and management
- Modified `csv_tools.py` to support more flexible CSV writing with string input
- Implemented more robust task progression and status tracking

The changes improve the flexibility, logging, and task management of the Chain of Thought agent workflow.
2025-01-27 13:59:59 +00:00
MervinPraison 492fb29af9 Enhance Chain of Thought (COT) agent workflow with batch processing and Hugging Face integration
- Added `cot-agents-batch.py` to support batch processing of Q&A pairs
- Updated `cot-agents.py` with a more comprehensive workflow including:
  - Question generation
  - Chain of Thought solution generation
  - Hugging Face dataset upload
- Refined `generatecot.py` with improvements to solution generation:
  - Reduced max attempts
  - Adjusted scoring thresholds
  - Added direct QA pair tracking

The changes improve the flexibility and automation of Chain of Thought solution generation and dataset management.
2025-01-27 02:52:14 +00:00
MervinPraison cd56ebd5cf Add Chain of Thought (COT) generation tools and update project structure
- Introduced comprehensive `generatecot.py` in `praisonaiagents/tools/train/data/` with advanced Chain of Thought solution generation capabilities
- Added multiple COT-related tools and methods:
  - Solution generation and improvement
  - Answer verification
  - Error detection and correction
  - Export to various formats (JSON, CSV, Alpaca)
  - HuggingFace dataset upload support
- Updated tool mappings in `__init__.py` to include COT-related tools
- Moved existing `generatecot.py` from `train/data/` to `tools/train/data/`
- Bumped project version to 0.0.57 in relevant files

The changes enhance the framework's capabilities for generating and managing step-by-step problem-solving solutions with AI-powered reasoning.
2025-01-26 07:22:32 +00:00
MervinPraison 08e99f6ef7 Enhance GenerateCOT with dictionary-based solution generation and Alpaca format export
- Added new methods to generate solutions in dictionary format:
  - `get_solution_dict()` for step-by-step problem solving
  - `improve_solution_dict()` to refine existing solutions
  - `start_dict()` to generate and validate solutions
- Implemented `export_alpaca_format()` to convert solutions to Alpaca training format
- Updated type hints and added example usage for new methods
- Extended the script with additional QA data processing and export demonstration

The changes improve the flexibility and usability of the GenerateCOT class for solution generation and data preparation.
2025-01-25 08:22:08 +00:00
MervinPraison 670d653ae9 Add GenerateCOT class for step-by-step solution generation and verification
- Created a new Python script `generatecot.py` in the train/data directory
- Implemented a comprehensive solution generation class with features like:
  - Step-by-step problem solving
  - Answer verification
  - Solution improvement
  - Error detection and correction
- Added support for loading and saving solutions with JSON
- Included an example usage demonstrating the class functionality

The GenerateCOT (Chain of Thought) class provides a robust mechanism for generating and refining solutions to various problems using AI-powered reasoning.
2025-01-25 07:47:20 +00:00
Mervin Praison faa014b8b0 Merge pull request #333 from MervinPraison/develop
2.0.59
2025-01-24 17:17:53 +00:00
MervinPraison 6d454d0c6e Update PraisonAI to version 2.0.59 and enhance dependencies
- Bumped PraisonAI version from 2.0.58 to 2.0.59 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonaiagents` dependency version from `0.0.53` to `0.0.56` across relevant files for improved functionality.
- Modified agent task descriptions in `repetitive-agents.py` to clarify expected outputs.
- Enhanced the `process.py` file to improve task handling and expected output management.

These changes aim to refine the PraisonAI framework's capabilities and ensure compatibility with the latest dependencies.
2025-01-24 17:17:32 +00:00
MervinPraison 0ec3fe3510 Add new agent scripts and update version to 0.0.55
- Introduced three new Python scripts: `deepseek-reasoning-output-tokens.py`, `llm-deepseek-reasoning-steps.py`, and `llm-langchain-toolcall.py` to enhance reasoning capabilities and multi-source information retrieval.
- Updated `pyproject.toml` and `uv.lock` to reflect the new version 0.0.55.
- Enhanced `wikipedia-agent.py` to utilize the new `gpt-4o-mini` model for improved performance.
- Improved `agent.py` to support tool calls in chat completions, refining the overall functionality of the agent framework.

These changes aim to expand the capabilities of the PraisonAI framework by integrating new reasoning features and improving user experience with updated versioning.
2025-01-24 13:04:34 +00:00
MervinPraison 707888cdf9 Remove deprecated agent scripts and update version to 0.0.54
- Deleted `any-llm-agents.py` and `any-llm-agents-advanced.py` scripts to streamline the agent framework.
- Updated `pyproject.toml` and `uv.lock` to reflect the new version 0.0.54.
- Enhanced `agent.py` and `llm.py` to improve handling of reasoning steps by ensuring `reasoning_steps` is properly managed in API calls.

These changes aim to simplify the agent framework and improve the overall functionality of the PraisonAI system.
2025-01-24 10:35:42 +00:00
Mervin Praison 42051630bc Merge pull request #331 from MervinPraison/develop
Develop
2025-01-23 17:19:08 +00:00
MervinPraison bfcccb6355 Update PraisonAI to version 2.0.58 and enhance reasoning capabilities
- Bumped PraisonAI version from 2.0.57 to 2.0.58 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonaiagents` dependency version from `0.0.50` to `0.0.53` across relevant files for improved functionality.
- Enhanced reasoning features by modifying agent initialization parameters to use `reasoning_steps` instead of `show_reasoning`, improving clarity in agent behavior.
- Introduced a new script `deepseek-reasoning-multi-agents.py` for multi-agent reasoning tasks, showcasing the integration of reasoning agents.
- Added documentation for new reasoning features, including a detailed guide on creating reasoning extract agents.

These changes aim to refine the reasoning capabilities and improve the overall user experience within the PraisonAI framework.
2025-01-23 17:18:54 +00:00
MervinPraison e329afc394 Refactor reasoning capabilities and update version to 0.0.52
- Removed the `any-llm-think.py` script to streamline the agent framework.
- Enhanced `deepseek-reasoning-agents.py` to include reasoning display options and updated the method for starting agents.
- Updated `pyproject.toml` and `uv.lock` to reflect the new version 0.0.52.
- Improved `agent.py` and `llm.py` to support reasoning content in both synchronous and asynchronous calls, enhancing the overall functionality of the agent framework.

These changes aim to refine the reasoning features and improve the user experience within the PraisonAI framework.
2025-01-23 13:52:58 +00:00
MervinPraison 9417cc6457 Add new reasoning agents and update version to 0.0.51
- Introduced three new Python scripts: `any-llm-think.py`, `deepseek-reasoning-agents.py`, and `deepseek-think.py` for enhanced reasoning capabilities using the `deepseek-reasoner` model.
- Updated `pyproject.toml` and `uv.lock` to reflect the new version 0.0.51.
- Enhanced the `agent.py` file with new data classes and methods to support reasoning content in chat completions, improving the overall functionality of the agent framework.

These changes aim to expand the capabilities of the PraisonAI framework by integrating reasoning features and improving the user experience with updated versioning.
2025-01-23 10:52:15 +00:00
Mervin Praison 10a3d279ae Merge pull request #329 from MervinPraison/develop
Update index.mdx description to enhance clarity and detail
2025-01-23 06:40:49 +00:00
MervinPraison 2a916208e1 Update index.mdx description to enhance clarity and detail
- Revised the description of PraisonAI to emphasize its capabilities as a production-ready Multi-AI Agents framework with self-reflection.
- Highlighted the integration of PraisonAI Agents, AutoGen, and CrewAI as a low-code solution for automating tasks and solving complex challenges.
- Focused on the framework's strengths in simplicity, customization, and effective human-agent collaboration.

These changes aim to provide users with a clearer understanding of PraisonAI's functionalities and benefits.
2025-01-23 06:40:23 +00:00
Mervin Praison bcd0bbbd24 Merge pull request #328 from MervinPraison/develop
Refactor documentation for agent setup and usage
2025-01-23 06:38:06 +00:00
MervinPraison 5701a40f11 Refactor documentation for agent setup and usage
- Updated the introduction.mdx file to streamline the steps for installing the PraisonAI package and configuring the environment.
- Revised agent creation examples to simplify the process for both single and multiple agents, enhancing clarity and usability.
- Added a new section for creating an `agents.yaml` configuration file for no-code users, including automatic generation instructions.
- Improved the overall structure and readability of the documentation to facilitate a better user experience.

These changes aim to provide clearer guidance for users in setting up and utilizing the PraisonAI framework effectively.
2025-01-23 06:37:49 +00:00
Mervin Praison 3ffac395bb Merge pull request #327 from MervinPraison/develop
Update README and documentation with new video tutorials
2025-01-23 06:34:56 +00:00
MervinPraison 37119aa3ac Update README and documentation with new video tutorials
- Removed the License section from README.md to streamline content.
- Added a comprehensive list of video tutorials to docs/index.mdx, covering various AI agent functionalities such as self-reflection, reasoning, and multimodal capabilities.
- Enhanced the documentation's educational resources, providing users with visual aids to better understand the Praison AI framework.

These changes aim to improve user engagement and learning through accessible video content.
2025-01-23 06:34:36 +00:00
Mervin Praison 8b2d324d3b Merge pull request #326 from MervinPraison/develop
Enhance README with new AI agent video resources
2025-01-23 06:30:01 +00:00
MervinPraison 6d0b29e60d Enhance README with new AI agent video resources
- Added multiple new video links to the README.md, showcasing various AI agent functionalities including self-reflection, reasoning, multimodal capabilities, and more.
- Improved the documentation's educational value by providing visual resources for users to better understand the Praison AI framework.

These changes aim to enrich the user experience by offering accessible learning materials related to AI agents.
2025-01-23 06:29:44 +00:00
Mervin Praison 583cbc5efa Merge pull request #325 from MervinPraison/develop
Update documentation and examples for agent initialization and usage
2025-01-23 06:21:43 +00:00
MervinPraison 90dd84a152 Update documentation and examples for agent initialization and usage
- Revised the README.md to reflect the updated method for starting agents, changing `agent.chat` to `agent.start` for clarity and accuracy.
- Added a new section in the README.md for creating an `agents.yaml` file, enhancing the setup instructions for users.
- Updated the installation instructions in `docs/index.mdx` to clarify package names and improve the overall structure of the documentation.
- Streamlined code examples in `docs/concepts/agents.mdx` to focus on single and multiple agent initialization, ensuring users have clear and concise guidance.

These changes improve the clarity and usability of the documentation, making it easier for users to understand and implement the PraisonAI framework.
2025-01-23 06:21:25 +00:00
Mervin Praison ef7fa66e33 Merge pull request #324 from MervinPraison/develop
Update PraisonAI to version 2.0.57 and enhance documentation
2025-01-23 06:06:43 +00:00
MervinPraison 1659ed61bc Update PraisonAI to version 2.0.57 and enhance documentation
- Bumped PraisonAI version from 2.0.56 to 2.0.57 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonaiagents` dependency version from `0.0.49` to `0.0.50` across relevant files for improved functionality.
- Added a new `docker-compose.yml` file and multiple Dockerfiles for different services (UI, chat, development) to streamline deployment.
- Enhanced the README.md with new sections on AI agents flow, tools, memory, and various processing types, improving clarity and usability.
- Introduced a new test script `cl-test.py` for validating chat functionalities with the Gemini API.

These changes improve the overall functionality, usability, and deployment processes of the PraisonAI framework.
2025-01-23 06:06:23 +00:00
Mervin Praison b8939ef439 Merge pull request #323 from MervinPraison/develop
adding chat with pdf
2025-01-22 18:37:48 +00:00
MervinPraison 4bada9e5fc adding chat with pdf 2025-01-22 18:37:27 +00:00
Mervin Praison 51c4cb00b0 Merge pull request #322 from MervinPraison/develop
updating docs
2025-01-22 18:32:20 +00:00
MervinPraison ad96549ea3 updating docs 2025-01-22 18:32:03 +00:00
Mervin Praison 183d10d7cc Merge pull request #321 from MervinPraison/develop
Develop
2025-01-22 18:29:04 +00:00
MervinPraison bce1559ab5 docs update 2025-01-22 18:28:46 +00:00
MervinPraison 6f3fb87ba3 Update README and local development documentation for improved clarity and logging instructions
- Revised section headings in README.md to number the agent categories for better organization.
- Added logging configuration instructions to the local-development.mdx file, detailing how to set log levels for both standard and advanced logging.
- Removed outdated logging instructions from README.md to streamline the documentation.

These changes enhance the clarity of the documentation and provide users with essential logging setup information for local development.
2025-01-22 18:24:24 +00:00
Mervin Praison e7f6b2df67 Merge pull request #320 from MervinPraison/develop
Update README and agent initialization for enhanced clarity and funct…
2025-01-22 18:07:29 +00:00
MervinPraison 08d72eeb80 Update README and agent initialization for enhanced clarity and functionality
- Revised the README.md to better describe PraisonAI as a production-ready Multi-AI Agents framework, emphasizing its capabilities in automating tasks and problem-solving.
- Updated the list of features to include new agent types and functionalities, such as Code Interpreter Agents and Async & Parallel Processing.
- Simplified the agent initialization examples in the README, providing clearer instructions for users to create and run agents.
- Modified the agent client initialization in main.py to handle missing API keys more gracefully.
- Added "developers/local-development" to mint.json for improved documentation structure.

These changes enhance the user experience by providing clearer documentation and improving the robustness of agent initialization.
2025-01-22 18:07:15 +00:00
Mervin Praison 11aefae90f Merge pull request #319 from MervinPraison/develop
Enhance Streamlit UIs and Add New Model Integrations
2025-01-22 13:07:45 +00:00
MervinPraison 10d5158d27 Enhance Streamlit UIs and Add New Model Integrations
- Updated `mint.json` to include new Streamlit UIs for Deepseek, Gemini, and Ollama models, improving model accessibility.
- Expanded documentation in `models.mdx` and `google.mdx` to provide detailed setup instructions for integrating OpenAI, Litellm, and Gemini models.
- Introduced new example scripts for Gemini and Ollama Streamlit applications, showcasing interactive chat capabilities.
- Added comprehensive features and prerequisites sections in the new UI documentation to guide users in setting up their environments.

These changes enhance the usability and functionality of the PraisonAI framework, particularly in model integration and user interface development.
2025-01-22 13:07:31 +00:00
Mervin Praison 1d8b814fcd Merge pull request #318 from MervinPraison/develop
Update PraisonAI to version 2.0.56 and enhance agent functionality
2025-01-22 10:46:35 +00:00
MervinPraison 6e8a5b98a8 Update PraisonAI to version 2.0.56 and enhance agent functionality
- Bumped PraisonAI version from 2.0.55 to 2.0.56 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.46` to `0.0.49` across relevant files for improved functionality.
- Introduced new agent examples for Google Gemini and Deepseek models, enhancing the framework's capabilities.
- Enhanced logging configurations to suppress unnecessary output and improve clarity during execution.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in agent management and logging clarity.
2025-01-22 10:46:18 +00:00
Mervin Praison 59d0ff8c95 Merge pull request #317 from MervinPraison/develop
Refactor deepseek agent implementation and remove unused files
2025-01-21 19:02:39 +00:00
MervinPraison b2109faa06 Refactor deepseek agent implementation and remove unused files
- Simplified the deepseek agent setup by removing the previous configuration and task definitions, replacing them with a more streamlined agent initialization.
- Updated the agent's instructions for clarity and direct usage.
- Deleted the unused `small.pdf` file to clean up the repository.
- Added "deepseek" model to the list of available models in `mint.json` for improved model management.

These changes enhance the usability and clarity of the deepseek agent within the PraisonAI framework.
2025-01-21 19:02:25 +00:00
Mervin Praison 024eaed456 Merge pull request #316 from MervinPraison/develop
Develop
2025-01-21 17:51:15 +00:00
MervinPraison 4fd3a572cf Update PraisonAI to version 2.0.55 and adjust dependencies
- Bumped PraisonAI version from 2.0.54 to 2.0.55 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.45` to `0.0.46` across relevant files for improved functionality.
- Adjusted deployment scripts and documentation to ensure compatibility with the new version.

These changes enhance the overall functionality and usability of the PraisonAI framework, particularly in dependency management and deployment processes.
2025-01-21 17:50:53 +00:00
MervinPraison baaf8b6256 Update version to 0.0.46 and enhance memory feature checks
- Bumped the version of the `praisonaiagents` package from 0.0.45 to 0.0.46 in `pyproject.toml` and `uv.lock` to reflect the latest updates.
- Added import checks for memory features in the `Agent`, `PraisonAIAgents`, and `Task` classes to ensure proper handling of memory dependencies.
- Removed the obsolete `Memory` import from the `__init__.py` file to streamline the codebase.

These changes improve the robustness of the PraisonAI framework by ensuring that memory features are only utilized when the necessary dependencies are installed.
2025-01-21 16:47:31 +00:00
Mervin Praison fe4550d2bc Merge pull request #315 from MervinPraison/develop
2.0.54
2025-01-21 15:01:57 +00:00
MervinPraison db09a94425 Update PraisonAI to version 2.0.54 and enhance agent functionality
- Bumped PraisonAI version from 2.0.53 to 2.0.54 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.44` to `0.0.45` across relevant files for improved functionality.
- Removed the obsolete `knowledge-embedding-agents.py` file and introduced a new `vector-db-agents.py` file to enhance knowledge retrieval capabilities.
- Added new documentation for RAG (Retrieval Augmented Generation) agents, detailing their configuration and usage in `docs/features/rag.mdx`.
- Updated deployment scripts to ensure compatibility with the new version and improved agent functionalities.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in knowledge management and retrieval capabilities.
2025-01-21 15:01:12 +00:00
MervinPraison 2db36dc932 Enhance Knowledge Agent Configuration and Update Version
- Updated the Knowledge Agent configuration to include a new versioning system and improved vector store settings.
- Changed the collection name from "custom_knowledge" to "praison" for consistency across files.
- Added user_id parameter to the Knowledge Agent for better user tracking.
- Enhanced the embedding database configuration to support dynamic context management.
- Bumped the version of the `praisonaiagents` package from 0.0.44 to 0.0.45 in `pyproject.toml` to reflect these updates.

These changes improve the functionality and usability of the Knowledge Agent within the PraisonAI framework, particularly in knowledge management and retrieval capabilities.
2025-01-21 13:09:41 +00:00
Mervin Praison 8c0e4277a4 Merge pull request #313 from MervinPraison/develop
Update PraisonAI to version 2.0.53 and enhance agent functionality
2025-01-20 10:04:38 +00:00
MervinPraison 41448617d5 Update PraisonAI to version 2.0.53 and enhance agent functionality
- Bumped PraisonAI version from 2.0.52 to 2.0.53 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.43` to `0.0.44` across relevant files for improved functionality.
- Enhanced the `PraisonAIAgents` class to include a `max_iter` parameter, allowing for more control over agent iterations.
- Added new tasks to `agents/tasks.csv` to expand the capabilities of the agents in handling various writing tasks.
- Updated documentation to reflect changes in agent functionality and new task examples.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in task execution and agent capabilities.
2025-01-20 10:04:20 +00:00
Mervin Praison 49ea23c676 Merge pull request #312 from MervinPraison/develop
Introducing Repetitive Agents
2025-01-20 07:18:19 +00:00
MervinPraison bb0dc63680 Update PraisonAI to version 2.0.52 and enhance repetitive agents functionality
- Bumped PraisonAI version from 2.0.51 to 2.0.52 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.42` to `0.0.43` across relevant files for improved functionality.
- Introduced new files for repetitive agents in `agents/repetitive-agents.py` and `examples/concepts/repetitive-agents.py`, enabling automated task loops.
- Enhanced documentation with a new section on repetitive agents in `docs/features/repetitive.mdx` and updated `mint.json` to include the new feature.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in handling repetitive tasks and enhancing agent capabilities.
2025-01-20 07:17:43 +00:00
MervinPraison 7774f2c565 Add loop agent functionality and update task management in PraisonAI agents
- Introduced a new loop agent in `loop_agents.py` to create and manage a loop of tasks from a CSV file.
- Added a new file `repetitive-manual-agents.py` that implements task identification, status checking, and updating functionalities.
- Updated `process.py` to enhance task handling by allowing dynamic input files for loop tasks.
- Removed the obsolete `repeat_agents.py` file to streamline the codebase.
- Bumped the version of the `praisonaiagents` package from 0.0.42 to 0.0.43 in `pyproject.toml` and `uv.lock` to reflect these changes.

These updates improve the task execution capabilities of the PraisonAI framework, particularly in handling repetitive tasks and enhancing agent functionality.
2025-01-20 06:56:33 +00:00
MervinPraison 5533fd3476 Enhance logging and improve decision/loop task handling in PraisonAI agents
- Suppressed debug logs from the markdown parser to reduce noise in the logging output.
- Refactored decision-making logic to utilize Pydantic models for better type safety and clarity.
- Updated loop task handling to ensure proper context management and error handling.
- Introduced dynamic literal types for decision and loop tasks to enhance flexibility in task definitions.

These changes improve the overall robustness and usability of the PraisonAI framework, particularly in task execution and logging clarity.
2025-01-19 05:58:46 +00:00
Mervin Praison 262a90a235 Merge pull request #310 from MervinPraison/develop
2.0.51
2025-01-18 06:02:35 +00:00
MervinPraison 60928dcb90 Update PraisonAI to version 2.0.51 and enhance dependencies
- Bumped PraisonAI version from 2.0.50 to 2.0.51 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.41` to `0.0.42` across relevant files for improved functionality.
- Enhanced documentation with updated installation instructions for various examples, ensuring users have access to the latest package versions.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in dependency management and documentation clarity.
2025-01-18 06:02:09 +00:00
MervinPraison c8552e1158 Update PraisonAI agents package version to 0.0.42 in pyproject.toml and uv.lock
- Bumped the version from 0.0.41 to 0.0.42 to reflect recent updates and ensure users have access to the latest features and improvements.
- This change maintains the integrity of the PraisonAI framework and prepares it for future enhancements.
2025-01-18 05:48:57 +00:00
Mervin Praison c57d7db9bb Merge pull request #309 from MervinPraison/develop
Enhance Streamlit UIs for Code Analysis and Hackathon Judging
2025-01-17 22:21:06 +00:00
MervinPraison 236abc2c83 Enhance Streamlit UIs for Code Analysis and Hackathon Judging
- Updated `mint.json` to group Streamlit pages under a new "Streamlit" section, improving organization.
- Renamed titles in `code-analysis.mdx` and `hackathon-judge.mdx` to include "Agent" for clarity.
- Added new Streamlit UI files: `code-analysis-streamlit.mdx` and `hackathon-judge-streamlit.mdx`, providing interactive interfaces for code analysis and hackathon project evaluation.
- Each new UI includes detailed descriptions, features, quick start guides, and visual flowcharts to enhance user experience and understanding.

These changes significantly improve the usability and accessibility of the PraisonAI framework's Streamlit applications, offering users powerful tools for code and project evaluation.
2025-01-17 22:20:51 +00:00
Mervin Praison 76c5f8fe3f Merge pull request #308 from MervinPraison/develop
Add new code analysis and hackathon judge agents with Streamlit integ…
2025-01-17 19:03:12 +00:00
MervinPraison 82750020d2 Add new code analysis and hackathon judge agents with Streamlit integration
- Introduced `code-analysis-agents.py` and `code-analysis-streamlit.py` for comprehensive code evaluation, including metrics on architecture, maintainability, performance, and security.
- Added `context-agents-code.py` and `context-agents.py` for CV analysis capabilities, providing detailed scoring and recommendations.
- Implemented `hackathon-judge-agent.py` and `hackathon-judge-streamlit.py` for evaluating hackathon projects through video demonstrations, offering scores and feedback on innovation, technical complexity, and presentation quality.
- Enhanced documentation with new examples for code analysis and hackathon judging, improving user guidance and showcasing agent capabilities.
- Updated `mint.json` to include new examples, enriching the available resources for users.

These additions significantly expand the functionality of the PraisonAI framework, providing users with powerful tools for code and project evaluation.
2025-01-17 19:02:56 +00:00
Mervin Praison f49ad9fbc2 Merge pull request #306 from MervinPraison/develop
Develop
2025-01-17 17:35:18 +00:00
MervinPraison c086c60fd6 Update PraisonAI to version 2.0.50 and enhance dependencies
- Bumped PraisonAI version from 2.0.49 to 2.0.50 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.40` to `0.0.41` across relevant files for improved functionality.
- Added a new `context-agents.py` file to introduce a CV analysis agent with comprehensive evaluation capabilities.
- Modified deployment scripts to ensure compatibility with the updated package version.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in dependency management and the introduction of new agent capabilities.
2025-01-17 17:35:00 +00:00
MervinPraison 4f8f4f2036 Update package version to 0.0.41 in uv.lock
- Bumped the version of the PraisonAI agents package from 0.0.40 to 0.0.41 to reflect recent updates.
- This change ensures that the latest features and improvements are properly versioned and available for users.
2025-01-17 17:26:51 +00:00
MervinPraison 8e91c20967 Update package version to 0.0.41 in pyproject.toml
- Bumped the version of the PraisonAI agents package from 0.0.40 to 0.0.41 to reflect recent updates.
- This change ensures that the latest features and improvements are properly versioned and available for users.

These updates maintain the integrity of the PraisonAI framework and prepare it for future enhancements.
2025-01-17 17:26:34 +00:00
MervinPraison 6f092c1507 Refactor agent context handling and improve task prompt generation
- Updated `crewai-tools-example.py` to remove unnecessary whitespace.
- Modified `agent.py` to replace `schema_json()` with `model_json_schema()` for JSON output consistency.
- Enhanced context handling in `agents.py` to avoid duplicates and improve clarity in task prompts by using lists instead of strings.
- Added support for passing content to tasks in both `start` and `astart` methods, allowing for dynamic context management.
- Improved task prompt generation in `task.py` to handle various context types, ensuring better output formatting.

These changes enhance the functionality and usability of the PraisonAI agents, particularly in context management and task execution clarity.
2025-01-17 17:25:58 +00:00
Mervin Praison 8f553d3a54 Merge pull request #305 from MervinPraison/develop
2.0.49
2025-01-17 12:24:16 +00:00
MervinPraison 2d647e25b5 Update PraisonAI to version 2.0.49 and enhance dependencies
- Bumped PraisonAI version from 2.0.48 to 2.0.49 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.39` to `0.0.40` across relevant files for improved functionality.
- Modified deployment scripts to ensure compatibility with the updated package version.
- Enhanced documentation by adding a new "Tools" section in `mint.json` and updating the title in `custom.mdx` for better clarity.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in dependency management and documentation clarity.
2025-01-17 12:23:44 +00:00
MervinPraison 039bb772f5 Update version to 0.0.40 and enhance agent functionality
- Bumped the package version in `pyproject.toml` and `uv.lock` from `0.0.39` to `0.0.40` to reflect recent updates.
- Improved the `Agent` class in `agent.py` to support both Langchain and CrewAI tools by adding checks for the presence of `run` and `_run` methods, allowing for more flexible function handling.

These changes enhance the functionality of the PraisonAI agents, ensuring compatibility with different toolsets and improving overall usability.
2025-01-17 12:13:08 +00:00
Mervin Praison 459c2f2b70 Merge pull request #304 from MervinPraison/develop
Add new examples and enhance documentation for AI agent use cases
2025-01-17 10:34:16 +00:00
MervinPraison ee59706357 Add new examples and enhance documentation for AI agent use cases
- Introduced multiple new example files for various AI agent applications, including Climate Impact, Crypto Validator, DeFi Market Maker, Medicine Protocol, Neural Architecture, Quantum Optimiser, Research Assistant, Space Mission, and Vulnerability Detection.
- Updated `mint.json` to include new examples, improving the breadth of use cases available for users.
- Enhanced the `examples.mdx` file to provide links and descriptions for the newly added examples, facilitating easier navigation and understanding of the capabilities of PraisonAI.

These changes significantly expand the documentation and practical examples available to users, showcasing the versatility of the PraisonAI framework in various domains.
2025-01-17 10:33:58 +00:00
Mervin Praison 2a51644773 Merge pull request #303 from MervinPraison/develop
Refactor documentation and enhance quickstart guide for PraisonAI
2025-01-16 11:45:30 +00:00
MervinPraison cce908fa22 Refactor documentation and enhance quickstart guide for PraisonAI
- Removed unnecessary note from the introduction section of `introduction.mdx` for improved clarity.
- Updated the `quickstart.mdx` to provide a more comprehensive and user-friendly guide, including detailed steps for both code and no-code approaches to creating AI agents.
- Enhanced the `knowledge.mdx` file by renaming the vector store from "Chroma" to "Vector DB" for better clarity in terminology.
- Added prerequisites and tips to the quickstart guide to assist users in setting up their environment effectively.

These changes improve the overall usability and clarity of the documentation, making it easier for users to get started with PraisonAI.
2025-01-16 11:45:01 +00:00
Mervin Praison acf476f715 Merge pull request #302 from MervinPraison/develop
Develop
2025-01-16 11:13:41 +00:00
MervinPraison e5d77de79c Update PraisonAI to version 2.0.48 and enhance dependencies
- Bumped PraisonAI version from 2.0.47 to 2.0.48 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.38` to `0.0.39` across relevant files for improved functionality.
- Modified deployment scripts to ensure compatibility with the updated package version.
- Removed outdated references in documentation and improved clarity in agent-related concepts.

These changes enhance the overall functionality and usability of the PraisonAI framework, particularly in dependency management and deployment processes.
2025-01-16 11:13:22 +00:00
MervinPraison 9ab444b54c Update knowledge agent configuration and versioning
- Changed the knowledge source in `knowledge-agents.py` from `small.pdf` to `large.pdf` to utilize a more comprehensive dataset.
- Bumped the package version in `pyproject.toml` and `uv.lock` from `0.0.38` to `0.0.39` to reflect recent updates.
- Enhanced the `Knowledge` class in `knowledge.py` by adding a progress display for memory storage operations, improving user experience during knowledge updates.

These changes improve the functionality and usability of the knowledge management system within the PraisonAI framework.
2025-01-16 10:14:11 +00:00
Mervin Praison e13f543c6d Merge pull request #301 from MervinPraison/develop
v0.0.38
2025-01-16 08:27:58 +00:00
MervinPraison 4f235d358c Update PraisonAI to version 2.0.47 and enhance knowledge management features
- Bumped PraisonAI version from 2.0.46 to 2.0.47 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Enhanced the knowledge management system by adding a new `knowledge.mdx` file and related examples for creating knowledge-based agents.
- Updated documentation to include new concepts and improve clarity on knowledge management functionalities.
- Refactored deployment scripts to ensure compatibility with the updated package version.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in knowledge management and deployment processes.
2025-01-16 08:27:33 +00:00
MervinPraison b7847feb1e Update package version and enhance logging in Knowledge class
- Bumped the package version in `pyproject.toml` and `uv.lock` from `0.0.37` to `0.0.38` to reflect recent changes.
- Modified the `Knowledge` class in `knowledge.py` to include a `verbose` parameter for improved logging control.
- Implemented an internal logging helper method to streamline log messages and manage logging levels based on the `verbose` setting.
- Updated various logging statements to utilize the new logging helper, enhancing clarity and consistency in log outputs.

These changes improve the maintainability and usability of the knowledge management system by providing better logging capabilities.
2025-01-16 08:14:21 +00:00
MervinPraison 7ac730462c Update knowledge agent configuration and enhance memory management
- Changed the knowledge source in `knowledge-agents.py` from `large.pdf` to `small.pdf` for improved testing consistency.
- Bumped the package version in `pyproject.toml` from `0.0.36` to `0.0.37` to reflect recent changes.
- Updated the `chromadb` dependency version in `pyproject.toml` to `0.5.23` for compatibility.
- Enhanced the `CustomMemory` class in `knowledge.py` to allow dynamic memory management without relying on LLM, improving performance and flexibility.
- Introduced cached properties in the `Knowledge` class for better configuration handling and memory management.

These changes improve the knowledge agent's functionality and ensure better performance in memory operations.
2025-01-16 08:07:08 +00:00
MervinPraison 9cbc8d082d Add chunking functionality and update knowledge management features
Knowledge working without lazy loading

- Introduced a new `chunking-direct-test.py` file to demonstrate the usage of the `Chunking` class for text chunking with various strategies.
- Updated `knowledge-agents.py` to change the knowledge source from `2409.13731v3.pdf` to `large.pdf` and modified the agent's query for clarity.
- Revised `knowledge-direct-test.py` to replace the reference to `sample.pdf` with `small.pdf`, ensuring consistency in test file usage.
- Added `knowledge-large-pdf-test.py` to test the handling of large PDF files, integrating logging for better traceability.
- Updated `pyproject.toml` to include the new `chonkie` dependency for chunking functionalities.
- Removed the deprecated `sample.pdf` and added `small.pdf` to the agents directory for testing purposes.
- Enhanced the `Knowledge` class in `knowledge.py` to utilize the new `Chunking` class for improved memory management and content processing.

These changes enhance the knowledge management system's capabilities by integrating chunking strategies and improving file handling processes.
2025-01-16 07:56:32 +00:00
MervinPraison 7fb0aed7ac Refactor memory handling in knowledge-direct-test.py and knowledge.py
- Updated memory retrieval, updating, and deletion methods in `knowledge-direct-test.py` to correctly access memory IDs from the new results structure.
- Enhanced logging to provide clearer information about memory operations, including warnings for unexpected memory formats.
- Modified the `Knowledge` class in `knowledge.py` to ensure all memory results are returned in a consistent format, improving the handling of stored memories.
- Improved error handling and added checks for valid memory formats when verifying stored content from text and PDF files.

These changes enhance the robustness and clarity of memory management within the knowledge management system.
2025-01-16 06:24:15 +00:00
MervinPraison 206f0d01e7 Add new knowledge management features and files
- Introduced a new `knowledge-agents-task.py` script to define and execute tasks for knowledge agents, enhancing the framework's capabilities for knowledge retrieval and management.
- Added `knowledge-agents.py` to create a knowledge agent with specific instructions and knowledge sources, allowing for more tailored interactions.
- Implemented `knowledge-direct-test.py` for testing memory storage and retrieval functionalities, showcasing the new capabilities of the knowledge management system.
- Created `md.py` for handling Markdown file conversions, integrating with the knowledge management features.
- Updated `pyproject.toml` to specify the exact version of the `chromadb` dependency, ensuring compatibility with the new features.
- Added new PDF and DOCX files to the agents directory for testing and demonstration purposes.
- Enhanced the `Knowledge` class in `knowledge.py` to support user and agent identifiers, improving memory management and retrieval processes.

This commit significantly expands the knowledge management functionalities within the PraisonAI framework, providing new tools and scripts for better handling of knowledge content.
2025-01-16 05:36:08 +00:00
MervinPraison e19a310314 Update dependencies and enhance knowledge management system
- Updated the `chainlit` dependency version from `2.0.1` to `2.0.3` across multiple configurations in `pyproject.toml` and `agents/pyproject.toml` to ensure compatibility with the latest features and fixes.
- Introduced a new optional dependency group `knowledge` in `agents/pyproject.toml` for enhanced knowledge management capabilities, including `mem0ai` and `markitdown`.
- Refactored the `Knowledge` class in `knowledge.py` to improve initialization and memory management, allowing for better handling of user and agent identifiers.
- Enhanced methods for storing, retrieving, and managing memories, including new functionalities for updating and deleting memories.
- Updated UI components in `mint.json` and `realtime.py` to reflect changes in model naming conventions, improving user experience and clarity.

This commit strengthens the overall functionality and usability of the PraisonAI framework, particularly in knowledge management and UI interactions.
2025-01-15 17:00:15 +00:00
MervinPraison 1ea572689e Refactor Knowledge Management System in knowledge.py
- Overhauled the `Knowledge` class to enhance the knowledge management system, introducing a more flexible initialization with user and agent identifiers, and improved configuration options.
- Streamlined methods for adding, searching, and deleting knowledge, integrating a new memory management system for better performance and organization.
- Updated vector store and embedding configurations to support a wider range of providers and models, including options for graph capabilities.
- Enhanced error handling and debugging features for improved troubleshooting.
- Removed deprecated methods and optimized existing functionality for clarity and efficiency.

This commit significantly improves the structure and capabilities of the knowledge management system within the PraisonAI framework, facilitating better content handling and retrieval.
2025-01-15 06:52:26 +00:00
MervinPraison 96df649b05 Add Knowledge Management System in knowledge.py
- Introduced a new `Knowledge` class for managing knowledge content, including methods for adding, updating, searching, and deleting knowledge.
- Implemented support for various vector store types (Chroma, Pinecone, PGVector, Qdrant, Milvus) for storing embeddings.
- Added functionality for chunking text, generating embeddings using different models (OpenAI, Cohere, SentenceTransformers, HuggingFace), and optional encryption of content.
- Enhanced caching mechanism for search results to improve performance.
- Included comprehensive error handling and debug mode for better troubleshooting.

This commit establishes a robust framework for knowledge management within the PraisonAI agents, enhancing the system's capabilities for handling and retrieving information efficiently.
2025-01-15 06:18:33 +00:00
Mervin Praison 5aed75837a Merge pull request #300 from MervinPraison/develop
Refactor UI documentation and update navigation structure
2025-01-15 05:18:38 +00:00
MervinPraison 9c8f68a05f Refactor UI documentation and update navigation structure
- Renamed and reorganized the UI documentation in `ui.mdx`, changing the title and sidebar title for clarity.
- Updated the installation instructions to provide a more streamlined setup process.
- Removed the previous table of available interfaces and replaced it with a concise description of features.
- Adjusted the `mint.json` file to reflect the new UI documentation structure, enhancing navigation for users.

This commit improves the clarity and accessibility of the user interface documentation, making it easier for users to understand and utilize the PraisonAI framework.
2025-01-15 05:18:07 +00:00
Mervin Praison 9778a69c4d Merge pull request #299 from MervinPraison/develop
Remove deprecated use case documentation and update navigation structure
2025-01-14 17:12:40 +00:00
MervinPraison 73c7994380 Remove deprecated use case documentation and update navigation structure
- Deleted multiple use case files including "Examples," "Adaptive Learning," "Code Review," "Customer Service," "Emergency Response," "Fraud Detection," "Healthcare Diagnosis," "Multilingual Content," "Predictive Maintenance," "Smart City," and "Supply Chain" to streamline documentation.
- Updated `mint.json` to replace "Use Cases" with "Examples" in the navigation, enhancing clarity and organization.
- Adjusted navigation groups to reflect the new structure, ensuring users can easily find relevant information.

This commit focuses on cleaning up outdated documentation and improving the overall user experience by refining the navigation structure.
2025-01-14 17:12:26 +00:00
Mervin Praison 82b83ded41 Merge pull request #298 from MervinPraison/develop
Update PraisonAI and praisonaiagents to versions 2.0.46 and 0.0.36 re…
2025-01-14 13:47:58 +00:00
MervinPraison fc80db32c2 Update PraisonAI and praisonaiagents to versions 2.0.46 and 0.0.36 respectively
- Bumped the PraisonAI package version from 2.0.45 to 2.0.46 in Dockerfile, pyproject.toml, and related files.
- Updated the installation command in Dockerfile and deployment scripts to reflect the new version.
- Updated the praisonaiagents package version from 0.0.35 to 0.0.36 in relevant files.
- Introduced new agents for data analysis, finance, image processing, and more, enhancing the framework's capabilities.
- Added new example scripts demonstrating the usage of the newly created agents.
- Updated documentation to include new agents and their functionalities, improving user guidance and accessibility.

This commit enhances the overall functionality of the PraisonAI framework while ensuring that all components are up-to-date.
2025-01-14 13:46:43 +00:00
Mervin Praison 3f115ca7ba Merge pull request #297 from MervinPraison/develop
Refactor multimodal agent execution and enhance documentation structure
2025-01-14 09:48:14 +00:00
MervinPraison a32d45e6da Refactor multimodal agent execution and enhance documentation structure
- Simplified the execution of the multimodal agent by removing unnecessary result printing, allowing for a cleaner start method call.
- Updated `mint.json` to include new tabs for "Documentation" and "Use Cases," improving navigation and accessibility of relevant information.
- Added a new "Usecases" group in the navigation section of `mint.json`, detailing various use cases for better user guidance.

This commit streamlines the multimodal agent's functionality and enhances the documentation for improved user experience.
2025-01-14 09:47:50 +00:00
Mervin Praison 8823df26ff Merge pull request #294 from MervinPraison/develop
Add EXASearchTool class and integrate with AI agents
2025-01-13 13:20:26 +00:00
MervinPraison 9c2126fbd6 Add EXASearchTool class and integrate with AI agents
- Introduced a new `EXASearchTool` class to interact with the EXA Search API, allowing AI agents to perform searches and retrieve results.
- Implemented methods for running queries and parsing results into a readable format.
- Created a `SearchAgent` to utilize the `EXASearchTool` for searching information about the 'AI Agents Framework'.
- Added a task definition for the `SearchAgent` to demonstrate the tool's functionality.
- Updated documentation to include the new `tools_class` and provide a comprehensive guide on using class-based tools with AI agents.
2025-01-13 13:20:00 +00:00
Mervin Praison 741b01bdf0 Merge pull request #293 from MervinPraison/develop
Refactor autonomous agent workflow and enhance documentation
2025-01-13 12:25:56 +00:00
MervinPraison 6ed9a69cd8 Refactor autonomous agent workflow and enhance documentation
- Renamed and refactored functions in `autonomous-agent.py` to improve clarity and functionality, including changing `get_environment_feedback` to `get_environment_state`.
- Introduced new agents: `Environment Monitor`, `Action Executor`, and `Feedback Processor` to better structure the workflow.
- Updated task definitions to create a more coherent feedback loop and action execution process.
- Added a `main` function to encapsulate the workflow execution and result printing.
- Updated `mint.json` to include a new "Workflows" group for better organization of documentation.
- Removed the outdated `agenticrouting.mdx` documentation file to streamline content.

This commit enhances the overall structure and readability of the autonomous agent system while improving documentation organization.
2025-01-13 12:24:51 +00:00
Mervin Praison 56a42e6d95 Merge pull request #292 from MervinPraison/develop
Update PraisonAI and praisonaiagents to version 2.0.45 and 0.0.35 res…
2025-01-13 11:49:53 +00:00
MervinPraison d2b4affdd1 Update PraisonAI and praisonaiagents to version 2.0.45 and 0.0.35 respectively
- Bumped the PraisonAI package version from 2.0.44 to 2.0.45 in Dockerfile, pyproject.toml, and related files.
- Updated the installation command in Dockerfile and deployment scripts to reflect the new version.
- Updated the praisonaiagents package version from 0.0.34 to 0.0.35 in relevant files.
- Introduced new evaluator-optimiser and parallelisation features with corresponding agent and task implementations.
- Added documentation for the evaluator-optimiser feature and updated existing documentation for parallelisation.
- Adjusted dependencies in uv.lock for compatibility with the new versions.
2025-01-13 11:49:32 +00:00
Mervin Praison 0d5c8b478f Merge pull request #291 from MervinPraison/develop
Add parallelisation feature and update documentation
2025-01-13 07:52:07 +00:00
MervinPraison fdfad70319 Update PraisonAI and praisonaiagents to version 2.0.44 and 0.0.34 respectively
- Bumped the PraisonAI package version from 2.0.43 to 2.0.44 in Dockerfile, pyproject.toml, and related files.
- Updated the installation command in Dockerfile and deployment scripts to reflect the new version.
- Updated the praisonaiagents package version from 0.0.33 to 0.0.34 in relevant files.
- Adjusted dependencies in uv.lock for compatibility with the new versions.
- Refactored agent definitions in parallelization scripts to remove unnecessary verbosity parameters for cleaner code.
2025-01-13 07:51:14 +00:00
MervinPraison fba6b2e2a0 Add parallelisation feature and update documentation
- Introduced a new `parallelisation.py` file to implement parallel processing using AI agents, allowing concurrent execution of tasks for improved performance.
- Created multiple agents and tasks to demonstrate parallel execution and result aggregation.
- Added a new documentation file `parallelisation.mdx` detailing the setup, usage, and benefits of the parallelisation feature.
- Updated `mint.json` to include the new parallelisation feature for better tracking and visibility.
2025-01-13 07:38:24 +00:00
Mervin Praison f9bfb85f44 Merge pull request #290 from MervinPraison/develop
2.0.43
2025-01-13 07:33:48 +00:00
MervinPraison aab4b5b466 Update PraisonAI to version 2.0.43 and praisonaiagents to version 0.0.33
- Bumped the PraisonAI package version from 2.0.42 to 2.0.43 in Dockerfile, pyproject.toml, and related files.
- Updated the installation command in Dockerfile and deployment scripts to reflect the new version.
- Updated the praisonaiagents package version from 0.0.32 to 0.0.33 in relevant files.
- Modified task descriptions in evaluator-optimizer.py to enhance clarity and functionality.
- Adjusted documentation to ensure consistency with the new version.
- Updated dependencies in uv.lock for compatibility with the new versions.
2025-01-13 07:33:15 +00:00
MervinPraison 7ccadde004 Update praisonaiagents to version 0.0.33 and enhance agent functionality
- Bumped the version of the praisonaiagents package from 0.0.32 to 0.0.33 in pyproject.toml and related files.
- Improved tool availability handling by ensuring tools from both tasks and agents are combined for better execution.
- Enhanced parallel task execution logic to efficiently manage asynchronous tasks within workflows.
- Updated callback execution to handle running event loops more gracefully, improving overall stability and error handling.
- Adjusted dependencies in uv.lock for compatibility with the new version.
2025-01-13 06:36:27 +00:00
Mervin Praison 22a9d5ff23 Merge pull request #287 from MervinPraison/develop
Refactor prompt chaining and update JSON configuration
2025-01-12 07:03:55 +00:00
MervinPraison 98a11209ea Refactor prompt chaining and update JSON configuration
- Simplified import statements in agents/prompt_chaining.py for better readability.
- Updated the condition handling in the initial_task to specify "exit" for odd conditions, clarifying task flow.
- Added "features/promptchaining" to the mint.json configuration, enhancing feature tracking for prompt chaining capabilities.
2025-01-12 07:03:32 +00:00
Mervin Praison df3c97e73a Merge pull request #286 from MervinPraison/develop
Update PraisonAI to version 2.0.42 and praisonaiagents to version 0.0.32
2025-01-12 06:40:44 +00:00
MervinPraison 27808964be Update PraisonAI to version 2.0.42 and praisonaiagents to version 0.0.32
- Updated the PraisonAI package version from 2.0.41 to 2.0.42 in Dockerfile, pyproject.toml, and related files.
- Adjusted installation command in Dockerfile and deploy scripts to reflect the new version.
- Updated the praisonaiagents package version from 0.0.31 to 0.0.32 in relevant files.
- Enhanced the prompt chaining implementation in agents/prompt_chaining.py for improved task management and workflow execution.
- Added new documentation on agentic prompt chaining to guide users in creating complex workflows.
- Updated dependencies in uv.lock for compatibility with the new versions.
2025-01-12 06:40:29 +00:00
Mervin Praison b5daf16e0d Merge pull request #285 from MervinPraison/develop
adding docs
2025-01-11 17:13:14 +00:00
MervinPraison a2cac05d16 adding docs 2025-01-11 17:12:56 +00:00
Mervin Praison ad9828d3bb Merge pull request #284 from MervinPraison/develop
Update PraisonAI to version 2.0.41 and enhance documentation
2025-01-11 16:13:02 +00:00
MervinPraison 85ddf04b47 Update PraisonAI to version 2.0.41 and enhance documentation
- Updated PraisonAI package version from 2.0.40 to 2.0.41 in Dockerfile, pyproject.toml, and related files.
- Adjusted installation command in Dockerfile and deploy scripts to reflect the new version.
- Improved logging in agents_generator.py to handle missing tools.py file gracefully.
- Updated deployment documentation to ensure consistency with the new version.
- Adjusted dependencies in uv.lock for compatibility with the updated PraisonAI version.
2025-01-11 16:12:41 +00:00
Mervin Praison 1c1a1b719b Merge pull request #283 from MervinPraison/develop
Update PraisonAI to version 2.0.40 and enhance logging
2025-01-11 16:02:16 +00:00
MervinPraison a8e0914e05 Update PraisonAI to version 2.0.40 and enhance logging
- Updated the PraisonAI package version from 2.0.39 to 2.0.40 in Dockerfile, pyproject.toml, and related files.
- Added a new memory configuration option in agents.yaml to control memory usage.
- Improved logging throughout the codebase by changing info logs to debug logs for better traceability.
- Updated .gitignore to include new files for better project management.
- Adjusted dependencies in pyproject.toml and uv.lock for compatibility with the new version.
2025-01-11 16:01:54 +00:00
Mervin Praison ec6d883f4f Merge pull request #282 from MervinPraison/develop
adding langchain agent doc
2025-01-11 08:21:48 +00:00
MervinPraison d094cbfac5 adding langchain agent doc 2025-01-11 08:21:25 +00:00
Mervin Praison 14e3724aed Merge pull request #281 from MervinPraison/develop
Update praisonaiagents to version 0.0.31 and enhance agent functionality
2025-01-11 07:51:59 +00:00
MervinPraison 92436277d9 Update praisonaiagents to version 0.0.31 and enhance agent functionality
- Updated the version of the praisonaiagents package from 0.0.30 to 0.0.31 in pyproject.toml and related files.
- Added a new Fact Agent to store and retrieve facts, improving the overall functionality of the agent system.
- Enhanced the Research Agent with multiple tasks focused on AI topics, including healthcare and education.
- Updated display functions to include agent information in the output, improving clarity during interactions.
- Improved logging for agent processing and responses, aiding in debugging and tracking agent activities.
- Adjusted dependencies in pyproject.toml and uv.lock for compatibility with the new version.
2025-01-11 07:51:05 +00:00
Mervin Praison 3e0fd298e2 Merge pull request #280 from MervinPraison/develop
AI Agents with memory
2025-01-10 17:21:44 +00:00
MervinPraison fad0b41b52 Update PraisonAI to version 2.0.38 and enhance memory management
- Updated PraisonAI package version from 2.0.37 to 2.0.38 in Dockerfile, pyproject.toml, and related files.
- Refactored memory handling in memory_example.py to improve database path management and logging.
- Introduced new memory management features in the PraisonAIAgents class, allowing for better context retention across tasks.
- Enhanced logging throughout the codebase for improved debugging and tracking of memory operations.
- Added comprehensive documentation on memory capabilities, including short-term and long-term memory management.
- Updated dependencies in pyproject.toml and uv.lock for compatibility with the new version.
2025-01-10 17:20:54 +00:00
MervinPraison 6c3e5ee187 Agents(memory=True) working
Refactor memory management and enhance agent initialization

- Removed direct memory initialization from memory_example.py and integrated shared memory handling into PraisonAIAgents class.
- Updated PraisonAIAgents constructor to accept a memory flag, initializing shared memory if enabled.
- Assigned shared memory to tasks dynamically, improving data sharing between agents.
- Enhanced logging for memory initialization and task assignment to facilitate debugging.
2025-01-10 06:11:35 +00:00
MervinPraison f842ee7048 Update chainlit dependency to version 2.0.1 and improve tool registration in realtime.py
- Updated chainlit version from 1.3.2 to 2.0.1 in pyproject.toml and uv.lock.
- Enhanced tool registration logic in realtime.py to ensure only valid tools are added, with improved error handling and logging for invalid tool definitions.
- Refactored custom tools processing to support both formatted and unformatted tool definitions.
2025-01-10 06:01:47 +00:00
MervinPraison b0ff6f3f60 Update .gitignore and add new ignore files; enhance memory_example.py and memory.py functionality
- Updated .gitignore to include chroma_db/ directory.
- Added .praisoncontext and .praisonignore files for better project structure.
- Refactored memory_example.py to improve memory retrieval and logging.
- Enhanced memory.py to handle exceptions during ChromaDB collection initialization and updated embedding model to 'text-embedding-3-small'.
- Improved logging for embedding operations and ensured API key is set correctly.
2025-01-10 05:40:32 +00:00
MervinPraison 798f6dad14 Refactor memory handling and enhance task execution flow
- Improved memory initialization and management in memory_example.py and Task class.
- Integrated shared memory for tasks to facilitate data sharing between agents.
- Enhanced error handling and logging for memory operations in the Memory class.
- Updated task execution to include memory context and quality metrics.
- Added new task for querying both short-term and long-term memory.
- Improved overall structure and clarity of code with better logging practices.
2025-01-09 10:24:53 +00:00
MervinPraison 629bf0d669 Refactor memory management and enhance search functionality
- Removed unused imports and improved logging in memory_example.py.
- Updated Task description and expected output for clarity.
- Enhanced Memory class to support OpenAI embeddings for improved search capabilities.
- Added quality and relevance filtering in search_short_term and search_long_term methods.
- Implemented deletion of existing ChromaDB collection before creating a new one.
- Improved error handling and logging for database operations.
2025-01-09 06:44:25 +00:00
MervinPraison eaca447b82 Enhance code structure and documentation:
- Updated cursor rules for minimal code changes and user-friendly function naming.
- Integrated Memory module into the PraisonAIAgents initialization.
- Modified Agent class parameters for improved flexibility and default values.
- Enhanced Task class with memory and quality check features, including logging for quality metrics during execution.
2025-01-09 06:23:00 +00:00
Mervin Praison bef3693627 Merge pull request #278 from MervinPraison/develop
updating docs
2025-01-08 16:43:47 +00:00
MervinPraison aa62babed6 updating docs 2025-01-08 16:43:30 +00:00
Mervin Praison b73f181200 Merge pull request #277 from MervinPraison/develop
Updating Docs
2025-01-08 13:42:39 +00:00
MervinPraison 66d2998047 Updating Docs 2025-01-08 13:42:00 +00:00
Mervin Praison c5b6f8b91a Merge pull request #276 from MervinPraison/develop
adding autoagents
2025-01-08 06:47:17 +00:00
MervinPraison 823e46ca84 adding autoagents 2025-01-08 06:47:02 +00:00
Mervin Praison 57040333a7 Merge pull request #275 from MervinPraison/develop
Develop
2025-01-07 18:19:17 +00:00
MervinPraison 8c6800f876 adding langchain with uv 2025-01-07 18:18:46 +00:00
MervinPraison 0d701ae43c adding langchain 2025-01-07 14:15:32 +00:00
Mervin Praison 7a8c25621c Merge pull request #273 from MervinPraison/develop
fixing internet search tool
2025-01-07 06:55:38 +00:00
MervinPraison 218c5443b1 fixing internet search tool 2025-01-07 06:55:17 +00:00
Mervin Praison f56810341c Merge pull request #272 from MervinPraison/develop
updating docs
2025-01-07 06:09:35 +00:00
MervinPraison 4f601a573f updating docs 2025-01-07 06:09:14 +00:00
Mervin Praison 43c03f4813 Merge pull request #271 from MervinPraison/develop
fixing tools
2025-01-07 05:46:04 +00:00
MervinPraison 03856b74bf fixing tools 2025-01-07 05:45:42 +00:00
Mervin Praison eadfc0cff0 Merge pull request #270 from MervinPraison/develop
adding tools
2025-01-07 04:54:36 +00:00
MervinPraison f33c44d4c5 adding tools 2025-01-07 04:54:05 +00:00
Mervin Praison 3f7885289d Merge pull request #269 from MervinPraison/develop
adding mini docs
2025-01-07 00:55:43 +00:00
MervinPraison 833c795e9a adding mini docs 2025-01-07 00:55:29 +00:00
Mervin Praison c460c9da60 Merge pull request #268 from MervinPraison/develop
adding structured agents and code agents
2025-01-06 18:38:51 +00:00
MervinPraison 656887c700 adding structured agents and code agents 2025-01-06 18:26:56 +00:00
3612 changed files with 744449 additions and 36339 deletions

No files matched your search

-1885
View File
File diff suppressed because it is too large. Load diff
-10
View File
@@ -1,10 +0,0 @@
{
"extends": ["plugin:mdx/recommended"],
// optional, if you want to lint code blocks at the same time
"settings": {
"mdx/code-blocks": true,
// optional, if you want to disable language mapper, set it to `false`
// if you want to override the default language mapper inside, you can provide your own
"mdx/language-mapper": {}
}
}
+34
View File
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---
## Environment
- Provider (select one):
- [ ] Anthropic
- [ ] OpenAI
- [ ] Google Vertex AI
- [ ] AWS Bedrock
- [ ] Other: <!-- specify -->
- PraisonAI version: <!-- if known -->
- Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
## Full Code
<!-- Full code that reproduces the bug -->
## Steps to Reproduce
1. <!-- First step -->
2. <!-- Second step -->
3. <!-- And so on... -->
## Expected Behavior
<!-- What you expected to happen -->
## Actual Behavior
<!-- What actually happened -->
## Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
@@ -0,0 +1,256 @@
name: "Claude Code Action"
description: "Run Claude Code in GitHub Actions workflows"
inputs:
anthropic_api_key:
description: "Anthropic API key"
required: false
github_token:
description: "GitHub token for Claude to operate with"
required: false
default: ${{ github.token }}
trigger_phrase:
description: "The trigger phrase to look for in comments, issue/PR bodies, and issue titles"
required: false
default: "@claude"
assignee_trigger:
description: "The assignee username that triggers the action (e.g. @claude). Only used for issue assignment"
required: false
max_turns:
description: "Maximum number of conversation turns Claude can take"
required: false
timeout_minutes:
description: "Timeout in minutes for execution"
required: false
default: "30"
model:
description: "Model to use (provider-specific format required for Bedrock/Vertex)"
required: false
use_bedrock:
description: "Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API"
required: false
default: "false"
use_vertex:
description: "Use Google Vertex AI with OIDC authentication instead of direct Anthropic API"
required: false
default: "false"
allowed_tools:
description: "Additional tools for Claude to use (the base GitHub tools will always be included)"
required: false
default: ""
disallowed_tools:
description: "Tools that Claude should never use"
required: false
default: ""
custom_instructions:
description: "Additional custom instructions to include in the prompt for Claude"
required: false
default: ""
mcp_config:
description: "Additional MCP configuration (JSON string) that merges with the built-in GitHub MCP servers"
required: false
default: ""
claude_env:
description: "Custom environment variables to pass to Claude Code execution (YAML format)"
required: false
default: ""
direct_prompt:
description: "Direct prompt for Claude to execute automatically without needing a trigger (for automated workflows)"
required: false
runs:
using: "composite"
steps:
- name: Install Claude Code
shell: bash
run: npm install -g @anthropic-ai/claude-code
- name: Install GitHub MCP Server
shell: bash
run: |
claude mcp add-json github '{
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server:sha-ff3036d"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ inputs.github_token }}"
}
}'
- name: Extract GitHub Context and Create Prompt
shell: bash
id: prepare_context
env:
# Pass user-controlled inputs via environment variables to prevent script injection (GHSL-2025-093)
EVENT_COMMENT_BODY: ${{ github.event.comment.body }}
EVENT_ISSUE_TITLE: ${{ github.event.issue.title }}
EVENT_ISSUE_BODY: ${{ github.event.issue.body }}
EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
EVENT_PR_TITLE: ${{ github.event.pull_request.title }}
EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}
EVENT_REVIEW_BODY: ${{ github.event.review.body }}
EVENT_ASSIGNEE_LOGIN: ${{ github.event.assignee.login }}
INPUT_TRIGGER_PHRASE: ${{ inputs.trigger_phrase }}
INPUT_ASSIGNEE_TRIGGER: ${{ inputs.assignee_trigger }}
INPUT_DIRECT_PROMPT: ${{ inputs.direct_prompt }}
EVENT_ACTION: ${{ github.event.action }}
EVENT_NAME: ${{ github.event_name }}
REPO_NAME: ${{ github.repository }}
run: |
echo "🔍 Extracting GitHub context from event: $EVENT_NAME"
# Function to check for trigger phrase
check_trigger() {
local text="$1"
local trigger="$INPUT_TRIGGER_PHRASE"
if [[ "$text" == *"$trigger"* ]]; then
return 0
fi
return 1
}
# Extract context based on event type
TRIGGER_FOUND="false"
USER_REQUEST=""
CONTEXT_INFO=""
case "$EVENT_NAME" in
"issue_comment")
COMMENT_BODY="$EVENT_COMMENT_BODY"
ISSUE_TITLE="$EVENT_ISSUE_TITLE"
ISSUE_NUMBER="$EVENT_ISSUE_NUMBER"
if check_trigger "$COMMENT_BODY"; then
TRIGGER_FOUND="true"
USER_REQUEST="$COMMENT_BODY"
CONTEXT_INFO="Issue Comment on #$ISSUE_NUMBER: $ISSUE_TITLE"
fi
;;
"pull_request_review_comment")
COMMENT_BODY="$EVENT_COMMENT_BODY"
PR_TITLE="$EVENT_PR_TITLE"
PR_NUMBER="$EVENT_PR_NUMBER"
if check_trigger "$COMMENT_BODY"; then
TRIGGER_FOUND="true"
USER_REQUEST="$COMMENT_BODY"
CONTEXT_INFO="PR Comment on #$PR_NUMBER: $PR_TITLE"
fi
;;
"pull_request_review")
REVIEW_BODY="$EVENT_REVIEW_BODY"
PR_TITLE="$EVENT_PR_TITLE"
PR_NUMBER="$EVENT_PR_NUMBER"
if check_trigger "$REVIEW_BODY"; then
TRIGGER_FOUND="true"
USER_REQUEST="$REVIEW_BODY"
CONTEXT_INFO="PR Review on #$PR_NUMBER: $PR_TITLE"
fi
;;
"issues")
ISSUE_BODY="$EVENT_ISSUE_BODY"
ISSUE_TITLE="$EVENT_ISSUE_TITLE"
ISSUE_NUMBER="$EVENT_ISSUE_NUMBER"
if check_trigger "$ISSUE_TITLE" || check_trigger "$ISSUE_BODY"; then
TRIGGER_FOUND="true"
USER_REQUEST="$ISSUE_BODY"
CONTEXT_INFO="Issue #$ISSUE_NUMBER: $ISSUE_TITLE"
elif [[ "$EVENT_ACTION" == "assigned" && -n "$INPUT_ASSIGNEE_TRIGGER" ]]; then
ASSIGNEE="$EVENT_ASSIGNEE_LOGIN"
if [[ "$ASSIGNEE" == "$INPUT_ASSIGNEE_TRIGGER" ]]; then
TRIGGER_FOUND="true"
USER_REQUEST="$ISSUE_BODY"
CONTEXT_INFO="Issue #$ISSUE_NUMBER assigned to $ASSIGNEE: $ISSUE_TITLE"
fi
fi
;;
esac
# Check for direct prompt override
if [[ -n "$INPUT_DIRECT_PROMPT" ]]; then
TRIGGER_FOUND="true"
USER_REQUEST="$INPUT_DIRECT_PROMPT"
CONTEXT_INFO="Automated GitHub workflow"
fi
if [[ "$TRIGGER_FOUND" != "true" ]]; then
echo "❌ No trigger phrase found or direct prompt provided. Exiting gracefully."
echo "SKIP_EXECUTION=true" >> $GITHUB_ENV
exit 0
fi
echo "✅ Trigger found! Context: $CONTEXT_INFO"
# Create comprehensive prompt
mkdir -p /tmp/claude-action
cat > /tmp/claude-action/github-context-prompt.txt << EOF
You are Claude Code, an AI assistant helping with GitHub workflows and code.
Repository: $REPO_NAME
Context: $CONTEXT_INFO
Event: $EVENT_NAME
User Request:
$USER_REQUEST
Please analyze the request and provide helpful assistance. You have access to repository tools and can help with:
- Code analysis and implementation
- GitHub workflows and automation
- Pull request reviews and feedback
- Issue resolution and bug fixes
- Documentation updates
- Testing and deployment
Respond naturally and helpfully to the user's request using the available tools.
EOF
echo "PROMPT_FILE=/tmp/claude-action/github-context-prompt.txt" >> $GITHUB_ENV
echo "SKIP_EXECUTION=false" >> $GITHUB_ENV
- name: Run Claude Code
if: env.SKIP_EXECUTION != 'true'
shell: bash
run: |
echo "🚀 Running Claude Code with GitHub context..."
# Build command arguments
CMD_ARGS=("-p" "--verbose" "--output-format" "stream-json")
# Add max turns if specified
if [[ -n "${{ inputs.max_turns }}" ]]; then
CMD_ARGS+=("--max-turns" "${{ inputs.max_turns }}")
fi
# Add allowed tools (include GitHub tools by default)
TOOLS="mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues,mcp__github__create_comment,Read,Write,Edit,Bash"
if [[ -n "${{ inputs.allowed_tools }}" ]]; then
TOOLS="$TOOLS,${{ inputs.allowed_tools }}"
fi
CMD_ARGS+=("--allowedTools" "$TOOLS")
# Add disallowed tools
if [[ -n "${{ inputs.disallowed_tools }}" ]]; then
CMD_ARGS+=("--disallowedTools" "${{ inputs.disallowed_tools }}")
fi
echo "📝 Executing Claude Code with prompt from file..."
# Execute Claude Code with timeout, using stdin for the prompt
TIMEOUT_SECONDS=$((${{ inputs.timeout_minutes }} * 60))
timeout $TIMEOUT_SECONDS claude "${CMD_ARGS[@]}" < "${{ env.PROMPT_FILE }}"
echo "✅ Claude Code execution completed"
env:
ANTHROPIC_API_KEY: ${{ inputs.anthropic_api_key }}
GITHUB_TOKEN: ${{ inputs.github_token }}
@@ -0,0 +1,87 @@
name: "Claude Issue Triage Action"
description: "Automatically triage GitHub issues using Claude Code"
inputs:
timeout_minutes:
description: "Timeout in minutes for execution"
required: false
default: "5"
anthropic_api_key:
description: "Anthropic API key"
required: true
github_token:
description: "GitHub token with repo and issues permissions"
required: true
runs:
using: "composite"
steps:
- name: Checkout repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create prompt file
shell: bash
run: |
mkdir -p /tmp/claude-prompts
cat > /tmp/claude-prompts/claude-issue-triage-prompt.txt << 'EOF'
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
Issue Information:
- REPO: ${{ github.repository }}
- ISSUE_NUMBER: ${{ github.event.issue.number }}
TASK OVERVIEW:
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
2. Next, use the GitHub tools to get context about the issue:
- You have access to these tools:
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
- Start by using mcp__github__get_issue to get the issue details
3. Analyze the issue content, considering:
- The issue title and description
- The type of issue (bug report, feature request, question, etc.)
- Technical areas mentioned
- Severity or priority indicators
- User impact
- Components affected
4. Select appropriate labels from the available labels list provided above:
- Choose labels that accurately reflect the issue's nature
- Be specific but comprehensive
- Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority)
- Consider platform labels (android, ios) if applicable
- If you find similar issues using mcp__github__search_issues, consider using a "duplicate" label if appropriate. Only do so if the issue is a duplicate of another OPEN issue.
5. Apply the selected labels:
- Use mcp__github__update_issue to apply your selected labels
- DO NOT post any comments explaining your decision
- DO NOT communicate directly with users
- If no labels are clearly applicable, do not apply any labels
IMPORTANT GUIDELINES:
- Be thorough in your analysis
- Only select labels from the provided list above
- DO NOT post any comments to the issue
- Your ONLY action should be to apply labels using mcp__github__update_issue
- It's okay to not add any labels if none are clearly applicable
EOF
- name: Run Claude Code
uses: ./.github/actions/claude-code-action
with:
prompt_file: /tmp/claude-prompts/claude-issue-triage-prompt.txt
allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"
install_github_mcp: "true"
timeout_minutes: ${{ inputs.timeout_minutes }}
anthropic_api_key: ${{ inputs.anthropic_api_key }}
github_token: ${{ inputs.github_token }}
+81
View File
@@ -0,0 +1,81 @@
name: 'Gemini CLI Action'
description: 'Uses the Gemini CLI to automate software development tasks.'
author: 'Gemini'
inputs:
prompt:
description: 'A specific prompt to guide Gemini.'
required: false
default: 'You are a helpful assistant.'
GEMINI_API_KEY:
description: 'Your Gemini API key.'
required: true
OTLP_GCP_WIF_PROVIDER:
description: 'The workload identity provider for GCP authentication.'
required: false
OTLP_GOOGLE_CLOUD_PROJECT:
description: 'The Google Cloud project for telemetry.'
required: false
settings_json:
description: |
A JSON string to configure the Gemini CLI. This will be written to .gemini/settings.json.
To enable observability with Google Cloud, include:
{"telemetry": {"enabled": true, "target": "gcp"}, "sandbox": false}
required: false
version:
description: |
The version of @google/gemini-cli to execute.
Can be a specific version from npm (e.g., '0.1.0', 'latest'), a branch name (e.g., 'main'), or a commit hash.
required: false
default: 'latest'
runs:
using: "composite"
steps:
- name: Configure Gemini CLI
if: inputs.settings_json != ''
run: |
mkdir -p .gemini
echo "$SETTINGS_JSON" > .gemini/settings.json
shell: bash
env:
SETTINGS_JSON: ${{ inputs.settings_json }}
- name: Authenticate to Google Cloud for Telemetry
if: inputs.OTLP_GCP_WIF_PROVIDER != ''
id: auth
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ inputs.OTLP_GOOGLE_CLOUD_PROJECT }}
workload_identity_provider: ${{ inputs.OTLP_GCP_WIF_PROVIDER }}
- name: Install Gemini CLI
id: install
run: |
if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.-]+)?(\+[a-zA-Z0-9\.-]+)?$ ]]; then
echo "Installing Gemini CLI from npm: @google/gemini-cli@${{ inputs.version }}"
npm install -g @google/gemini-cli@${{ inputs.version }}
else
echo "Installing Gemini CLI from GitHub: github:google-gemini/gemini-cli#${{ inputs.version }}"
npm install -g github:google-gemini/gemini-cli#${{ inputs.version }}
fi
echo "Verifying installation:"
if command -v gemini >/dev/null 2>&1; then
gemini --version || echo "Gemini CLI installed successfully (version command not available)"
else
echo "Error: Gemini CLI not found in PATH"
exit 1
fi
shell: bash
- name: Run Gemini CLI
run: |
gemini --yolo --prompt "$PROMPT"
shell: bash
env:
GEMINI_API_KEY: ${{ inputs.GEMINI_API_KEY }}
PROMPT: ${{ inputs.prompt }}
branding:
icon: 'terminal'
color: 'blue'
+26
View File
@@ -0,0 +1,26 @@
name: Auto Issue Comment with PR Creation
on:
issues:
types: [opened]
jobs:
add-comment:
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
pull-requests: write
actions: read
steps:
- name: Add automated comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude review this issue and do a detailed analysis and fix this if the existing code doesn\'t have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes. MAINLY IT SHOULD NOT IMPACT ON THE CURRENT SPEED OF EXECUTION of existing features, not increasing the overhead. **Please create a PR using gh tool with your changes**.'
})
+23
View File
@@ -0,0 +1,23 @@
name: Auto PR Comment
on:
pull_request:
types: [opened]
jobs:
add-comment:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add automated comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude review this pull request and do a detailed analysis and fix this if the existing code doesn\'t have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes. MAINLY IT SHOULD NOT IMPACT ON THE CURRENT SPEED OF EXECUTION of existing features, not increasing the overhead.'
})
+145
View File
@@ -0,0 +1,145 @@
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!"
+41
View File
@@ -0,0 +1,41 @@
name: Build Claude Code Image
on:
workflow_dispatch:
inputs:
version:
description: 'Image version tag'
required: true
default: 'latest'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./.github/actions/claude-code-action
push: true
platforms: linux/amd64
tags: ghcr.io/mervinpraison/praisonai-claudecode:${{ inputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
+23
View File
@@ -0,0 +1,23 @@
name: Claude Issue Triage
description: "Automatically triage GitHub issues using Claude Code"
on:
issues:
types: [opened]
jobs:
triage-issue:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Run Claude Issue Triage
uses: ./.github/actions/claude-issue-triage-action
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
+21
View File
@@ -0,0 +1,21 @@
name: Claude OAuth
on:
workflow_dispatch:
inputs:
code:
description: 'Authorization code (leave empty for step 1)'
required: false
permissions:
actions: write # Required for cache management
contents: read # Required for basic repository access
jobs:
auth:
runs-on: ubuntu-latest
steps:
- uses: grll/claude-code-login@v1
with:
code: ${{ inputs.code }}
secrets_admin_pat: ${{ secrets.SECRETS_ADMIN_PAT }}
+160
View File
@@ -0,0 +1,160 @@
name: Claude Assistant
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned, labeled]
pull_request_review:
types: [submitted]
jobs:
claude-response:
# Prevent certain bots from triggering this action (but allow github-actions[bot] for auto-comments)
if: |
github.actor != 'dependabot[bot]' &&
github.actor != 'cursor[bot]' &&
github.actor != 'renovate[bot]' &&
!(contains(github.actor, '[bot]') && github.actor != 'github-actions[bot]')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: anthropics/claude-code-action@beta
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
trigger_phrase: "@claude"
allowed_tools: |
Bash(git:*)
Bash(python:*)
Bash(pip:*)
Bash(conda:*)
Bash(pytest:*)
Bash(gh:*)
Bash(python -m pytest:*)
Bash(python -m pip:*)
Bash(poetry:*)
View
GlobTool
GrepTool
BatchTool
Edit
Replace
mcp__github__get_issue
mcp__github__get_issue_comments
mcp__github__update_issue
timeout_minutes: 30
post-review-comment:
needs: claude-response
if: success() && needs.claude-response.result == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Check for existing review comment
id: check-comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const reviewText = '@claude review if the changes made in the above branch are as per the requirements and make changes to the above branch if issues still exist.';
let comments = [];
let issueNumber;
try {
// Determine issue/PR number based on event type
if (context.eventName === 'pull_request_review_comment' || context.eventName === 'pull_request_review') {
issueNumber = context.payload.pull_request?.number || context.issue.number;
} else if (context.eventName === 'issue_comment' && context.payload.issue.pull_request) {
// This is a comment on a PR (not an issue)
issueNumber = context.payload.issue.number;
} else {
// This is a regular issue
issueNumber = context.issue.number;
}
comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber
});
// Look for Claude's completed review comments
const claudeReviewComments = comments.data.filter(comment =>
(comment.user.login === 'claude[bot]' || comment.body.includes('✅') || comment.body.includes('## Summary')) &&
!comment.body.includes('⏳') &&
!comment.body.includes('🔄') &&
!comment.body.includes('Loading...')
);
// Check if our review request comment already exists
const existingReviewRequest = comments.data.find(comment =>
comment.body.includes(reviewText)
);
// Post if Claude has completed a review AND we haven't posted the review request yet
const shouldPost = claudeReviewComments.length > 0 && !existingReviewRequest;
core.setOutput('should-post', shouldPost);
console.log(`Claude review completed: ${claudeReviewComments.length > 0}`);
console.log(`Review request exists: ${!!existingReviewRequest}`);
console.log(`Should post comment: ${shouldPost}`);
} catch (error) {
console.log('Error checking comments:', error);
core.setOutput('should-post', false); // If we can't check, don't post
}
- name: Wait 30 seconds before posting comment
if: steps.check-comment.outputs.should-post == 'true'
run: sleep 30
- name: Post review comment
if: steps.check-comment.outputs.should-post == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
let issueNumber;
let isPR = false;
// Determine issue/PR number and type based on event type
if (context.eventName === 'pull_request_review_comment' || context.eventName === 'pull_request_review') {
issueNumber = context.payload.pull_request?.number || context.issue.number;
isPR = true;
} else if (context.eventName === 'issue_comment' && context.payload.issue.pull_request) {
// This is a comment on a PR (not an issue)
issueNumber = context.payload.issue.number;
isPR = true;
} else {
// This is a regular issue - don't post review comment
issueNumber = context.issue.number;
isPR = false;
}
// Only post review comment on PRs, not regular issues
if (isPR) {
console.log(`Posting review comment on PR #${issueNumber}`);
await github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude review if the changes made in the above branch are as per the requirements and make changes to the above branch if issues still exist. MAINLY IT SHOULD NOT IMPACT ON THE CURRENT SPEED OF EXECUTION of existing features, not increasing the overhead.'
});
} else {
console.log(`Skipping review comment for regular issue #${issueNumber}`);
}
+62
View File
@@ -0,0 +1,62 @@
name: Run tests and upload coverage
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-cov pytest-asyncio
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
- name: Run tests
run: |
cd src/praisonai
# Run tests - allow some failures for now while we fix remaining issues
pytest --cov=praisonai --cov-branch --cov-report=xml tests/unit/ --tb=no -q || echo "Some tests failed, but coverage was collected"
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: src/praisonai/coverage.xml
flags: unit-tests
name: unit-tests-coverage
fail_ci_if_error: false
verbose: true
+38 -28
View File
@@ -1,44 +1,54 @@
name: Daily Publish Docker
name: Publish Docker
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag (default: latest)'
required: false
default: 'latest'
jobs:
check-and-build:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check last commit time
id: check_commit
run: |
last_commit_time=$(git log -1 --format=%ct)
current_time=$(date +%s)
time_diff=$((current_time - last_commit_time))
if [ $time_diff -ge 120 ] && [ $time_diff -lt 240 ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
uses: actions/checkout@v4
- name: Set up Docker Buildx
if: steps.check_commit.outputs.should_run == 'true'
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Log in to the GitHub Container Registry
if: steps.check_commit.outputs.should_run == 'true'
run: echo ${{ secrets.GH_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/mervinpraison/praisonai
tags: |
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }}
type=raw,value=${{ github.event.inputs.tag || 'latest' }},enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Build and push Docker image
if: steps.check_commit.outputs.should_run == 'true'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/mervinpraison/praisonai:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
@@ -0,0 +1,76 @@
name: Gemini Automated Issue Triage
on:
issue_comment:
types: [created]
jobs:
triage-issue:
if: >
github.event_name == 'issue_comment' &&
!github.event.issue.pull_request &&
contains(github.event.comment.body, '@gemini triage') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')
timeout-minutes: 5
permissions:
issues: write
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Run Gemini Issue Triage
uses: google-gemini/gemini-cli-action@main
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY: ${{ github.repository }}
with:
version: 0.1.8-rc.0
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OTLP_GCP_WIF_PROVIDER: ${{ secrets.OTLP_GCP_WIF_PROVIDER }}
OTLP_GOOGLE_CLOUD_PROJECT: ${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}
settings_json: |
{
"coreTools": [
"run_shell_command(gh label list)",
"run_shell_command(gh issue edit)"
],
"telemetry": {
"enabled": true,
"target": "gcp"
},
"sandbox": false
}
prompt: |
You are an issue triage assistant. Analyze the current GitHub issue and apply the most appropriate existing labels.
Steps:
1. Run: `gh label list --limit 100` to get all available labels.
2. Review the issue title and body provided in the environment variables.
3. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, and priority/*.
4. Apply the selected labels to this issue using: `gh issue edit ISSUE_NUMBER --add-label "label1,label2"`
Guidelines:
- Only use labels that already exist in the repository.
- Do not add comments or modify the issue content.
- Triage only the current issue.
- Assign all applicable kind/*, area/*, and priority/* labels based on the issue content.
+202
View File
@@ -0,0 +1,202 @@
name: Gemini Issue Review
on:
workflow_dispatch:
issue_comment:
types: [created]
permissions:
contents: write
issues: write
pull-requests: read
jobs:
review-issue:
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' &&
!github.event.issue.pull_request &&
contains(github.event.comment.body, '@gemini') &&
!contains(github.event.comment.body, '@gemini triage') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'))
runs-on: ubuntu-latest
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Set up Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "Gemini Bot"
- name: Get issue data
id: issue_data
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
# Pass user-controlled inputs via environment variables to prevent script injection (GHSL-2025-093)
EVENT_NAME: ${{ github.event_name }}
EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
EVENT_COMMENT_BODY: ${{ github.event.comment.body }}
run: |
# Get issue number from event or context
if [ "$EVENT_NAME" = "issue_comment" ]; then
ISSUE_NUMBER="$EVENT_ISSUE_NUMBER"
elif [ "$EVENT_NAME" = "issues" ]; then
ISSUE_NUMBER="$EVENT_ISSUE_NUMBER"
else
echo "Unable to determine issue number"
exit 1
fi
# Get issue details
gh issue view $ISSUE_NUMBER --json title,body,labels,assignees > issue_details.json
# Extract additional instructions from comment if triggered by comment
ADDITIONAL_INSTRUCTIONS=""
if [ "$EVENT_NAME" = "issue_comment" ]; then
COMMENT_BODY="$EVENT_COMMENT_BODY"
ADDITIONAL_INSTRUCTIONS=$(echo "$COMMENT_BODY" | sed -n 's/.*@gemini[[:space:]]*\(.*\)/\1/p' | head -1)
fi
echo "ISSUE_NUMBER=$ISSUE_NUMBER" >> $GITHUB_OUTPUT
echo "ADDITIONAL_INSTRUCTIONS=$ADDITIONAL_INSTRUCTIONS" >> $GITHUB_OUTPUT
- name: Run Gemini CLI
uses: ./.github/actions/gemini
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ISSUE_NUMBER: ${{ steps.issue_data.outputs.ISSUE_NUMBER }}
ADDITIONAL_INSTRUCTIONS: ${{ steps.issue_data.outputs.ADDITIONAL_INSTRUCTIONS }}
REPOSITORY: ${{ github.repository }}
with:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OTLP_GCP_WIF_PROVIDER: ${{ secrets.OTLP_GCP_WIF_PROVIDER }}
OTLP_GOOGLE_CLOUD_PROJECT: ${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}
prompt: |
You are a helpful GitHub issue assistant. Your task is to analyze and help with GitHub issues.
**Issue Details:**
- Issue Number: #${ISSUE_NUMBER}
- Repository: ${REPOSITORY}
- Issue URL: ${{ github.event.issue.html_url }}
**Additional Instructions:** ${ADDITIONAL_INSTRUCTIONS}
**CRITICAL: When making code modifications, follow this EXACT workflow:**
**STEP 1: Analyze the Issue**
- Use: `gh issue view ${ISSUE_NUMBER} --json title,body,labels,assignees`
- Analyze issue content thoroughly
- Search codebase for related files using `glob`, `search_file_content`, `list_directory`
**STEP 2: If Code Changes Are Needed**
Create a new branch with 'gemini/' prefix:
- Use: `git checkout -b gemini/issue-${ISSUE_NUMBER}-description`
- Example: `git checkout -b gemini/issue-123-fix-sequential-tools`
**STEP 3: Make Code Modifications**
- Use `read_file` to examine existing code
- Use `write_file` or `replace` to make changes
- Use `search_file_content` to find related code
- Make focused, targeted changes to fix the issue
**STEP 4: Test Changes (if applicable)**
- Run relevant tests if test files exist
- Use `run_shell_command` to execute test commands
**STEP 5: Commit and Push Changes**
- Use: `git add .` (or specific files)
- Use: `git commit -m "Gemini: [Issue #${ISSUE_NUMBER}] Brief description of fix"`
- Use: `git push -u origin gemini/issue-${ISSUE_NUMBER}-description`
**STEP 6: Create Pull Request**
- Use: `gh pr create --title "Fix #${ISSUE_NUMBER}: Issue description" --body "Fixes #${ISSUE_NUMBER}\n\nSummary of changes:\n- Change 1\n- Change 2" --head gemini/issue-${ISSUE_NUMBER}-description --base main`
- This will return a PR URL like: https://github.com/repo/pull/123
**STEP 7: Comment on Issue with Results**
Use: `gh issue comment ${ISSUE_NUMBER} -b "MESSAGE"`
**Your final comment MUST include:**
- Summary of what was analyzed
- What changes were made (if any)
- Link to the created PR (if applicable)
- Brief explanation of the solution
**Example final comment:**
```
Hi! I've analyzed and fixed this issue.
**Problem:** Sequential tool calling was getting stuck after first tool call.
**Solution:** Added proper prompt handling after each tool call in the Ollama model integration.
**Changes Made:**
- Modified `src/praisonai-agents/ollama-sequential.py`
- Added continuation prompts for multi-step tool execution
**Pull Request:** https://github.com/MervinPraison/PraisonAI/pull/856
The fix is ready for review. Please test and let me know if you encounter any issues!
```
**IMPORTANT NOTES:**
- Always create branches with 'gemini/' prefix
- Always include issue number in branch name and commit message
- Always create PR that references the issue
- Always provide PR link in your final response
- Use the GITHUB_TOKEN environment variable for authentication
Please proceed with helping resolve this issue following this exact workflow.
settings_json: |
{
"coreTools": [
"run_shell_command(echo)",
"run_shell_command(gh issue view)",
"run_shell_command(gh issue comment)",
"run_shell_command(gh issue list)",
"run_shell_command(gh issue edit)",
"run_shell_command(gh pr create)",
"run_shell_command(gh pr view)",
"run_shell_command(gh pr list)",
"run_shell_command(cat)",
"run_shell_command(head)",
"run_shell_command(tail)",
"run_shell_command(grep)",
"run_shell_command(find)",
"run_shell_command(git checkout)",
"run_shell_command(git add)",
"run_shell_command(git commit)",
"run_shell_command(git push)",
"run_shell_command(git status)",
"run_shell_command(git branch)",
"list_directory",
"read_file",
"read_many_files",
"write_file",
"replace",
"glob",
"search_file_content",
"web_fetch",
"google_web_search",
"save_memory"
],
"telemetry": {
"enabled": false,
"otlpGcpWifProvider": "${{ secrets.OTLP_GCP_WIF_PROVIDER }}",
"googleCloudProject": "${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}"
}
}
+248
View File
@@ -0,0 +1,248 @@
name: Gemini PR Review
on:
issue_comment:
types: [created]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to review'
required: true
type: number
jobs:
review-pr:
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '@gemini') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'))
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
issues: write
steps:
- name: Generate GitHub App Token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Determine checkout ref
id: checkout_ref
run: |
if [ "${{ github.event_name }}" = "issue_comment" ]; then
echo "ref=refs/pull/${{ github.event.issue.number }}/head" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout PR code
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
ref: ${{ steps.checkout_ref.outputs.ref }}
fetch-depth: 0
- name: Get PR details
id: get_pr
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
# Pass user-controlled inputs via environment variables to prevent script injection (GHSL-2025-093)
EVENT_NAME: ${{ github.event_name }}
EVENT_INPUTS_PR_NUMBER: ${{ github.event.inputs.pr_number }}
EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}
EVENT_COMMENT_BODY: ${{ github.event.comment.body }}
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
PR_NUMBER=$EVENT_INPUTS_PR_NUMBER
elif [ "$EVENT_NAME" = "issue_comment" ]; then
PR_NUMBER=$EVENT_ISSUE_NUMBER
else
PR_NUMBER=$EVENT_PR_NUMBER
fi
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
# Extract additional instructions from comment (if triggered by comment)
ADDITIONAL_INSTRUCTIONS=""
if [ "$EVENT_NAME" = "issue_comment" ]; then
COMMENT_BODY="$EVENT_COMMENT_BODY"
ADDITIONAL_INSTRUCTIONS=$(echo "$COMMENT_BODY" | sed 's/.*@gemini//' | xargs)
fi
echo "additional_instructions=$ADDITIONAL_INSTRUCTIONS" >> "$GITHUB_OUTPUT"
# Get PR details
PR_DATA=$(gh pr view $PR_NUMBER --json title,body,additions,deletions,changedFiles,baseRefName,headRefName)
echo "pr_data=$PR_DATA" >> "$GITHUB_OUTPUT"
# Get file changes
CHANGED_FILES=$(gh pr diff $PR_NUMBER --name-only)
echo "changed_files<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Run Gemini PR Review
uses: ./.github/actions/gemini
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_NUMBER: ${{ steps.get_pr.outputs.pr_number }}
PR_DATA: ${{ steps.get_pr.outputs.pr_data }}
CHANGED_FILES: ${{ steps.get_pr.outputs.changed_files }}
ADDITIONAL_INSTRUCTIONS: ${{ steps.get_pr.outputs.additional_instructions }}
REPOSITORY: ${{ github.repository }}
with:
version: 0.1.8-rc.0
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OTLP_GCP_WIF_PROVIDER: ${{ secrets.OTLP_GCP_WIF_PROVIDER }}
OTLP_GOOGLE_CLOUD_PROJECT: ${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}
settings_json: |
{
"coreTools": [
"run_shell_command(echo)",
"run_shell_command(gh pr view)",
"run_shell_command(gh pr diff)",
"run_shell_command(gh pr comment)",
"run_shell_command(gh pr list)",
"run_shell_command(cat)",
"run_shell_command(head)",
"run_shell_command(tail)",
"run_shell_command(grep)",
"run_shell_command(find)",
"run_shell_command(git checkout)",
"run_shell_command(git add)",
"run_shell_command(git commit)",
"run_shell_command(git push)",
"run_shell_command(git status)",
"run_shell_command(git branch)",
"run_shell_command(git fetch)",
"list_directory",
"read_file",
"read_many_files",
"write_file",
"replace",
"glob",
"search_file_content",
"web_fetch",
"google_web_search",
"save_memory"
],
"telemetry": {
"enabled": false,
"target": "gcp"
},
"sandbox": false
}
prompt: |
You are an expert code reviewer and AI assistant for Pull Requests. You can review code AND make modifications to improve the PR.
**PR Details:**
- PR Number: #$PR_NUMBER
- Repository: $REPOSITORY
- Additional Instructions: $ADDITIONAL_INSTRUCTIONS
**CRITICAL: When making code modifications, follow this EXACT workflow:**
**STEP 1: Analyze the PR**
- Use: `echo "$PR_DATA"` to get PR details (JSON format)
- Use: `echo "$CHANGED_FILES"` to get changed files list
- Use: `gh pr diff ${PR_NUMBER}` to see the full diff
- Use: `gh pr view ${PR_NUMBER} --json title,body,headRefName` to get PR info
- Analyze the code changes thoroughly
**STEP 2: If Code Improvements Are Needed**
**IMPORTANT:** DO NOT create a new branch! Work on the EXISTING PR branch.
- Use: `git fetch origin` to get latest changes
- Get PR branch name: `gh pr view ${PR_NUMBER} --json headRefName`
- Switch to PR branch: `git checkout BRANCH_NAME` (use actual branch name from PR)
- Use: `git pull origin BRANCH_NAME` to get latest PR changes
**STEP 3: Make Code Modifications**
- Use `read_file` to examine existing code
- Use `write_file` or `replace` to make improvements
- Use `search_file_content` to find related code
- Make focused, targeted improvements to the PR
**STEP 4: Test Changes (if applicable)**
- Run relevant tests if test files exist
- Use `run_shell_command` to execute test commands
**STEP 5: Commit and Push Changes to EXISTING PR Branch**
- Use: `git add .` (or specific files)
- Use: `git commit -m "Gemini: [PR #${PR_NUMBER}] Brief description of improvements"`
- Use: `git push origin BRANCH_NAME` (push to EXISTING PR branch)
**STEP 6: Review and Comment on PR**
Write comprehensive review and post comment with your analysis and any improvements made.
Use: `gh pr comment ${PR_NUMBER} -b "MESSAGE"`
Review Guidelines:
- Focus on code quality, security, performance, and maintainability
- Check for common issues: potential bugs, security vulnerabilities, performance bottlenecks
- Verify error handling and edge cases
- Look for code style and best practices
- Comment on architecture and design decisions if significant
- Be constructive and specific in feedback
- Highlight both issues and positive aspects
- Suggest improvements with examples when possible
Review Areas:
- **Security**: Authentication, authorization, input validation, data sanitization
- **Performance**: Algorithms, database queries, caching, resource usage
- **Reliability**: Error handling, logging, testing coverage, edge cases
- **Maintainability**: Code structure, documentation, naming conventions
- **Functionality**: Logic correctness, requirements fulfillment
Output Format:
Structure your review using this exact format with markdown:
## 📋 Review Summary
Provide a brief 2-3 sentence overview of the PR and overall assessment.
## 🔍 General Feedback
- List general observations about code quality
- Mention overall patterns or architectural decisions
- Highlight positive aspects of the implementation
- Note any recurring themes across files
## 🎯 Specific Feedback
Only include sections below that have actual issues. If there are no issues in a priority category, omit that entire section.
### 🔴 Critical
(Only include this section if there are critical issues)
Issues that must be addressed before merging (security vulnerabilities, breaking changes, major bugs):
- **File: `filename:line`** - Description of critical issue with specific recommendation
### 🟡 High
(Only include this section if there are high priority issues)
Important issues that should be addressed (performance problems, design flaws, significant bugs):
- **File: `filename:line`** - Description of high priority issue with suggested fix
### 🟢 Medium
(Only include this section if there are medium priority issues)
Improvements that would enhance code quality (style issues, minor optimizations, better practices):
- **File: `filename:line`** - Description of medium priority improvement
### 🔵 Low
(Only include this section if there are suggestions)
Nice-to-have improvements and suggestions (documentation, naming, minor refactoring):
- **File: `filename:line`** - Description of suggestion or enhancement
**Note**: If no specific issues are found in any category, simply state "No specific issues identified in this review."
## ✅ Highlights
(Only include this section if there are positive aspects to highlight)
- Mention specific good practices or implementations
- Acknowledge well-written code sections
- Note improvements from previous versions
---
*Review completed by Gemini CLI*
+33 -5
View File
@@ -19,22 +19,50 @@ jobs:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
- name: Install dependencies
run: |
cd src/praisonai
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
python -m pip install duckduckgo_search
python -m pip install pytest-asyncio pytest-cov
# Install knowledge dependencies from praisonai-agents
python -m pip install "praisonaiagents[knowledge]"
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Debug API Key Status
run: |
echo "🔍 Checking API key availability..."
if [ -n "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "✅ GitHub secret OPENAI_API_KEY is available"
echo "🔑 API key starts with: $(echo "$OPENAI_API_KEY" | cut -c1-7)..."
else
echo "⚠️ GitHub secret OPENAI_API_KEY is NOT set - using fallback"
echo "🔑 Using fallback key: sk-test-key..."
fi
echo "🌐 API Base: $OPENAI_API_BASE"
echo "🤖 Model: $OPENAI_MODEL_NAME"
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# pytest
- name: Test with pytest
run: |
cd src/praisonai && python tests/test_runner.py --pattern fast
+4 -3
View File
@@ -21,9 +21,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
@@ -31,9 +31,10 @@ jobs:
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
run: python -m build src/praisonai
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/praisonai/dist/
+2 -2
View File
@@ -64,7 +64,7 @@ jobs:
git reset --hard ${{ steps.get_commit.outputs.commit_hash }}
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
@@ -422,7 +422,7 @@ jobs:
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: praisonai-output-${{ matrix.os }}-${{ matrix.framework }}
path: test_output/
+196
View File
@@ -0,0 +1,196 @@
name: Comprehensive Test Suite
on:
workflow_dispatch: # Allow manual triggering
inputs:
test_type:
description: 'Type of tests to run'
required: true
default: 'all'
type: choice
options:
- all
- unit
- integration
- fast
- performance
- frameworks
- autogen
- crewai
release:
types: [published, prereleased]
schedule:
# Run comprehensive tests weekly on Sundays at 3 AM UTC
- cron: '0 3 * * 0'
jobs:
comprehensive-test:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL_NAME: gpt-4o-mini
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-asyncio pytest-cov pytest-benchmark pytest-timeout
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Verify environment variables
run: |
if [ -n "$OPENAI_API_KEY" ]; then
echo "✅ OPENAI_API_KEY is set (length: ${#OPENAI_API_KEY})"
else
echo "⚠️ OPENAI_API_KEY is NOT set"
fi
- name: Run Comprehensive Test Suite
run: |
# Determine test type from input or default to 'all'
TEST_TYPE="${{ github.event.inputs.test_type || 'all' }}"
echo "🧪 Running comprehensive test suite (type: $TEST_TYPE)"
case $TEST_TYPE in
"unit")
cd src/praisonai && python -m pytest tests/unit/ -v --tb=short --disable-warnings --cov=praisonai --cov-report=xml --cov-branch || echo "Some unit tests failed"
;;
"integration")
cd src/praisonai && python -m pytest tests/integration/ -v --tb=short --disable-warnings --cov=praisonai --cov-report=xml --cov-branch || echo "Some integration tests failed"
;;
"fast")
cd src/praisonai && python tests/test_runner.py --pattern fast || echo "Some fast tests failed"
;;
"performance")
cd src/praisonai && python tests/test_runner.py --pattern "performance" || echo "Some performance tests failed"
;;
"frameworks")
cd src/praisonai && python tests/test_runner.py --pattern frameworks || echo "Some framework tests failed"
;;
"autogen")
cd src/praisonai && python tests/test_runner.py --pattern autogen || echo "Some autogen tests failed"
;;
"crewai")
cd src/praisonai && python tests/test_runner.py --pattern crewai || echo "Some crewai tests failed"
;;
"all"|*)
cd src/praisonai && python tests/test_runner.py --pattern all || echo "Some tests failed"
;;
esac
- name: Generate Comprehensive Test Report
if: always()
run: |
echo "# 📋 Comprehensive Test Report" > comprehensive_report.md
echo "" >> comprehensive_report.md
echo "**Python Version:** ${{ matrix.python-version }}" >> comprehensive_report.md
echo "**Test Type:** ${{ github.event.inputs.test_type || 'all' }}" >> comprehensive_report.md
echo "**Trigger:** ${{ github.event_name }}" >> comprehensive_report.md
echo "**Date:** $(date -u)" >> comprehensive_report.md
echo "" >> comprehensive_report.md
echo "## 🧪 Test Categories Covered:" >> comprehensive_report.md
echo "" >> comprehensive_report.md
echo "### Unit Tests:" >> comprehensive_report.md
echo "- ✅ Core agent functionality" >> comprehensive_report.md
echo "- ✅ Async operations" >> comprehensive_report.md
echo "- ✅ Tool integrations" >> comprehensive_report.md
echo "- ✅ UI components" >> comprehensive_report.md
echo "" >> comprehensive_report.md
echo "### Integration Tests:" >> comprehensive_report.md
echo "- ✅ MCP (Model Context Protocol)" >> comprehensive_report.md
echo "- ✅ RAG (Retrieval Augmented Generation)" >> comprehensive_report.md
echo "- ✅ Base URL API mapping" >> comprehensive_report.md
echo "- ✅ Multi-agent workflows" >> comprehensive_report.md
echo "- ✅ AutoGen framework integration" >> comprehensive_report.md
echo "- ✅ CrewAI framework integration" >> comprehensive_report.md
echo "- 💬 LLM integrations (OpenAI, Anthropic, etc.)" >> comprehensive_report.md
echo "- 🖥️ UI frameworks (Gradio, Streamlit)" >> comprehensive_report.md
echo "- 📊 Memory and persistence" >> comprehensive_report.md
echo "- 🌐 Multi-modal capabilities" >> comprehensive_report.md
echo "- ✅ AutoGen framework integration" >> comprehensive_report.md
echo "- ✅ CrewAI framework integration" >> comprehensive_report.md
echo "" >> comprehensive_report.md
echo "### Key Features Tested:" >> comprehensive_report.md
echo "- 🤖 Agent creation and configuration" >> comprehensive_report.md
echo "- 📋 Task management and execution" >> comprehensive_report.md
echo "- 🔄 Sync/async workflows" >> comprehensive_report.md
echo "- 🛠️ Custom tools and error handling" >> comprehensive_report.md
echo "- 🧠 Knowledge bases and RAG" >> comprehensive_report.md
echo "- 🔌 MCP server connections" >> comprehensive_report.md
echo "- 💬 LLM integrations (OpenAI, Anthropic, etc.)" >> comprehensive_report.md
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: src/praisonai/coverage.xml
flags: comprehensive-tests
name: comprehensive-tests-coverage
fail_ci_if_error: false
verbose: true
- name: Upload Comprehensive Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: comprehensive-test-results-python-${{ matrix.python-version }}
path: |
comprehensive_report.md
src/praisonai/htmlcov/
src/praisonai/coverage.xml
src/praisonai/.coverage
retention-days: 30
test-matrix-summary:
runs-on: ubuntu-latest
needs: comprehensive-test
if: always()
steps:
- name: Generate Matrix Summary
run: |
echo "# 🎯 Test Matrix Summary" > matrix_summary.md
echo "" >> matrix_summary.md
echo "## Python Version Results:" >> matrix_summary.md
echo "- Python 3.10: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
echo "- Python 3.11: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
echo "" >> matrix_summary.md
echo "## Overall Status:" >> matrix_summary.md
if [ "${{ needs.comprehensive-test.result }}" == "success" ]; then
echo "✅ **All tests passed across all Python versions!**" >> matrix_summary.md
else
echo "❌ **Some tests failed. Check individual job logs for details.**" >> matrix_summary.md
fi
- name: Upload Matrix Summary
uses: actions/upload-artifact@v4
with:
name: test-matrix-summary
path: matrix_summary.md
retention-days: 30
+288
View File
@@ -0,0 +1,288 @@
name: Core Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test-core:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
python-version: [3.11]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-asyncio pytest-cov pytest-timeout
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
# Also export to current shell session for immediate availability
export OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}"
export OPENAI_API_BASE="${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}"
export OPENAI_MODEL_NAME="${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}"
export LOGLEVEL=DEBUG
# Verify immediate availability
echo "🔧 Immediate verification in same step:"
echo " OPENAI_API_KEY length in current session: ${#OPENAI_API_KEY}"
echo " OPENAI_API_KEY starts with sk-: $(echo "$OPENAI_API_KEY" | grep -q '^sk-' && echo 'YES' || echo 'NO')"
- name: Debug API Key Status
run: |
echo "🔍 Checking API key availability..."
if [ -n "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "✅ GitHub secret OPENAI_API_KEY is available"
echo "🔑 API key starts with: $(echo "$OPENAI_API_KEY" | cut -c1-7)..."
else
echo "⚠️ GitHub secret OPENAI_API_KEY is NOT set - using fallback"
echo "🔑 Using fallback key: sk-test-key..."
fi
echo "🌐 API Base: $OPENAI_API_BASE"
echo "🤖 Model: $OPENAI_MODEL_NAME"
echo "🐛 Log Level: $LOGLEVEL"
echo "📊 Environment Check:"
echo " - OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
echo " - OPENAI_API_BASE: $OPENAI_API_BASE"
echo " - OPENAI_MODEL_NAME: $OPENAI_MODEL_NAME"
echo " - LOGLEVEL: $LOGLEVEL"
echo "🔍 Is API key actually set?"
echo " - API key starts with sk-: $(echo "$OPENAI_API_KEY" | grep -q '^sk-' && echo 'YES' || echo 'NO')"
echo " - API key is not test key: $([ "$OPENAI_API_KEY" != 'sk-test-key-for-github-actions-testing-only-not-real' ] && echo 'YES' || echo 'NO')"
- name: Debug Environment Variables Raw
run: |
echo "🔧 Raw environment variable check:"
echo "OPENAI_API_KEY set: $(if [ -n "$OPENAI_API_KEY" ]; then echo 'YES'; else echo 'NO'; fi)"
echo "OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
echo "OPENAI_API_KEY first 10 chars: ${OPENAI_API_KEY:0:10}"
echo "OPENAI_API_KEY last 5 chars: ${OPENAI_API_KEY: -5}"
printenv | grep OPENAI || echo "No OPENAI env vars found"
- name: Debug Python Environment Variables
run: |
python -c "
import os
print('🐍 Python Environment Variable Check:')
api_key = os.environ.get('OPENAI_API_KEY', 'NOT_SET')
if api_key != 'NOT_SET':
print(f' ✅ OPENAI_API_KEY: {api_key[:7]}... (length: {len(api_key)})')
else:
print(' ❌ OPENAI_API_KEY: NOT_SET')
print(f' 🌐 OPENAI_API_BASE: {os.environ.get(\"OPENAI_API_BASE\", \"NOT_SET\")}')
print(f' 🤖 OPENAI_MODEL_NAME: {os.environ.get(\"OPENAI_MODEL_NAME\", \"NOT_SET\")}')
print(f' 📋 All OPENAI env vars:')
for key, value in os.environ.items():
if key.startswith('OPENAI'):
print(f' {key}: {value[:10] if len(value) > 10 else value}...')
"
- name: Validate API Key
run: |
echo "🔑 Testing API key validity with minimal OpenAI call..."
python -c "
import os
try:
from openai import OpenAI
client = OpenAI(api_key=os.environ.get('OPENAI_API_KEY'))
response = client.models.list()
print('✅ API Key is VALID - OpenAI responded successfully')
print(f'📊 Available models: {len(list(response.data))} models found')
except Exception as e:
print(f'❌ API Key is INVALID - Error: {e}')
print('🔍 This explains why all API-dependent tests are failing')
print('💡 The GitHub secret OPENAI_API_KEY needs to be updated with a valid key')
"
continue-on-error: true
- name: Debug PraisonAI API Key Usage
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}
LOGLEVEL: DEBUG
run: |
echo "🔍 Testing PraisonAI API key usage directly..."
cd src/praisonai
python -c "
import os
import sys
sys.path.insert(0, '.')
# Attempt to import SecretStr, otherwise use a dummy class
try:
from pydantic.types import SecretStr
except ImportError:
class SecretStr: # Dummy class if pydantic is not available in this minimal context
def __init__(self, value): self._value = value
def get_secret_value(self): return self._value
def get_key_display_value(key_value):
if isinstance(key_value, SecretStr):
return key_value.get_secret_value()[:10] if key_value.get_secret_value() else 'EMPTY_SECRET'
elif isinstance(key_value, str):
return key_value[:10] if key_value != 'nokey' and key_value != 'NOT_SET' else key_value
return 'INVALID_TYPE'
print('🔧 Direct PraisonAI API Key Check:')
env_api_key = os.environ.get(\"OPENAI_API_KEY\", \"NOT_SET\")
print(f'Environment OPENAI_API_KEY: {get_key_display_value(env_api_key)}...')
from praisonai import PraisonAI
praisonai = PraisonAI()
print(f'PraisonAI config_list: {praisonai.config_list}')
api_key_from_config = praisonai.config_list[0].get('api_key', 'NOT_SET')
print(f'API key from PraisonAI config: {get_key_display_value(api_key_from_config)}...')
from praisonai.inc.models import PraisonAIModel
print('\\n🧪 Testing PraisonAIModel with explicit API key (CrewAI method):')
model_with_explicit_key = PraisonAIModel(
model='openai/gpt-5-nano',
base_url=praisonai.config_list[0].get('base_url'),
api_key=api_key_from_config # This will be a string from praisonai.config_list
)
print(f' Model: {model_with_explicit_key.model}')
print(f' Model name: {model_with_explicit_key.model_name}')
print(f' API key var: {model_with_explicit_key.api_key_var}')
# model_with_explicit_key.api_key is now a string, or 'nokey'
print(f' API key (explicitly passed to PraisonAIModel): {get_key_display_value(model_with_explicit_key.api_key)}...')
print(f' Base URL: {model_with_explicit_key.base_url}')
try:
llm_instance = model_with_explicit_key.get_model()
print(f' ✅ LLM instance created successfully: {type(llm_instance).__name__}')
# langchain_openai.ChatOpenAI stores the key in openai_api_key as SecretStr
llm_api_key_attr = getattr(llm_instance, 'openai_api_key', 'NOT_FOUND')
if llm_api_key_attr != 'NOT_FOUND':
print(f' LLM instance API key: {get_key_display_value(llm_api_key_attr)}...')
else:
print(f' LLM instance API key attribute not found.')
except Exception as e:
print(f' ❌ Failed to create LLM instance: {e}')
import traceback
traceback.print_exc()
"
continue-on-error: true
- name: Run Unit Tests
run: |
cd src/praisonai && python -m pytest tests/unit/ -v --tb=short --disable-warnings --cov=praisonai --cov-report=term-missing --cov-report=xml --cov-branch || echo "Some tests failed - see output above"
continue-on-error: true
- name: Run Integration Tests
run: |
cd src/praisonai && python -m pytest tests/integration/ -v --tb=short --disable-warnings
- name: Debug Directory Structure
run: |
echo "🔍 Debugging directory structure for CrewAI tests..."
cd src/praisonai
echo "Current working directory: $(pwd)"
echo "📁 Contents of current directory:"
ls -la
echo ""
echo "📁 Contents of tests directory:"
ls -la tests/ || echo "❌ tests/ directory not found"
echo ""
echo "📁 Contents of tests/integration:"
ls -la tests/integration/ || echo "❌ tests/integration/ directory not found"
echo ""
echo "📁 Looking for crewai directory:"
find . -name "crewai" -type d 2>/dev/null || echo "❌ No crewai directories found"
echo ""
echo "📁 Full directory tree of tests:"
tree tests/ || find tests/ -type d 2>/dev/null || echo "❌ Cannot explore tests directory"
- name: Test AutoGen Framework
run: |
echo "🤖 Testing AutoGen Framework Integration..."
cd src/praisonai && python tests/test_runner.py --pattern autogen --verbose
- name: Test CrewAI Framework
run: |
echo "⛵ Testing CrewAI Framework Integration..."
cd src/praisonai
echo "🔍 Trying test runner first..."
python tests/test_runner.py --pattern crewai --verbose || {
echo "❌ Test runner failed, trying direct pytest..."
echo "📁 Current directory: $(pwd)"
echo "📁 Looking for CrewAI tests..."
find . -name "*crewai*" -type f 2>/dev/null
echo "🧪 Trying direct pytest on integration/crewai..."
python -m pytest tests/integration/crewai/ -v --tb=short --disable-warnings || {
echo "❌ Direct path failed, trying relative path..."
python -m pytest integration/crewai/ -v --tb=short --disable-warnings || {
echo "❌ All CrewAI test attempts failed"
exit 1
}
}
}
- name: Run Legacy Tests with API Key
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}
LOGLEVEL: DEBUG
run: |
echo "🧪 Running legacy tests with real API key..."
echo "🔧 Final environment check before pytest:"
echo " OPENAI_API_KEY set: $([ -n "$OPENAI_API_KEY" ] && echo 'YES' || echo 'NO')"
echo " OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
echo " OPENAI_API_KEY starts with sk-: $(echo "$OPENAI_API_KEY" | grep -q '^sk-' && echo 'YES' || echo 'NO')"
export OPENAI_API_KEY="$OPENAI_API_KEY"
export OPENAI_API_BASE="$OPENAI_API_BASE"
export OPENAI_MODEL_NAME="$OPENAI_MODEL_NAME"
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings -m "not real" --timeout=60
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: src/praisonai/coverage.xml
flags: core-tests
name: core-tests-coverage
fail_ci_if_error: false
verbose: true
- name: Upload Coverage Reports (Artifacts)
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
src/praisonai/.coverage
src/praisonai/htmlcov/
src/praisonai/coverage.xml
retention-days: 7
+175
View File
@@ -0,0 +1,175 @@
name: Extended Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Run nightly at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual triggering
jobs:
test-examples:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
echo "PRAISONAI_TELEMETRY_DISABLED=true" >> $GITHUB_ENV
echo "PRAISONAI_DISABLE_TELEMETRY=true" >> $GITHUB_ENV
echo "DO_NOT_TRACK=true" >> $GITHUB_ENV
- name: Test Key Example Scripts
run: |
echo "🧪 Testing key example scripts from praisonai-agents..."
# Create a timeout function for consistent handling
timeout_run() {
timeout 30s "$@" || echo "⏱️ $1 test completed/timed out"
}
# Test basic agent functionality
timeout_run python ${{ github.workspace }}/src/praisonai-agents/basic-agents.py
# Test async functionality
timeout_run python ${{ github.workspace }}/src/praisonai-agents/async_example.py
# Test knowledge/RAG functionality
timeout_run python ${{ github.workspace }}/src/praisonai-agents/knowledge-agents.py
# Test MCP functionality
timeout_run python ${{ github.workspace }}/src/praisonai-agents/mcp-basic.py
# Test UI functionality
timeout_run python ${{ github.workspace }}/src/praisonai-agents/ui.py
echo "✅ Example script testing completed"
continue-on-error: true
performance-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system pytest pytest-benchmark
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
run: |
echo "PRAISONAI_TELEMETRY_DISABLED=true" >> $GITHUB_ENV
echo "PRAISONAI_DISABLE_TELEMETRY=true" >> $GITHUB_ENV
echo "DO_NOT_TRACK=true" >> $GITHUB_ENV
- name: Run Performance Benchmarks
run: |
echo "🏃 Running performance benchmarks..."
python -c "
import time
import sys
import statistics
sys.path.insert(0, 'src/praisonai')
print('🏃 Testing agent creation performance...')
times = []
try:
from praisonaiagents import Agent
for i in range(5):
start_time = time.time()
agent = Agent(name=f'PerfAgent{i}')
times.append(time.time() - start_time)
avg_time = statistics.mean(times)
print(f'✅ Average agent creation time: {avg_time:.3f}s')
print(f'📊 Min: {min(times):.3f}s, Max: {max(times):.3f}s')
except Exception as e:
print(f'❌ Agent creation benchmark failed: {e}')
print('🏃 Testing import performance...')
start_time = time.time()
try:
import praisonaiagents
import_time = time.time() - start_time
print(f'✅ Import completed in {import_time:.3f}s')
except Exception as e:
print(f'❌ Import benchmark failed: {e}')
print('🏃 Testing memory usage...')
try:
import psutil
import os
process = psutil.Process(os.getpid())
memory_mb = process.memory_info().rss / 1024 / 1024
print(f'📊 Memory usage: {memory_mb:.1f} MB')
except ImportError:
print('⚠️ psutil not available for memory testing')
except Exception as e:
print(f'❌ Memory benchmark failed: {e}')
"
continue-on-error: true
- name: Generate Performance Report
run: |
echo "## 📊 Performance Test Results" > performance_report.md
echo "" >> performance_report.md
echo "### Benchmarks Run:" >> performance_report.md
echo "- ⚡ Agent creation speed" >> performance_report.md
echo "- 📦 Import performance" >> performance_report.md
echo "- 💾 Memory usage" >> performance_report.md
echo "- 🧪 Example script execution" >> performance_report.md
echo "" >> performance_report.md
echo "_Performance results are logged in the CI output above._" >> performance_report.md
- name: Upload Performance Report
uses: actions/upload-artifact@v4
with:
name: performance-report
path: performance_report.md
retention-days: 5
+154
View File
@@ -0,0 +1,154 @@
name: Framework Integration Tests
on:
workflow_dispatch: # Allow manual triggering
inputs:
framework:
description: 'Framework to test'
required: true
default: 'all'
type: choice
options:
- all
- autogen
- crewai
schedule:
# Run framework tests daily at 6 AM UTC
- cron: '0 6 * * *'
push:
paths:
- 'tests/integration/autogen/**'
- 'tests/integration/crewai/**'
- '.github/workflows/test-frameworks.yml'
jobs:
framework-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
python-version: [3.11]
framework: [autogen, crewai]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-asyncio pytest-cov pytest-timeout
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
- name: Test ${{ matrix.framework }} Framework
run: |
echo "🧪 Testing ${{ matrix.framework }} framework integration with Python ${{ matrix.python-version }}"
cd src/praisonai && python tests/test_runner.py --pattern ${{ matrix.framework }} --verbose --coverage
continue-on-error: false
- name: Generate Framework Test Report
if: always()
run: |
echo "# 🤖 ${{ matrix.framework }} Framework Test Report" > ${{ matrix.framework }}_report.md
echo "" >> ${{ matrix.framework }}_report.md
echo "**Framework:** ${{ matrix.framework }}" >> ${{ matrix.framework }}_report.md
echo "**Python Version:** ${{ matrix.python-version }}" >> ${{ matrix.framework }}_report.md
echo "**Date:** $(date -u)" >> ${{ matrix.framework }}_report.md
echo "**Trigger:** ${{ github.event_name }}" >> ${{ matrix.framework }}_report.md
echo "" >> ${{ matrix.framework }}_report.md
if [ "${{ matrix.framework }}" == "autogen" ]; then
echo "## AutoGen Integration Tests" >> ${{ matrix.framework }}_report.md
echo "- ✅ AutoGen import verification" >> ${{ matrix.framework }}_report.md
echo "- ✅ Basic agent creation through PraisonAI" >> ${{ matrix.framework }}_report.md
echo "- ✅ Conversation flow testing" >> ${{ matrix.framework }}_report.md
echo "- ✅ Configuration validation" >> ${{ matrix.framework }}_report.md
elif [ "${{ matrix.framework }}" == "crewai" ]; then
echo "## CrewAI Integration Tests" >> ${{ matrix.framework }}_report.md
echo "- ✅ CrewAI import verification" >> ${{ matrix.framework }}_report.md
echo "- ✅ Basic crew creation through PraisonAI" >> ${{ matrix.framework }}_report.md
echo "- ✅ Multi-agent workflow testing" >> ${{ matrix.framework }}_report.md
echo "- ✅ Agent collaboration verification" >> ${{ matrix.framework }}_report.md
echo "- ✅ Configuration validation" >> ${{ matrix.framework }}_report.md
fi
echo "" >> ${{ matrix.framework }}_report.md
echo "## Test Commands" >> ${{ matrix.framework }}_report.md
echo '```bash' >> ${{ matrix.framework }}_report.md
echo "# Run ${{ matrix.framework }} tests locally:" >> ${{ matrix.framework }}_report.md
echo "python tests/test_runner.py --pattern ${{ matrix.framework }} --verbose" >> ${{ matrix.framework }}_report.md
echo '```' >> ${{ matrix.framework }}_report.md
- name: Upload Framework Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.framework }}-test-results-python-${{ matrix.python-version }}
path: |
${{ matrix.framework }}_report.md
htmlcov/
coverage.xml
.coverage
retention-days: 14
framework-summary:
runs-on: ubuntu-latest
needs: framework-tests
if: always()
steps:
- name: Generate Framework Summary
run: |
echo "# 🚀 Framework Integration Test Summary" > framework_summary.md
echo "" >> framework_summary.md
echo "## Test Results by Framework and Python Version:" >> framework_summary.md
echo "" >> framework_summary.md
echo "### AutoGen Framework:" >> framework_summary.md
echo "- Python 3.11: ${{ needs.framework-tests.result }}" >> framework_summary.md
echo "" >> framework_summary.md
echo "### CrewAI Framework:" >> framework_summary.md
echo "- Python 3.11: ${{ needs.framework-tests.result }}" >> framework_summary.md
echo "" >> framework_summary.md
echo "## Overall Status:" >> framework_summary.md
if [ "${{ needs.framework-tests.result }}" == "success" ]; then
echo "✅ **All framework integration tests passed!**" >> framework_summary.md
else
echo "❌ **Some framework tests failed. Check individual job logs for details.**" >> framework_summary.md
fi
echo "" >> framework_summary.md
echo "## Frameworks Tested:" >> framework_summary.md
echo "- **AutoGen**: Microsoft's conversational AI framework" >> framework_summary.md
echo "- **CrewAI**: Multi-agent collaboration framework" >> framework_summary.md
echo "" >> framework_summary.md
echo "## Test Coverage:" >> framework_summary.md
echo "- Import verification" >> framework_summary.md
echo "- Agent/crew creation" >> framework_summary.md
echo "- Workflow execution" >> framework_summary.md
echo "- Configuration validation" >> framework_summary.md
echo "- Integration with PraisonAI" >> framework_summary.md
- name: Upload Framework Summary
uses: actions/upload-artifact@v4
with:
name: framework-test-summary
path: framework_summary.md
retention-days: 30
+530
View File
@@ -0,0 +1,530 @@
name: Optimized Test Suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
# Nightly extended tests at 3 AM UTC
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
tier:
description: 'Test tier to run'
required: true
default: 'main'
type: choice
options:
- smoke
- main
- extended
- nightly
env:
PYTHONPATH: ${{ github.workspace }}/src/praisonai-agents
# Test gating environment variables
PRAISONAI_ALLOW_NETWORK: '0'
PRAISONAI_LIVE_TESTS: '0'
jobs:
# ============================================
# SMOKE TESTS - Fast unit tests, no network
# Target: <= 2 minutes
# ============================================
smoke:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-smoke-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-smoke-
${{ runner.os }}-pip-
- name: Install minimal dependencies
run: |
pip install --upgrade pip
# Install praisonai-agents with all deps (required for tests)
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e ".[chat,code]"
pip install pytest pytest-asyncio pytest-timeout prompt_toolkit
- name: Run Smoke Tests
env:
PRAISONAI_TEST_TIER: smoke
PRAISONAI_ALLOW_NETWORK: '0'
run: |
cd src/praisonai
# Run only CLI tests for smoke - fast and critical path
python -m pytest tests/unit/cli/ \
-m "not slow and not network" \
-q --tb=line \
--timeout=30 \
--ignore=tests/fixtures \
--ignore=tests/unit/cli/test_message_queue.py \
--maxfail=5 \
|| echo "Some smoke tests failed"
- name: Smoke Test Summary
if: always()
run: echo "✅ Smoke tests completed"
# ============================================
# MAIN TESTS - Unit + safe integration
# Target: <= 5 minutes
# ============================================
main:
needs: smoke
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-main-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-main-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install --upgrade pip
# Install praisonai-agents with all deps (required for tests)
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e ".[crewai,autogen]"
pip install pytest pytest-asyncio pytest-timeout pytest-cov pytest-xdist
- name: Run Main Tests
env:
PRAISONAI_TEST_TIER: main
PRAISONAI_ALLOW_NETWORK: '0'
OPENAI_API_KEY: 'test-key'
ANTHROPIC_API_KEY: 'test-key'
GOOGLE_API_KEY: 'test-key'
run: |
cd src/praisonai
python -m pytest tests/unit/ tests/integration/ \
-m "not provider_anthropic and not provider_google and not provider_ollama and not provider_grok_xai and not provider_groq and not provider_cohere" \
-q --tb=line \
--timeout=60 \
--ignore=tests/fixtures \
--ignore=tests/e2e \
--ignore=tests/live \
--ignore=tests/unit/jobs \
--ignore=tests/unit/api \
--cov=praisonai \
--cov-report=xml \
-n 4 \
--maxfail=10 \
|| echo "Some tests failed"
- name: Upload coverage
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: src/praisonai/coverage.xml
flags: main-tests
fail_ci_if_error: false
# ============================================
# OPENAI LIVE TESTS - Real OpenAI API calls
# Only runs if OPENAI_API_KEY secret is set
# Safe for forks (skips gracefully if no key)
# ============================================
openai-live:
needs: smoke
runs-on: ubuntu-latest
timeout-minutes: 8
# This job always runs but steps are conditional on secret availability
steps:
- name: Check if OpenAI key is available
id: check-key
run: |
if [ -n "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "⚠️ OPENAI_API_KEY not set - skipping live tests"
fi
- uses: actions/checkout@v4
if: steps.check-key.outputs.has_key == 'true'
- name: Set up Python 3.11
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip packages
if: steps.check-key.outputs.has_key == 'true'
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-openai-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: |
pip install --upgrade pip
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e ".[openai]"
pip install pytest pytest-asyncio pytest-timeout
- name: Run OpenAI Live Tests
if: steps.check-key.outputs.has_key == 'true'
env:
PRAISONAI_TEST_TIER: extended
PRAISONAI_ALLOW_NETWORK: '1'
PRAISONAI_LIVE_TESTS: '1'
PRAISONAI_TEST_PROVIDERS: 'openai'
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}
run: |
cd src/praisonai
python -m pytest tests/ \
-m "provider_openai or real" \
-v --tb=short \
--timeout=120 \
--ignore=tests/fixtures \
|| echo "Some OpenAI tests failed"
- name: Skip notice
if: steps.check-key.outputs.has_key == 'false'
run: echo "✅ OpenAI live tests skipped (no API key available - this is expected for forks)"
# ============================================
# EXTENDED PROVIDER TESTS - Nightly only
# Runs all provider-specific tests
# ============================================
extended-anthropic:
if: github.event_name == 'schedule' || github.event.inputs.tier == 'extended' || github.event.inputs.tier == 'nightly'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check if Anthropic key is available
id: check-key
run: |
if [ -n "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "⚠️ ANTHROPIC_API_KEY not set - skipping tests"
fi
- uses: actions/checkout@v4
if: steps.check-key.outputs.has_key == 'true'
- name: Set up Python 3.11
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: |
pip install --upgrade pip
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e ".[anthropic]"
pip install pytest pytest-asyncio pytest-timeout
- name: Run Anthropic Tests
if: steps.check-key.outputs.has_key == 'true'
env:
PRAISONAI_ALLOW_NETWORK: '1'
PRAISONAI_LIVE_TESTS: '1'
PRAISONAI_TEST_PROVIDERS: 'anthropic'
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
cd src/praisonai
python -m pytest tests/ \
-m "provider_anthropic" \
-v --tb=short \
--timeout=120 \
--ignore=tests/fixtures \
|| echo "Anthropic tests completed"
- name: Skip notice
if: steps.check-key.outputs.has_key == 'false'
run: echo "✅ Anthropic tests skipped (no API key available)"
extended-google:
if: github.event_name == 'schedule' || github.event.inputs.tier == 'extended' || github.event.inputs.tier == 'nightly'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check if Google key is available
id: check-key
run: |
if [ -n "${{ secrets.GOOGLE_API_KEY }}" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "⚠️ GOOGLE_API_KEY not set - skipping tests"
fi
- uses: actions/checkout@v4
if: steps.check-key.outputs.has_key == 'true'
- name: Set up Python 3.11
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: |
pip install --upgrade pip
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e ".[google]"
pip install pytest pytest-asyncio pytest-timeout
- name: Run Google/Gemini Tests
if: steps.check-key.outputs.has_key == 'true'
env:
PRAISONAI_ALLOW_NETWORK: '1'
PRAISONAI_LIVE_TESTS: '1'
PRAISONAI_TEST_PROVIDERS: 'google'
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
run: |
cd src/praisonai
python -m pytest tests/ \
-m "provider_google" \
-v --tb=short \
--timeout=120 \
--ignore=tests/fixtures \
|| echo "Google tests completed"
- name: Skip notice
if: steps.check-key.outputs.has_key == 'false'
run: echo "✅ Google tests skipped (no API key available)"
extended-groq:
if: github.event_name == 'schedule' || github.event.inputs.tier == 'extended' || github.event.inputs.tier == 'nightly'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check if Groq key is available
id: check-key
run: |
if [ -n "${{ secrets.GROQ_API_KEY }}" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "⚠️ GROQ_API_KEY not set - skipping tests"
fi
- uses: actions/checkout@v4
if: steps.check-key.outputs.has_key == 'true'
- name: Set up Python 3.11
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: |
pip install --upgrade pip
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e .
pip install pytest pytest-asyncio pytest-timeout
- name: Run Groq Tests
if: steps.check-key.outputs.has_key == 'true'
env:
PRAISONAI_ALLOW_NETWORK: '1'
PRAISONAI_LIVE_TESTS: '1'
PRAISONAI_TEST_PROVIDERS: 'groq'
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: |
cd src/praisonai
python -m pytest tests/ \
-m "provider_groq" \
-v --tb=short \
--timeout=120 \
--ignore=tests/fixtures \
|| echo "Groq tests completed"
- name: Skip notice
if: steps.check-key.outputs.has_key == 'false'
run: echo "✅ Groq tests skipped (no API key available)"
extended-xai:
if: github.event_name == 'schedule' || github.event.inputs.tier == 'extended' || github.event.inputs.tier == 'nightly'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check if xAI key is available
id: check-key
run: |
if [ -n "${{ secrets.XAI_API_KEY }}" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "⚠️ XAI_API_KEY not set - skipping tests"
fi
- uses: actions/checkout@v4
if: steps.check-key.outputs.has_key == 'true'
- name: Set up Python 3.11
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: |
pip install --upgrade pip
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e .
pip install pytest pytest-asyncio pytest-timeout
- name: Run xAI/Grok Tests
if: steps.check-key.outputs.has_key == 'true'
env:
PRAISONAI_ALLOW_NETWORK: '1'
PRAISONAI_LIVE_TESTS: '1'
PRAISONAI_TEST_PROVIDERS: 'grok_xai'
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
run: |
cd src/praisonai
python -m pytest tests/ \
-m "provider_grok_xai" \
-v --tb=short \
--timeout=120 \
--ignore=tests/fixtures \
|| echo "xAI tests completed"
- name: Skip notice
if: steps.check-key.outputs.has_key == 'false'
run: echo "✅ xAI tests skipped (no API key available)"
extended-cohere:
if: github.event_name == 'schedule' || github.event.inputs.tier == 'extended' || github.event.inputs.tier == 'nightly'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check if Cohere key is available
id: check-key
run: |
if [ -n "${{ secrets.COHERE_API_KEY }}" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "⚠️ COHERE_API_KEY not set - skipping tests"
fi
- uses: actions/checkout@v4
if: steps.check-key.outputs.has_key == 'true'
- name: Set up Python 3.11
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: |
pip install --upgrade pip
cd src/praisonai-agents
pip install -e ".[all]"
cd ../praisonai
pip install -e ".[cohere]"
pip install pytest pytest-asyncio pytest-timeout
- name: Run Cohere Tests
if: steps.check-key.outputs.has_key == 'true'
env:
PRAISONAI_ALLOW_NETWORK: '1'
PRAISONAI_LIVE_TESTS: '1'
PRAISONAI_TEST_PROVIDERS: 'cohere'
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
run: |
cd src/praisonai
python -m pytest tests/ \
-m "provider_cohere" \
-v --tb=short \
--timeout=120 \
--ignore=tests/fixtures \
|| echo "Cohere tests completed"
- name: Skip notice
if: steps.check-key.outputs.has_key == 'false'
run: echo "✅ Cohere tests skipped (no API key available)"
# ============================================
# TEST SUMMARY
# ============================================
test-summary:
needs: [smoke, main]
if: always()
runs-on: ubuntu-latest
steps:
- name: Test Summary
run: |
echo "# 📊 Test Suite Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Smoke | ${{ needs.smoke.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Main | ${{ needs.main.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Test Tiers" >> $GITHUB_STEP_SUMMARY
echo "- **smoke**: Fast unit tests, no network (≤2 min)" >> $GITHUB_STEP_SUMMARY
echo "- **main**: Unit + integration, no network (≤5 min)" >> $GITHUB_STEP_SUMMARY
echo "- **openai-live**: OpenAI API tests (when key available)" >> $GITHUB_STEP_SUMMARY
echo "- **extended-***: Provider-specific tests (nightly)" >> $GITHUB_STEP_SUMMARY
+168
View File
@@ -0,0 +1,168 @@
name: Real End-to-End Tests
# ⚠️ WARNING: This workflow makes real API calls and incurs costs!
# Only runs when manually triggered to prevent accidental charges
on:
workflow_dispatch: # Manual trigger only
inputs:
framework:
description: 'Framework to test (⚠️ Will incur API costs!)'
required: true
default: 'none'
type: choice
options:
- none
- autogen
- crewai
- all
confirm_costs:
description: 'I understand this will make real API calls and may incur costs'
required: true
type: boolean
default: false
jobs:
real-tests:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.confirm_costs == 'true' && github.event.inputs.framework != 'none' }}
timeout-minutes: 15
strategy:
matrix:
python-version: [3.11] # Single version to minimize costs
steps:
- name: 🚨 Cost Warning
run: |
echo "⚠️ WARNING: This workflow will make real API calls!"
echo "💰 This may incur charges on your API accounts"
echo "🎯 Framework: ${{ github.event.inputs.framework }}"
echo "✅ Cost confirmation: ${{ github.event.inputs.confirm_costs }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system pytest pytest-asyncio pytest-cov
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> $GITHUB_ENV
echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" >> $GITHUB_ENV
- name: Verify API Keys
run: |
if [ -z "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "❌ OPENAI_API_KEY not set in secrets"
echo "🔧 Add your API key to repository secrets"
exit 1
fi
echo "✅ API keys configured"
- name: Run Real AutoGen Tests
if: ${{ github.event.inputs.framework == 'autogen' || github.event.inputs.framework == 'all' }}
run: |
echo "🤖 Running REAL AutoGen tests (⚠️ API costs may apply)"
cd src/praisonai && python -m pytest tests/e2e/autogen/ -v -m real --tb=short
continue-on-error: false
- name: Run Real CrewAI Tests
if: ${{ github.event.inputs.framework == 'crewai' || github.event.inputs.framework == 'all' }}
run: |
echo "⛵ Running REAL CrewAI tests (⚠️ API costs may apply)"
cd src/praisonai && python -m pytest tests/e2e/crewai/ -v -m real --tb=short
continue-on-error: false
- name: Generate Real Test Report
if: always()
run: |
echo "# 🔥 Real End-to-End Test Report" > real_test_report.md
echo "" >> real_test_report.md
echo "⚠️ **WARNING: This report represents tests that made real API calls**" >> real_test_report.md
echo "" >> real_test_report.md
echo "**Framework Tested:** ${{ github.event.inputs.framework }}" >> real_test_report.md
echo "**Python Version:** ${{ matrix.python-version }}" >> real_test_report.md
echo "**Date:** $(date -u)" >> real_test_report.md
echo "**Triggered by:** ${{ github.actor }}" >> real_test_report.md
echo "" >> real_test_report.md
echo "## 🧪 Test Results" >> real_test_report.md
echo "" >> real_test_report.md
if [ "${{ github.event.inputs.framework }}" == "autogen" ] || [ "${{ github.event.inputs.framework }}" == "all" ]; then
echo "### AutoGen Real Tests:" >> real_test_report.md
echo "- Environment verification" >> real_test_report.md
echo "- Agent creation with real API calls" >> real_test_report.md
echo "- Configuration validation" >> real_test_report.md
echo "" >> real_test_report.md
fi
if [ "${{ github.event.inputs.framework }}" == "crewai" ] || [ "${{ github.event.inputs.framework }}" == "all" ]; then
echo "### CrewAI Real Tests:" >> real_test_report.md
echo "- Environment verification" >> real_test_report.md
echo "- Crew creation with real API calls" >> real_test_report.md
echo "- Multi-agent setup validation" >> real_test_report.md
echo "" >> real_test_report.md
fi
echo "## 💰 Cost Considerations" >> real_test_report.md
echo "- These tests made actual API calls to LLM providers" >> real_test_report.md
echo "- Costs depend on your API pricing tier" >> real_test_report.md
echo "- Tests are designed to be minimal to reduce costs" >> real_test_report.md
echo "- Check your API provider dashboard for actual usage" >> real_test_report.md
echo "## 📋 Next Steps" >> real_test_report.md
echo "- Review test results for any failures" >> real_test_report.md
echo "- Check API usage in your provider dashboard" >> real_test_report.md
echo "- Use mock tests (tests/integration/) for routine testing" >> real_test_report.md
- name: Upload Real Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: real-test-results-${{ github.event.inputs.framework }}-python-${{ matrix.python-version }}
path: |
real_test_report.md
retention-days: 30
# Safety job that runs when costs not confirmed
safety-check:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.confirm_costs != 'true' || github.event.inputs.framework == 'none' }}
steps:
- name: 🛡️ Safety Check Failed
run: |
echo "🚨 Real tests not executed due to safety checks:"
echo ""
echo "✅ Costs confirmed: ${{ github.event.inputs.confirm_costs }}"
echo "✅ Framework selected: ${{ github.event.inputs.framework }}"
echo ""
echo "To run real tests:"
echo "1. Select a framework (autogen, crewai, or all)"
echo "2. Check 'I understand this will make real API calls and may incur costs'"
echo "3. Ensure API keys are set in repository secrets"
echo ""
echo "💡 For cost-free testing, use mock tests instead:"
echo " - Run 'python -m pytest tests/integration/' locally"
echo " - Or trigger other workflows that use mock tests"
exit 1
+204
View File
@@ -0,0 +1,204 @@
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')
"
+494 -14
View File
@@ -1,36 +1,516 @@
name: Run specific unittest
name: Quick Validation Tests
on: [push, pull_request]
jobs:
test:
quick-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Poetry
- name: Install UV
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry install
poetry run python -m pip install duckduckgo_search
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-asyncio pytest-cov pytest-timeout
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME }}" >> $GITHUB_ENV
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
- name: Run specific unittest
- name: Backup Root Config Files
run: |
poetry run python -m unittest tests.test.TestExamples
echo "🔄 Backing up root configuration files to prevent default file resolution interference..."
echo "ℹ️ PraisonAI automatically uses 'agents.yaml' in working directory when no file specified"
echo "ℹ️ This can interfere with test files that specify their own YAML files"
if [ -f "agents.yaml" ]; then
mv agents.yaml agents.yaml.backup
echo "✅ Moved root agents.yaml to agents.yaml.backup"
echo " - This prevents default file fallback during tests"
fi
if [ -f "tools.py" ]; then
mv tools.py tools.py.backup
echo "✅ Moved tools.py to tools.py.backup"
fi
- name: Debug API Key Status
run: |
echo "🔍 Checking API key availability..."
if [ -n "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "✅ GitHub secret OPENAI_API_KEY is available"
echo "🔑 API key starts with: $(echo "$OPENAI_API_KEY" | cut -c1-7)..."
else
echo "⚠️ GitHub secret OPENAI_API_KEY is NOT set - using fallback"
echo "🔑 Using fallback key: sk-test-key..."
fi
echo "🌐 API Base: $OPENAI_API_BASE"
echo "🤖 Model: $OPENAI_MODEL_NAME"
echo "🐛 Log Level: $LOGLEVEL"
echo "📊 Environment Check:"
echo " - OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
echo " - OPENAI_API_BASE: $OPENAI_API_BASE"
echo " - OPENAI_MODEL_NAME: $OPENAI_MODEL_NAME"
echo " - LOGLEVEL: $LOGLEVEL"
- name: Debug Python Environment Variables
run: |
python -c "
import os
print('🐍 Python Environment Variable Check:')
api_key = os.environ.get('OPENAI_API_KEY', 'NOT_SET')
if api_key != 'NOT_SET':
print(f' ✅ OPENAI_API_KEY: {api_key[:7]}... (length: {len(api_key)})')
else:
print(' ❌ OPENAI_API_KEY: NOT_SET')
print(f' 🌐 OPENAI_API_BASE: {os.environ.get(\"OPENAI_API_BASE\", \"NOT_SET\")}')
print(f' 🤖 OPENAI_MODEL_NAME: {os.environ.get(\"OPENAI_MODEL_NAME\", \"NOT_SET\")}')
print(f' 📋 All OPENAI env vars:')
for key, value in os.environ.items():
if key.startswith('OPENAI'):
print(f' {key}: {value[:10] if len(value) > 10 else value}...')
"
- name: Find Researcher Role Source
run: |
echo "🔍 Hunting for the mysterious 'Researcher' role..."
cd src/praisonai
python -c "
import os
import yaml
import glob
print('📋 Searching for Researcher role in all YAML files:')
yaml_files = glob.glob('src/praisonai/tests/*.yaml')
for yaml_file in yaml_files:
try:
with open(yaml_file, 'r') as f:
config = yaml.safe_load(f)
# Check if any role contains 'researcher'
roles = config.get('roles', {})
for role_key, role_data in roles.items():
role_name = role_data.get('role', '')
if 'researcher' in role_key.lower() or 'researcher' in role_name.lower():
print(f' 🎯 FOUND in {yaml_file}:')
print(f' Framework: {config.get(\"framework\", \"NOT_SET\")}')
print(f' Role key: {role_key}')
print(f' Role name: {role_name}')
print(f' All roles: {list(roles.keys())}')
print()
except Exception as e:
print(f' ❌ Error reading {yaml_file}: {e}')
print('🔍 Checking for default configurations...')
# Check if there are any default configs or hardcoded roles
try:
import praisonai
print(f' PraisonAI package location: {praisonai.__file__}')
# Check if there are any example YAML files in the package
package_dir = os.path.dirname(praisonai.__file__)
for root, dirs, files in os.walk(package_dir):
for file in files:
if file.endswith(('.yaml', '.yml')):
file_path = os.path.join(root, file)
print(f' 📁 Found YAML in package: {file_path}')
except Exception as e:
print(f' ❌ Error checking package: {e}')
"
continue-on-error: true
- name: Trace AutoGen Execution Path
run: |
echo "🔍 Tracing AutoGen execution to find where it diverges..."
cd src/praisonai
python -c "
import os
import sys
sys.path.insert(0, '.')
try:
from praisonai import PraisonAI
from praisonai.agents_generator import AgentsGenerator
# Test the exact execution path
print('🎯 Testing AutoGen execution path:')
praisonai = PraisonAI(agent_file='tests/autogen-agents.yaml')
print(f' 1. PraisonAI framework: \"{praisonai.framework}\"')
agents_gen = AgentsGenerator(
agent_file='tests/autogen-agents.yaml',
framework=praisonai.framework,
config_list=praisonai.config_list
)
print(f' 2. AgentsGenerator framework: \"{agents_gen.framework}\"')
# Load the YAML to check what it contains
import yaml
with open('src/praisonai/tests/autogen-agents.yaml', 'r') as f:
config = yaml.safe_load(f)
framework = agents_gen.framework or config.get('framework')
print(f' 3. Final framework decision: \"{framework}\"')
print(f' 4. Available frameworks:')
# Check framework availability
try:
import autogen
print(f' ✅ AutoGen available')
except ImportError:
print(f' ❌ AutoGen NOT available')
try:
from praisonaiagents import Agent
print(f' ✅ PraisonAI agents available')
except ImportError:
print(f' ❌ PraisonAI agents NOT available')
try:
from crewai import Agent
print(f' ✅ CrewAI available')
except ImportError:
print(f' ❌ CrewAI NOT available')
print(f' 5. Roles in YAML: {list(config.get(\"roles\", {}).keys())}')
# Now test the actual framework execution
if framework == 'autogen':
print(f' 6. ✅ Should execute _run_autogen')
elif framework == 'praisonai':
print(f' 6. ❌ Would execute _run_praisonai (WRONG!)')
else:
print(f' 6. ❌ Would execute _run_crewai (DEFAULT FALLBACK)')
except Exception as e:
print(f'❌ Error tracing execution: {e}')
import traceback
traceback.print_exc()
"
continue-on-error: true
- name: Debug YAML Loading and Roles
run: |
echo "🔍 Tracing YAML file loading and role creation..."
cd src/praisonai
python -c "
import os
import sys
import yaml
sys.path.insert(0, '.')
print('📁 Available YAML files in src/praisonai/tests/:')
import glob
yaml_files = glob.glob('tests/*.yaml')
for f in yaml_files:
print(f' {f}')
print()
print('📋 Content of autogen-agents.yaml:')
with open('tests/autogen-agents.yaml', 'r') as f:
config = yaml.safe_load(f)
print(f' Framework: {config.get(\"framework\")}')
print(f' Topic: {config.get(\"topic\")}')
print(f' Roles: {list(config.get(\"roles\", {}).keys())}')
for role_key, role_data in config.get('roles', {}).items():
print(f' {role_key} -> {role_data.get(\"role\", \"NO_ROLE\")}')
print()
print('🔍 Checking if execution uses a different YAML:')
# Check other YAML files for 'Researcher' role
for yaml_file in yaml_files:
try:
with open(yaml_file, 'r') as f:
test_config = yaml.safe_load(f)
roles = test_config.get('roles', {})
for role_key, role_data in roles.items():
if 'researcher' in role_key.lower() or 'researcher' in role_data.get('role', '').lower():
print(f' 🎯 FOUND Researcher in {yaml_file}!')
print(f' Framework: {test_config.get(\"framework\")}')
print(f' Role key: {role_key} -> {role_data.get(\"role\")}')
except:
pass
"
continue-on-error: true
- name: Debug Framework Detection
run: |
echo "🔍 Testing framework detection and config flow..."
python -c "
import os
import sys
import yaml
sys.path.insert(0, '.')
print('🔧 Testing framework detection:')
# Load the YAML file
with open('tests/autogen-agents.yaml', 'r') as f:
config = yaml.safe_load(f)
print(f' 📋 YAML framework: {config.get(\"framework\", \"NOT_SET\")}')
print(f' 📋 YAML topic: {config.get(\"topic\", \"NOT_SET\")}')
try:
from praisonai import PraisonAI
from praisonai.agents_generator import AgentsGenerator
# Test PraisonAI initialization
praisonai = PraisonAI(agent_file='tests/autogen-agents.yaml')
print(f' 🎯 PraisonAI framework: {praisonai.framework}')
# Test AgentsGenerator initialization
agents_gen = AgentsGenerator(
agent_file='tests/autogen-agents.yaml',
framework=praisonai.framework,
config_list=praisonai.config_list
)
print(f' ⚙️ AgentsGenerator framework: {agents_gen.framework}')
print(f' ⚙️ Final framework decision: {agents_gen.framework or config.get(\"framework\")}')
# Check config_list
print(f' 🔑 Config list model: {praisonai.config_list[0].get(\"model\")}')
print(f' 🔑 Config list API key: {praisonai.config_list[0].get(\"api_key\", \"NOT_SET\")[:10]}...')
except Exception as e:
print(f'❌ Error in framework detection: {e}')
"
continue-on-error: true
- name: Debug PraisonAIModel API Key Flow
run: |
echo "🔍 Testing PraisonAIModel API key handling..."
cd src/praisonai
python -c "
import os
import sys
sys.path.insert(0, '.')
print('🔑 Environment API Key Check:')
env_key = os.environ.get('OPENAI_API_KEY', 'NOT_FOUND')
print(f' OPENAI_API_KEY: {env_key[:10] if env_key != \"NOT_FOUND\" else \"NOT_FOUND\"}...')
try:
from praisonai.inc.models import PraisonAIModel
# Test PraisonAIModel with openai/gpt-5-nano (from YAML)
model = PraisonAIModel(model='openai/gpt-5-nano')
print('🤖 PraisonAIModel Configuration:')
print(f' model: {model.model}')
print(f' model_name: {model.model_name}')
print(f' api_key_var: {model.api_key_var}')
print(f' api_key: {model.api_key[:10] if model.api_key != \"nokey\" else \"DEFAULT_NOKEY\"}...')
print(f' base_url: {model.base_url}')
if model.api_key == 'nokey':
print('❌ FOUND THE ISSUE: PraisonAIModel is using default \"nokey\" instead of environment variable!')
else:
print('✅ PraisonAIModel has valid API key from environment')
except Exception as e:
print(f'❌ Error testing PraisonAIModel: {e}')
"
continue-on-error: true
- name: Validate API Key
run: |
echo "🔑 Testing API key validity with minimal OpenAI call..."
python -c "
import os
try:
from openai import OpenAI
client = OpenAI(api_key=os.environ.get('OPENAI_API_KEY'))
# Make a minimal API call to test key validity
response = client.models.list()
print('✅ API Key is VALID - OpenAI responded successfully')
print(f'📊 Available models: {len(list(response.data))} models found')
except Exception as e:
print(f'❌ API Key is INVALID - Error: {e}')
print('🔍 This explains why all API-dependent tests are failing')
print('💡 The GitHub secret OPENAI_API_KEY needs to be updated with a valid key')
"
continue-on-error: true
- name: Test Direct PraisonAI Execution
run: |
echo "🧪 Testing direct PraisonAI execution (what works locally)..."
python -m praisonai src/praisonai/tests/autogen-agents.yaml
continue-on-error: true
- name: Comprehensive Execution Debug
run: |
echo "🔍 Comprehensive debugging of PraisonAI execution path..."
cd src/praisonai
python -c "
import os
import sys
import yaml
sys.path.insert(0, '.')
print('=' * 60)
print('🔍 COMPREHENSIVE EXECUTION DEBUG')
print('=' * 60)
# Check current working directory
print(f'📁 Current working directory: {os.getcwd()}')
# List files in current directory
print('📋 Files in current directory:')
for f in os.listdir('.'):
print(f' {f}')
print()
print('📋 Files in src/praisonai/tests/ directory:')
for f in os.listdir('tests'):
if f.endswith('.yaml'):
print(f' src/praisonai/tests/{f}')
# Check if root agents.yaml exists
print()
if os.path.exists('agents.yaml'):
print('❌ ROOT agents.yaml EXISTS (this is the problem!)')
with open('agents.yaml', 'r') as f:
root_config = yaml.safe_load(f)
print(f' Root framework: {root_config.get(\"framework\")}')
print(f' Root roles: {list(root_config.get(\"roles\", {}).keys())}')
else:
print('✅ ROOT agents.yaml does NOT exist (good!)')
# Test the actual execution path
print()
print('🎯 Testing EXACT execution path:')
try:
from praisonai import PraisonAI
from praisonai.agents_generator import AgentsGenerator
# Test with full path
test_file = 'src/praisonai/tests/autogen-agents.yaml'
print(f' Using test file: {test_file}')
print(f' File exists: {os.path.exists(test_file)}')
# Load the test file directly
with open(test_file, 'r') as f:
test_config = yaml.safe_load(f)
print(f' Test file framework: {test_config.get(\"framework\")}')
print(f' Test file roles: {list(test_config.get(\"roles\", {}).keys())}')
# Create PraisonAI instance
praisonai = PraisonAI(agent_file=test_file)
print(f' PraisonAI.agent_file: {praisonai.agent_file}')
print(f' PraisonAI.framework: {praisonai.framework}')
# Create AgentsGenerator
agents_gen = AgentsGenerator(
agent_file=test_file,
framework=praisonai.framework,
config_list=praisonai.config_list
)
print(f' AgentsGenerator.agent_file: {agents_gen.agent_file}')
print(f' AgentsGenerator.framework: {agents_gen.framework}')
# Test what would happen in generate_crew_and_kickoff
print()
print('🔧 Testing generate_crew_and_kickoff logic:')
# Simulate the loading logic
if agents_gen.agent_yaml:
loaded_config = yaml.safe_load(agents_gen.agent_yaml)
print(' Would load from agent_yaml')
else:
if agents_gen.agent_file == '/app/api:app' or agents_gen.agent_file == 'api:app':
agents_gen.agent_file = 'agents.yaml'
print(f' Would change agent_file to: {agents_gen.agent_file}')
try:
with open(agents_gen.agent_file, 'r') as f:
loaded_config = yaml.safe_load(f)
print(f' Successfully loaded: {agents_gen.agent_file}')
except FileNotFoundError:
print(f' FileNotFoundError: {agents_gen.agent_file}')
loaded_config = None
if loaded_config:
final_framework = agents_gen.framework or loaded_config.get('framework')
print(f' Final framework decision: {final_framework}')
print(f' Loaded roles: {list(loaded_config.get(\"roles\", {}).keys())}')
if 'researcher' in loaded_config.get('roles', {}):
print(' ❌ FOUND Researcher role in loaded config!')
else:
print(' ✅ No Researcher role in loaded config')
except Exception as e:
print(f'❌ Error during execution debug: {e}')
import traceback
traceback.print_exc()
"
continue-on-error: true
- name: Run Fast Tests
run: |
# Run the fastest, most essential tests with coverage
cd src/praisonai && python -m pytest tests/unit/test_core_agents.py -v --tb=short --disable-warnings --cov=praisonai --cov-report=xml --cov-branch
- name: Run Real API Tests
run: |
echo "🔑 Running real API tests with actual OpenAI API key..."
cd src/praisonai && python -m pytest tests/test_agents_playbook.py -v --tb=short --disable-warnings -m real
continue-on-error: true
- name: Run E2E Real Tests
run: |
echo "🧪 Running E2E real tests..."
cd src/praisonai && python -m pytest tests/e2e/ -v --tb=short --disable-warnings -m real
continue-on-error: true
- name: Run Legacy Example Tests
run: |
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings -m "not real" --timeout=60
continue-on-error: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: src/praisonai/coverage.xml
flags: quick-validation
name: quick-validation-coverage
fail_ci_if_error: false
verbose: true
- name: Restore Root Config Files
run: |
echo "🔄 Restoring root configuration files..."
if [ -f "agents.yaml.backup" ]; then
mv agents.yaml.backup agents.yaml
echo "✅ Restored agents.yaml"
fi
if [ -f "tools.py.backup" ]; then
mv tools.py.backup tools.py
echo "✅ Restored tools.py"
fi
if: always() # Always run this step, even if previous steps failed
+57
View File
@@ -0,0 +1,57 @@
name: Update API Reference
on:
push:
branches: [ "main" ]
paths:
- 'src/praisonai-agents/praisonaiagents/**/*.py'
- 'src/praisonai/praisonai/**/*.py'
- 'src/praisonai-ts/src/**/*.ts'
- '.github/workflows/update-api-md.yml'
permissions:
contents: write
jobs:
update-api-md:
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 api.md
run: |
cd $GITHUB_WORKSPACE
python3 src/praisonai/scripts/generate_api_md.py
- name: Check for changes
id: check_changes
run: |
if git diff --quiet api.md; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes to api.md"
else
echo "changes=true" >> $GITHUB_OUTPUT
echo "api.md has been updated"
git diff api.md | 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 api.md [skip ci]"
file_pattern: 'api.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>"
+20 -1
View File
@@ -1,3 +1,4 @@
workspace.code-workspace
.vscode
crewai
.cache
@@ -19,6 +20,7 @@ watch.sh
docs.sh
other
output
!src/praisonai/praisonai/cli/output/
.files
threads.db
@@ -51,6 +53,10 @@ agentops.log
# crewAI
crewAI
!tests/integration/crewai
!tests/e2e/crewai
!src/praisonai/tests/integration/crewai
!src/praisonai/tests/e2e/crewai
# virtualenv
.venv
@@ -65,4 +71,17 @@ outputs
agents/praisonaiagents/build
agents/praisonaiagents/dist
agents/praisonaiagents/praisonaiagents.egg-info
.codegpt
.codegpt
.praison
# Local Netlify folder
.netlify
.qodo
CopilotKit*
.gemini
issue_details.json
# MCP Registry tokens
.mcpregistry_*
*.log
.internal
-23
View File
@@ -1,23 +0,0 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
post_install:
- bash docs/generate_docs.sh
mkdocs:
configuration: mkdocs.yml
fail_on_warning: true
python:
install:
- requirements: docs/requirements.txt
-6
View File
@@ -1,6 +0,0 @@
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install flask praisonai==2.0.31 gunicorn markdown
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
-28
View File
@@ -1,28 +0,0 @@
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
portaudio19-dev \
python3-pyaudio \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages
RUN pip install --no-cache-dir \
praisonaiagents>=0.0.4 \
praisonai_tools \
"praisonai==2.0.18" \
"praisonai[ui]" \
"praisonai[chat]" \
"praisonai[realtime]" \
"embedchain[github,youtube]"
# Copy application code
COPY . .
# Default command (will be overridden by docker-compose)
CMD ["praisonai", "ui"]
+3297 -455
View File
File diff suppressed because it is too large. Load diff
-43
View File
@@ -1,43 +0,0 @@
framework: praisonai
process: sequential
topic: create movie script about cat in mars
roles:
researcher:
backstory: Skilled in research, with a focus on gathering accurate and relevant
information.
goal: Gather information about Mars and cats
role: Researcher
min_reflect: 1
max_reflect: 2
tasks:
research_task:
description: Research about Mars, its environment, and the feasibility of
a cat being on Mars. Also, research about cat behavior and characteristics.
expected_output: Document with research findings on Mars and cats.
tools:
- search_tool
narrative_designer:
backstory: Skilled in narrative development, with a focus on creating engaging
stories.
goal: Create a story concept for a movie about a cat in Mars
role: Narrative Designer
tasks:
story_concept_development:
description: Use the research findings to craft a unique story concept for
a movie about a cat in Mars.
expected_output: Document with narrative arcs, character bios, and settings.
tools:
- ''
scriptwriter:
backstory: Expert in dialogue and script structure, translating concepts into
scripts.
goal: Write a movie script about a cat in Mars
role: Scriptwriter
tasks:
scriptwriting_task:
description: Turn the story concept into a production-ready movie script,
including dialogue and scene details.
expected_output: Final movie script with dialogue and scene details.
tools:
- ''
dependencies: []
-47
View File
@@ -1,47 +0,0 @@
"""
Praison AI Agents - A package for hierarchical AI agent task execution
"""
from .agent.agent import Agent
from .agents.agents import PraisonAIAgents
from .task.task import Task
from .tools.tools import Tools
from .main import (
TaskOutput,
ReflectionOutput,
display_interaction,
display_self_reflection,
display_instruction,
display_tool_call,
display_error,
display_generating,
clean_triple_backticks,
error_logs,
register_display_callback,
sync_display_callbacks,
async_display_callbacks,
)
# Add Agents as an alias for PraisonAIAgents
Agents = PraisonAIAgents
__all__ = [
'Agent',
'PraisonAIAgents',
'Agents',
'Tools',
'Task',
'TaskOutput',
'ReflectionOutput',
'display_interaction',
'display_self_reflection',
'display_instruction',
'display_tool_call',
'display_error',
'display_generating',
'clean_triple_backticks',
'error_logs',
'register_display_callback',
'sync_display_callbacks',
'async_display_callbacks',
]
-4
View File
@@ -1,4 +0,0 @@
"""Agent module for AI agents"""
from .agent import Agent
__all__ = ['Agent']
-725
View File
@@ -1,725 +0,0 @@
import os
import time
import json
import logging
import asyncio
from typing import List, Optional, Any, Dict, Union, Literal, TYPE_CHECKING
from rich.console import Console
from rich.live import Live
from openai import AsyncOpenAI
from ..main import (
display_error,
display_tool_call,
display_instruction,
display_interaction,
display_generating,
display_self_reflection,
ReflectionOutput,
client,
error_logs
)
if TYPE_CHECKING:
from ..task.task import Task
class Agent:
def _generate_tool_definition(self, function_name):
"""
Generate a tool definition from a function name by inspecting the function.
"""
logging.debug(f"Attempting to generate tool definition for: {function_name}")
# First try to get the tool definition if it exists
tool_def_name = f"{function_name}_definition"
tool_def = globals().get(tool_def_name)
logging.debug(f"Looking for {tool_def_name} in globals: {tool_def is not None}")
if not tool_def:
import __main__
tool_def = getattr(__main__, tool_def_name, None)
logging.debug(f"Looking for {tool_def_name} in __main__: {tool_def is not None}")
if tool_def:
logging.debug(f"Found tool definition: {tool_def}")
return tool_def
# Try to find the function in the agent's tools list first
func = None
for tool in self.tools:
if callable(tool) and getattr(tool, '__name__', '') == function_name:
func = tool
break
logging.debug(f"Looking for {function_name} in agent tools: {func is not None}")
# If not found in tools, try globals and main
if not func:
func = globals().get(function_name)
logging.debug(f"Looking for {function_name} in globals: {func is not None}")
if not func:
import __main__
func = getattr(__main__, function_name, None)
logging.debug(f"Looking for {function_name} in __main__: {func is not None}")
if not func or not callable(func):
logging.debug(f"Function {function_name} not found or not callable")
return None
import inspect
sig = inspect.signature(func)
logging.debug(f"Function signature: {sig}")
parameters = {
"type": "object",
"properties": {},
"required": []
}
# Parse docstring for parameter descriptions
docstring = inspect.getdoc(func)
logging.debug(f"Function docstring: {docstring}")
param_descriptions = {}
if docstring:
import re
param_section = re.split(r'\s*Args:\s*', docstring)
logging.debug(f"Param section split: {param_section}")
if len(param_section) > 1:
param_lines = param_section[1].split('\n')
for line in param_lines:
line = line.strip()
if line and ':' in line:
param_name, param_desc = line.split(':', 1)
param_descriptions[param_name.strip()] = param_desc.strip()
logging.debug(f"Parameter descriptions: {param_descriptions}")
for name, param in sig.parameters.items():
param_type = "string" # Default type
if param.annotation != inspect.Parameter.empty:
if param.annotation == int:
param_type = "integer"
elif param.annotation == float:
param_type = "number"
elif param.annotation == bool:
param_type = "boolean"
elif param.annotation == list:
param_type = "array"
elif param.annotation == dict:
param_type = "object"
param_info = {"type": param_type}
if name in param_descriptions:
param_info["description"] = param_descriptions[name]
parameters["properties"][name] = param_info
if param.default == inspect.Parameter.empty:
parameters["required"].append(name)
logging.debug(f"Generated parameters: {parameters}")
# Extract description from docstring
description = docstring.split('\n')[0] if docstring else f"Function {function_name}"
tool_def = {
"type": "function",
"function": {
"name": function_name,
"description": description,
"parameters": parameters
}
}
logging.debug(f"Generated tool definition: {tool_def}")
return tool_def
def __init__(
self,
name: Optional[str] = None,
role: Optional[str] = None,
goal: Optional[str] = None,
backstory: Optional[str] = None,
instructions: Optional[str] = None,
llm: Optional[Union[str, Any]] = None,
tools: Optional[List[Any]] = None,
function_calling_llm: Optional[Any] = None,
max_iter: int = 20,
max_rpm: Optional[int] = None,
max_execution_time: Optional[int] = None,
memory: bool = True,
verbose: bool = True,
allow_delegation: bool = False,
step_callback: Optional[Any] = None,
cache: bool = True,
system_template: Optional[str] = None,
prompt_template: Optional[str] = None,
response_template: Optional[str] = None,
allow_code_execution: Optional[bool] = False,
max_retry_limit: int = 2,
respect_context_window: bool = True,
code_execution_mode: Literal["safe", "unsafe"] = "safe",
embedder_config: Optional[Dict[str, Any]] = None,
knowledge_sources: Optional[List[Any]] = None,
use_system_prompt: Optional[bool] = True,
markdown: bool = True,
self_reflect: Optional[bool] = None,
max_reflect: int = 3,
min_reflect: int = 1,
reflect_llm: Optional[str] = None
):
# Handle backward compatibility for required fields
if all(x is None for x in [name, role, goal, backstory, instructions]):
raise ValueError("At least one of name, role, goal, backstory, or instructions must be provided")
# If instructions are provided, use them to set role, goal, and backstory
if instructions:
self.name = name or "Agent"
self.role = role or "Assistant"
self.goal = goal or instructions
self.backstory = backstory or instructions
# Set self_reflect to False by default for instruction-based agents
self.self_reflect = False if self_reflect is None else self_reflect
else:
# Use provided values or defaults
self.name = name or "Agent"
self.role = role or "Assistant"
self.goal = goal or "Help the user with their tasks"
self.backstory = backstory or "I am an AI assistant"
# Default to True for traditional agents if not specified
self.self_reflect = True if self_reflect is None else self_reflect
self.instructions = instructions
# Check for model name in environment variable if not provided
self.llm = llm or os.getenv('OPENAI_MODEL_NAME', 'gpt-4o')
self.tools = tools if tools else [] # Store original tools
self.function_calling_llm = function_calling_llm
self.max_iter = max_iter
self.max_rpm = max_rpm
self.max_execution_time = max_execution_time
self.memory = memory
self.verbose = verbose
self.allow_delegation = allow_delegation
self.step_callback = step_callback
self.cache = cache
self.system_template = system_template
self.prompt_template = prompt_template
self.response_template = response_template
self.allow_code_execution = allow_code_execution
self.max_retry_limit = max_retry_limit
self.respect_context_window = respect_context_window
self.code_execution_mode = code_execution_mode
self.embedder_config = embedder_config
self.knowledge_sources = knowledge_sources
self.use_system_prompt = use_system_prompt
self.chat_history = []
self.markdown = markdown
self.max_reflect = max_reflect
self.min_reflect = min_reflect
# Use the same model selection logic for reflect_llm
self.reflect_llm = reflect_llm or os.getenv('OPENAI_MODEL_NAME', 'gpt-4o')
self.console = Console() # Create a single console instance for the agent
# Initialize system prompt
self.system_prompt = f"""{self.backstory}\n
Your Role: {self.role}\n
Your Goal: {self.goal}
"""
def generate_task(self) -> 'Task':
"""Generate a Task object from the agent's instructions"""
from ..task.task import Task
description = self.instructions if self.instructions else f"Execute task as {self.role} with goal: {self.goal}"
expected_output = "Complete the assigned task successfully"
return Task(
name=self.name,
description=description,
expected_output=expected_output,
agent=self,
tools=self.tools
)
def execute_tool(self, function_name, arguments):
"""
Execute a tool dynamically based on the function name and arguments.
"""
logging.debug(f"{self.name} executing tool {function_name} with arguments: {arguments}")
# Try to find the function in the agent's tools list first
func = None
for tool in self.tools:
if callable(tool) and getattr(tool, '__name__', '') == function_name:
func = tool
break
logging.debug(f"Looking for {function_name} in agent tools: {func is not None}")
# If not found in tools, try globals and main
if not func:
func = globals().get(function_name)
logging.debug(f"Looking for {function_name} in globals: {func is not None}")
if not func:
import __main__
func = getattr(__main__, function_name, None)
logging.debug(f"Looking for {function_name} in __main__: {func is not None}")
if func and callable(func):
try:
return func(**arguments)
except Exception as e:
error_msg = str(e)
logging.error(f"Error executing tool {function_name}: {error_msg}")
return {"error": error_msg}
error_msg = f"Tool '{function_name}' is not callable"
logging.error(error_msg)
return {"error": error_msg}
def clear_history(self):
self.chat_history = []
def __str__(self):
return f"Agent(name='{self.name}', role='{self.role}', goal='{self.goal}')"
def _chat_completion(self, messages, temperature=0.2, tools=None, stream=True):
start_time = time.time()
logging.debug(f"{self.name} sending messages to LLM: {messages}")
formatted_tools = []
if tools is None:
tools = self.tools
if tools:
for tool in tools:
if isinstance(tool, str):
# Generate tool definition for string tool names
tool_def = self._generate_tool_definition(tool)
if tool_def:
formatted_tools.append(tool_def)
else:
logging.warning(f"Could not generate definition for tool: {tool}")
elif isinstance(tool, dict):
formatted_tools.append(tool)
elif hasattr(tool, "to_openai_tool"):
formatted_tools.append(tool.to_openai_tool())
elif callable(tool):
formatted_tools.append(self._generate_tool_definition(tool.__name__))
else:
logging.warning(f"Tool {tool} not recognized")
try:
initial_response = client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature,
tools=formatted_tools if formatted_tools else None,
stream=False
)
tool_calls = getattr(initial_response.choices[0].message, 'tool_calls', None)
if tool_calls:
messages.append({
"role": "assistant",
"content": initial_response.choices[0].message.content,
"tool_calls": tool_calls
})
for tool_call in tool_calls:
function_name = tool_call.function.name
arguments = json.loads(tool_call.function.arguments)
if self.verbose:
display_tool_call(f"Agent {self.name} is calling function '{function_name}' with arguments: {arguments}")
tool_result = self.execute_tool(function_name, arguments)
results_str = json.dumps(tool_result) if tool_result else "Function returned an empty output"
if self.verbose:
display_tool_call(f"Function '{function_name}' returned: {results_str}")
messages.append({
"role": "tool",
"tool_call_id": tool_call.id,
"content": results_str
})
if stream:
response_stream = client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature,
stream=True
)
full_response_text = ""
# Create Live display with proper configuration
with Live(
display_generating("", start_time),
console=self.console,
refresh_per_second=4,
transient=False, # Changed to False to preserve output
vertical_overflow="ellipsis",
auto_refresh=True
) as live:
for chunk in response_stream:
if chunk.choices[0].delta.content:
full_response_text += chunk.choices[0].delta.content
live.update(display_generating(full_response_text, start_time))
# Clear the last generating display with a blank line
self.console.print()
final_response = client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature,
stream=False
)
return final_response
else:
if tool_calls:
final_response = client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature,
stream=False
)
return final_response
else:
return initial_response
except Exception as e:
display_error(f"Error in chat completion: {e}")
return None
def chat(self, prompt, temperature=0.2, tools=None, output_json=None):
if self.use_system_prompt:
system_prompt = f"""{self.backstory}\n
Your Role: {self.role}\n
Your Goal: {self.goal}
"""
if output_json:
system_prompt += f"\nReturn ONLY a JSON object that matches this Pydantic model: {output_json.schema_json()}"
else:
system_prompt = None
messages = []
if system_prompt:
messages.append({"role": "system", "content": system_prompt})
messages.extend(self.chat_history)
# Modify prompt if output_json is specified
original_prompt = prompt
if output_json:
if isinstance(prompt, str):
prompt += "\nReturn ONLY a valid JSON object. No other text or explanation."
elif isinstance(prompt, list):
# For multimodal prompts, append to the text content
for item in prompt:
if item["type"] == "text":
item["text"] += "\nReturn ONLY a valid JSON object. No other text or explanation."
break
if isinstance(prompt, list):
# If we receive a multimodal prompt list, place it directly in the user message
messages.append({"role": "user", "content": prompt})
else:
messages.append({"role": "user", "content": prompt})
final_response_text = None
reflection_count = 0
start_time = time.time()
while True:
try:
if self.verbose:
# Handle both string and list prompts for instruction display
display_text = prompt
if isinstance(prompt, list):
# Extract text content from multimodal prompt
display_text = next((item["text"] for item in prompt if item["type"] == "text"), "")
if display_text and str(display_text).strip():
display_instruction(f"Agent {self.name} is processing prompt: {display_text}", console=self.console)
response = self._chat_completion(messages, temperature=temperature, tools=tools if tools else None)
if not response:
return None
tool_calls = getattr(response.choices[0].message, 'tool_calls', None)
response_text = response.choices[0].message.content.strip()
if tool_calls:
messages.append({
"role": "assistant",
"content": response_text,
"tool_calls": tool_calls
})
for tool_call in tool_calls:
function_name = tool_call.function.name
arguments = json.loads(tool_call.function.arguments)
if self.verbose:
display_tool_call(f"Agent {self.name} is calling function '{function_name}' with arguments: {arguments}", console=self.console)
tool_result = self.execute_tool(function_name, arguments)
if tool_result:
if self.verbose:
display_tool_call(f"Function '{function_name}' returned: {tool_result}", console=self.console)
messages.append({
"role": "tool",
"tool_call_id": tool_call.id,
"content": json.dumps(tool_result)
})
else:
messages.append({
"role": "tool",
"tool_call_id": tool_call.id,
"content": "Function returned an empty output"
})
response = self._chat_completion(messages, temperature=temperature)
if not response:
return None
response_text = response.choices[0].message.content.strip()
# Handle output_json if specified
if output_json:
try:
# Clean the response text to get only JSON
cleaned_json = self.clean_json_output(response_text)
# Parse into Pydantic model
parsed_model = output_json.model_validate_json(cleaned_json)
# Add to chat history and return
self.chat_history.append({"role": "user", "content": original_prompt})
self.chat_history.append({"role": "assistant", "content": response_text})
if self.verbose:
display_interaction(original_prompt, response_text, markdown=self.markdown,
generation_time=time.time() - start_time, console=self.console)
return parsed_model
except Exception as e:
display_error(f"Failed to parse response as {output_json.__name__}: {e}")
return None
if not self.self_reflect:
self.chat_history.append({"role": "user", "content": original_prompt})
self.chat_history.append({"role": "assistant", "content": response_text})
if self.verbose:
logging.info(f"Agent {self.name} final response: {response_text}")
display_interaction(original_prompt, response_text, markdown=self.markdown, generation_time=time.time() - start_time, console=self.console)
return response_text
reflection_prompt = f"""
Reflect on your previous response: '{response_text}'.
Identify any flaws, improvements, or actions.
Provide a "satisfactory" status ('yes' or 'no').
Output MUST be JSON with 'reflection' and 'satisfactory'.
"""
logging.debug(f"{self.name} reflection attempt {reflection_count+1}, sending prompt: {reflection_prompt}")
messages.append({"role": "user", "content": reflection_prompt})
try:
reflection_response = client.beta.chat.completions.parse(
model=self.reflect_llm if self.reflect_llm else self.llm,
messages=messages,
temperature=temperature,
response_format=ReflectionOutput
)
reflection_output = reflection_response.choices[0].message.parsed
if self.verbose:
display_self_reflection(f"Agent {self.name} self reflection (using {self.reflect_llm if self.reflect_llm else self.llm}): reflection='{reflection_output.reflection}' satisfactory='{reflection_output.satisfactory}'", console=self.console)
messages.append({"role": "assistant", "content": f"Self Reflection: {reflection_output.reflection} Satisfactory?: {reflection_output.satisfactory}"})
# Only consider satisfactory after minimum reflections
if reflection_output.satisfactory == "yes" and reflection_count >= self.min_reflect - 1:
if self.verbose:
display_self_reflection("Agent marked the response as satisfactory after meeting minimum reflections", console=self.console)
self.chat_history.append({"role": "user", "content": prompt})
self.chat_history.append({"role": "assistant", "content": response_text})
display_interaction(prompt, response_text, markdown=self.markdown, generation_time=time.time() - start_time, console=self.console)
return response_text
# Check if we've hit max reflections
if reflection_count >= self.max_reflect - 1:
if self.verbose:
display_self_reflection("Maximum reflection count reached, returning current response", console=self.console)
self.chat_history.append({"role": "user", "content": prompt})
self.chat_history.append({"role": "assistant", "content": response_text})
display_interaction(prompt, response_text, markdown=self.markdown, generation_time=time.time() - start_time, console=self.console)
return response_text
logging.debug(f"{self.name} reflection count {reflection_count + 1}, continuing reflection process")
messages.append({"role": "user", "content": "Now regenerate your response using the reflection you made"})
response = self._chat_completion(messages, temperature=temperature, tools=None, stream=True)
response_text = response.choices[0].message.content.strip()
reflection_count += 1
continue # Continue the loop for more reflections
except Exception as e:
display_error(f"Error in parsing self-reflection json {e}. Retrying", console=self.console)
logging.error("Reflection parsing failed.", exc_info=True)
messages.append({"role": "assistant", "content": f"Self Reflection failed."})
reflection_count += 1
continue # Continue even after error to try again
except Exception as e:
display_error(f"Error in chat: {e}", console=self.console)
return None
def clean_json_output(self, output: str) -> str:
"""Clean and extract JSON from response text."""
cleaned = output.strip()
# Remove markdown code blocks if present
if cleaned.startswith("```json"):
cleaned = cleaned[len("```json"):].strip()
if cleaned.startswith("```"):
cleaned = cleaned[len("```"):].strip()
if cleaned.endswith("```"):
cleaned = cleaned[:-3].strip()
return cleaned
async def achat(self, prompt, temperature=0.2, tools=None, output_json=None):
"""Async version of chat method"""
try:
# Build system prompt
system_prompt = self.system_prompt
if output_json:
system_prompt += f"\nReturn ONLY a JSON object that matches this Pydantic model: {output_json.schema_json()}"
# Build messages
if isinstance(prompt, str):
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": prompt + ("\nReturn ONLY a valid JSON object. No other text or explanation." if output_json else "")}
]
else:
# For multimodal prompts
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": prompt}
]
if output_json:
# Add JSON instruction to text content
for item in messages[-1]["content"]:
if item["type"] == "text":
item["text"] += "\nReturn ONLY a valid JSON object. No other text or explanation."
break
# Format tools if provided
formatted_tools = []
if tools:
for tool in tools:
if isinstance(tool, str):
tool_def = self._generate_tool_definition(tool)
if tool_def:
formatted_tools.append(tool_def)
elif isinstance(tool, dict):
formatted_tools.append(tool)
elif hasattr(tool, "to_openai_tool"):
formatted_tools.append(tool.to_openai_tool())
elif callable(tool):
formatted_tools.append(self._generate_tool_definition(tool.__name__))
# Create async OpenAI client
async_client = AsyncOpenAI()
# Make the API call based on the type of request
if tools:
response = await async_client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature,
tools=formatted_tools
)
return await self._achat_completion(response, tools)
elif output_json:
response = await async_client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature,
response_format={"type": "json_object"}
)
result = response.choices[0].message.content
# Clean and parse the JSON response
cleaned_json = self.clean_json_output(result)
try:
parsed = json.loads(cleaned_json)
return output_json(**parsed)
except Exception as e:
display_error(f"Error parsing JSON response: {e}")
return None
else:
response = await async_client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=temperature
)
return response.choices[0].message.content
except Exception as e:
display_error(f"Error in chat completion: {e}")
return None
async def _achat_completion(self, response, tools):
"""Async version of _chat_completion method"""
try:
message = response.choices[0].message
if not hasattr(message, 'tool_calls') or not message.tool_calls:
return message.content
results = []
for tool_call in message.tool_calls:
try:
function_name = tool_call.function.name
arguments = json.loads(tool_call.function.arguments)
# Find the matching tool
tool = next((t for t in tools if t.__name__ == function_name), None)
if not tool:
display_error(f"Tool {function_name} not found")
continue
# Check if the tool is async
if asyncio.iscoroutinefunction(tool):
result = await tool(**arguments)
else:
# Run sync function in executor to avoid blocking
loop = asyncio.get_event_loop()
result = await loop.run_in_executor(None, lambda: tool(**arguments))
results.append(result)
except Exception as e:
display_error(f"Error executing tool {function_name}: {e}")
results.append(None)
# If we have results, format them into a response
if results:
formatted_results = "\n".join([str(r) for r in results if r is not None])
if formatted_results:
messages = [
{"role": "system", "content": self.system_prompt},
{"role": "assistant", "content": "Here are the tool results:"},
{"role": "user", "content": formatted_results + "\nPlease process these results and provide a final response."}
]
try:
async_client = AsyncOpenAI()
final_response = await async_client.chat.completions.create(
model=self.llm,
messages=messages,
temperature=0.2
)
return final_response.choices[0].message.content
except Exception as e:
display_error(f"Error in final chat completion: {e}")
return formatted_results
return formatted_results
return None
except Exception as e:
display_error(f"Error in _achat_completion: {e}")
return None
@@ -1,4 +0,0 @@
"""Agents module for managing multiple AI agents"""
from .agents import PraisonAIAgents
__all__ = ['PraisonAIAgents']
-554
View File
@@ -1,554 +0,0 @@
import os
import time
import json
import logging
from typing import Any, Dict, Optional, List
from pydantic import BaseModel
from rich.text import Text
from rich.panel import Panel
from rich.console import Console
from ..main import display_error, TaskOutput, error_logs, client
from ..agent.agent import Agent
from ..task.task import Task
from ..process.process import Process, LoopItems
import asyncio
def encode_file_to_base64(file_path: str) -> str:
"""Base64-encode a file."""
import base64
with open(file_path, "rb") as f:
return base64.b64encode(f.read()).decode("utf-8")
def process_video(video_path: str, seconds_per_frame=2):
"""Split video into frames (base64-encoded)."""
import cv2
import base64
base64_frames = []
video = cv2.VideoCapture(video_path)
total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
fps = video.get(cv2.CAP_PROP_FPS)
frames_to_skip = int(fps * seconds_per_frame)
curr_frame = 0
while curr_frame < total_frames:
video.set(cv2.CAP_PROP_POS_FRAMES, curr_frame)
success, frame = video.read()
if not success:
break
_, buffer = cv2.imencode(".jpg", frame)
base64_frames.append(base64.b64encode(buffer).decode("utf-8"))
curr_frame += frames_to_skip
video.release()
return base64_frames
class PraisonAIAgents:
def __init__(self, agents, tasks=None, verbose=0, completion_checker=None, max_retries=5, process="sequential", manager_llm=None):
if not agents:
raise ValueError("At least one agent must be provided")
self.agents = agents
self.tasks = {}
if max_retries < 3:
max_retries = 3
self.completion_checker = completion_checker if completion_checker else self.default_completion_checker
self.task_id_counter = 0
self.verbose = verbose
self.max_retries = max_retries
self.process = process
# Check for manager_llm in environment variable if not provided
self.manager_llm = manager_llm or os.getenv('OPENAI_MODEL_NAME', 'gpt-4o')
if self.verbose:
logging.info(f"Using model {self.manager_llm} for manager")
# If no tasks provided, generate them from agents
if tasks is None:
tasks = []
for agent in self.agents:
task = agent.generate_task()
tasks.append(task)
logging.info(f"Auto-generated {len(tasks)} tasks from agents")
else:
# Validate tasks for backward compatibility
if not tasks:
raise ValueError("If tasks are provided, at least one task must be present")
logging.info(f"Using {len(tasks)} provided tasks")
# Add tasks and set their status
for task in tasks:
self.add_task(task)
task.status = "not started"
# If tasks were auto-generated from agents or process is sequential, set up sequential flow
if len(tasks) > 1 and (process == "sequential" or all(task.next_tasks == [] for task in tasks)):
for i in range(len(tasks) - 1):
# Set up next task relationship
tasks[i].next_tasks = [tasks[i + 1].name]
# Set up context for the next task to include the current task
if tasks[i + 1].context is None:
tasks[i + 1].context = []
tasks[i + 1].context.append(tasks[i])
logging.info("Set up sequential flow with automatic context passing")
self._state = {} # Add state storage at PraisonAIAgents level
def add_task(self, task):
task_id = self.task_id_counter
task.id = task_id
self.tasks[task_id] = task
self.task_id_counter += 1
return task_id
def clean_json_output(self, output: str) -> str:
cleaned = output.strip()
if cleaned.startswith("```json"):
cleaned = cleaned[len("```json"):].strip()
if cleaned.startswith("```"):
cleaned = cleaned[len("```"):].strip()
if cleaned.endswith("```"):
cleaned = cleaned[:-3].strip()
return cleaned
def default_completion_checker(self, task, agent_output):
if task.output_json and task.result and task.result.json_dict:
return True
if task.output_pydantic and task.result and task.result.pydantic:
return True
return len(agent_output.strip()) > 0
async def aexecute_task(self, task_id):
"""Async version of execute_task method"""
if task_id not in self.tasks:
display_error(f"Error: Task with ID {task_id} does not exist")
return
task = self.tasks[task_id]
# Only import multimodal dependencies if task has images
if task.images and task.status == "not started":
try:
import cv2
import base64
from moviepy import VideoFileClip
except ImportError as e:
display_error(f"Error: Missing required dependencies for image/video processing: {e}")
display_error("Please install with: pip install opencv-python moviepy")
task.status = "failed"
return None
if task.status == "not started":
task.status = "in progress"
executor_agent = task.agent
task_prompt = f"""
You need to do the following task: {task.description}.
Expected Output: {task.expected_output}.
"""
if task.context:
context_results = ""
for context_task in task.context:
if context_task.result:
context_results += f"Result of previous task {context_task.name if context_task.name else context_task.description}: {context_task.result.raw}\n"
else:
context_results += f"Previous task {context_task.name if context_task.name else context_task.description} had no result.\n"
task_prompt += f"""
Here are the results of previous tasks that might be useful:\n
{context_results}
"""
task_prompt += "Please provide only the final result of your work. Do not add any conversation or extra explanation."
if self.verbose >= 2:
logging.info(f"Executing task {task_id}: {task.description} using {executor_agent.name}")
logging.debug(f"Starting execution of task {task_id} with prompt:\n{task_prompt}")
if task.images:
def _get_multimodal_message(text_prompt, images):
content = [{"type": "text", "text": text_prompt}]
for img in images:
# If local file path for a valid image
if os.path.exists(img):
ext = os.path.splitext(img)[1].lower()
# If it's a .mp4, convert to frames
if ext == ".mp4":
frames = process_video(img, seconds_per_frame=1)
content.append({"type": "text", "text": "These are frames from the video."})
for f in frames:
content.append({
"type": "image_url",
"image_url": {"url": f"data:image/jpg;base64,{f}"}
})
else:
encoded = encode_file_to_base64(img)
content.append({
"type": "image_url",
"image_url": {
"url": f"data:image/{ext.lstrip('.')};base64,{encoded}"
}
})
else:
# Treat as a remote URL
content.append({
"type": "image_url",
"image_url": {"url": img}
})
return content
agent_output = await executor_agent.achat(
_get_multimodal_message(task_prompt, task.images),
tools=task.tools
)
else:
agent_output = await executor_agent.achat(task_prompt, tools=task.tools)
if agent_output:
task_output = TaskOutput(
description=task.description,
summary=task.description[:10],
raw=agent_output,
agent=executor_agent.name,
output_format="RAW"
)
if task.output_json:
cleaned = self.clean_json_output(agent_output)
try:
parsed = json.loads(cleaned)
task_output.json_dict = parsed
task_output.output_format = "JSON"
except:
logging.warning(f"Warning: Could not parse output of task {task_id} as JSON")
logging.debug(f"Output that failed JSON parsing: {agent_output}")
if task.output_pydantic:
cleaned = self.clean_json_output(agent_output)
try:
parsed = json.loads(cleaned)
pyd_obj = task.output_pydantic(**parsed)
task_output.pydantic = pyd_obj
task_output.output_format = "Pydantic"
except:
logging.warning(f"Warning: Could not parse output of task {task_id} as Pydantic Model")
logging.debug(f"Output that failed Pydantic parsing: {agent_output}")
task.result = task_output
return task_output
else:
task.status = "failed"
return None
async def arun_task(self, task_id):
"""Async version of run_task method"""
if task_id not in self.tasks:
display_error(f"Error: Task with ID {task_id} does not exist")
return
task = self.tasks[task_id]
if task.status == "completed":
logging.info(f"Task with ID {task_id} is already completed")
return
retries = 0
while task.status != "completed" and retries < self.max_retries:
logging.debug(f"Attempt {retries+1} for task {task_id}")
if task.status in ["not started", "in progress"]:
task_output = await self.aexecute_task(task_id)
if task_output and self.completion_checker(task, task_output.raw):
task.status = "completed"
if task.callback:
await task.execute_callback(task_output)
self.save_output_to_file(task, task_output)
if self.verbose >= 1:
logging.info(f"Task {task_id} completed successfully.")
else:
task.status = "in progress"
if self.verbose >= 1:
logging.info(f"Task {task_id} not completed, retrying")
await asyncio.sleep(1)
retries += 1
else:
if task.status == "failed":
logging.info("Task is failed, resetting to in-progress for another try...")
task.status = "in progress"
else:
logging.info("Invalid Task status")
break
if retries == self.max_retries and task.status != "completed":
logging.info(f"Task {task_id} failed after {self.max_retries} retries.")
async def arun_all_tasks(self):
"""Async version of run_all_tasks method"""
process = Process(
tasks=self.tasks,
agents=self.agents,
manager_llm=self.manager_llm,
verbose=self.verbose
)
if self.process == "workflow":
async for task_id in process.aworkflow():
if self.tasks[task_id].async_execution:
await self.arun_task(task_id)
else:
self.run_task(task_id)
elif self.process == "sequential":
async for task_id in process.asequential():
if self.tasks[task_id].async_execution:
await self.arun_task(task_id)
else:
self.run_task(task_id)
elif self.process == "hierarchical":
async for task_id in process.ahierarchical():
if isinstance(task_id, Task):
task_id = self.add_task(task_id)
if self.tasks[task_id].async_execution:
await self.arun_task(task_id)
else:
self.run_task(task_id)
async def astart(self):
"""Async version of start method"""
await self.arun_all_tasks()
return {
"task_status": self.get_all_tasks_status(),
"task_results": {task_id: self.get_task_result(task_id) for task_id in self.tasks}
}
def save_output_to_file(self, task, task_output):
if task.output_file:
try:
if task.create_directory:
os.makedirs(os.path.dirname(task.output_file), exist_ok=True)
with open(task.output_file, "w") as f:
f.write(str(task_output))
if self.verbose >= 1:
logging.info(f"Task output saved to {task.output_file}")
except Exception as e:
display_error(f"Error saving task output to file: {e}")
def execute_task(self, task_id):
"""Synchronous version of execute_task method"""
if task_id not in self.tasks:
display_error(f"Error: Task with ID {task_id} does not exist")
return
task = self.tasks[task_id]
# Only import multimodal dependencies if task has images
if task.images and task.status == "not started":
try:
import cv2
import base64
from moviepy import VideoFileClip
except ImportError as e:
display_error(f"Error: Missing required dependencies for image/video processing: {e}")
display_error("Please install with: pip install opencv-python moviepy")
task.status = "failed"
return None
if task.status == "not started":
task.status = "in progress"
executor_agent = task.agent
task_prompt = f"""
You need to do the following task: {task.description}.
Expected Output: {task.expected_output}.
"""
if task.context:
context_results = ""
for context_task in task.context:
if context_task.result:
context_results += f"Result of previous task {context_task.name if context_task.name else context_task.description}: {context_task.result.raw}\n"
else:
context_results += f"Previous task {context_task.name if context_task.name else context_task.description} had no result.\n"
task_prompt += f"""
Here are the results of previous tasks that might be useful:\n
{context_results}
"""
task_prompt += "Please provide only the final result of your work. Do not add any conversation or extra explanation."
if self.verbose >= 2:
logging.info(f"Executing task {task_id}: {task.description} using {executor_agent.name}")
logging.debug(f"Starting execution of task {task_id} with prompt:\n{task_prompt}")
if task.images:
def _get_multimodal_message(text_prompt, images):
content = [{"type": "text", "text": text_prompt}]
for img in images:
# If local file path for a valid image
if os.path.exists(img):
ext = os.path.splitext(img)[1].lower()
# If it's a .mp4, convert to frames
if ext == ".mp4":
frames = process_video(img, seconds_per_frame=1)
content.append({"type": "text", "text": "These are frames from the video."})
for f in frames:
content.append({
"type": "image_url",
"image_url": {"url": f"data:image/jpg;base64,{f}"}
})
else:
encoded = encode_file_to_base64(img)
content.append({
"type": "image_url",
"image_url": {
"url": f"data:image/{ext.lstrip('.')};base64,{encoded}"
}
})
else:
# Treat as a remote URL
content.append({
"type": "image_url",
"image_url": {"url": img}
})
return content
agent_output = executor_agent.chat(
_get_multimodal_message(task_prompt, task.images),
tools=task.tools
)
else:
agent_output = executor_agent.chat(task_prompt, tools=task.tools)
if agent_output:
task_output = TaskOutput(
description=task.description,
summary=task.description[:10],
raw=agent_output,
agent=executor_agent.name,
output_format="RAW"
)
if task.output_json:
cleaned = self.clean_json_output(agent_output)
try:
parsed = json.loads(cleaned)
task_output.json_dict = parsed
task_output.output_format = "JSON"
except:
logging.warning(f"Warning: Could not parse output of task {task_id} as JSON")
logging.debug(f"Output that failed JSON parsing: {agent_output}")
if task.output_pydantic:
cleaned = self.clean_json_output(agent_output)
try:
parsed = json.loads(cleaned)
pyd_obj = task.output_pydantic(**parsed)
task_output.pydantic = pyd_obj
task_output.output_format = "Pydantic"
except:
logging.warning(f"Warning: Could not parse output of task {task_id} as Pydantic Model")
logging.debug(f"Output that failed Pydantic parsing: {agent_output}")
task.result = task_output
return task_output
else:
task.status = "failed"
return None
def run_task(self, task_id):
"""Synchronous version of run_task method"""
if task_id not in self.tasks:
display_error(f"Error: Task with ID {task_id} does not exist")
return
task = self.tasks[task_id]
if task.status == "completed":
logging.info(f"Task with ID {task_id} is already completed")
return
retries = 0
while task.status != "completed" and retries < self.max_retries:
logging.debug(f"Attempt {retries+1} for task {task_id}")
if task.status in ["not started", "in progress"]:
task_output = self.execute_task(task_id)
if task_output and self.completion_checker(task, task_output.raw):
task.status = "completed"
if task.callback:
task.callback(task_output)
self.save_output_to_file(task, task_output)
if self.verbose >= 1:
logging.info(f"Task {task_id} completed successfully.")
else:
task.status = "in progress"
if self.verbose >= 1:
logging.info(f"Task {task_id} not completed, retrying")
time.sleep(1)
retries += 1
else:
if task.status == "failed":
logging.info("Task is failed, resetting to in-progress for another try...")
task.status = "in progress"
else:
logging.info("Invalid Task status")
break
if retries == self.max_retries and task.status != "completed":
logging.info(f"Task {task_id} failed after {self.max_retries} retries.")
def run_all_tasks(self):
"""Synchronous version of run_all_tasks method"""
process = Process(
tasks=self.tasks,
agents=self.agents,
manager_llm=self.manager_llm,
verbose=self.verbose
)
if self.process == "workflow":
for task_id in process.workflow():
self.run_task(task_id)
elif self.process == "sequential":
for task_id in process.sequential():
self.run_task(task_id)
elif self.process == "hierarchical":
for task_id in process.hierarchical():
if isinstance(task_id, Task):
task_id = self.add_task(task_id)
self.run_task(task_id)
def get_task_status(self, task_id):
if task_id in self.tasks:
return self.tasks[task_id].status
return None
def get_all_tasks_status(self):
return {task_id: self.tasks[task_id].status for task_id in self.tasks}
def get_task_result(self, task_id):
if task_id in self.tasks:
return self.tasks[task_id].result
return None
def get_task_details(self, task_id):
if task_id in self.tasks:
return str(self.tasks[task_id])
return None
def get_agent_details(self, agent_name):
agent = [task.agent for task in self.tasks.values() if task.agent and task.agent.name == agent_name]
if agent:
return str(agent[0])
return None
def start(self):
self.run_all_tasks()
return {
"task_status": self.get_all_tasks_status(),
"task_results": {task_id: self.get_task_result(task_id) for task_id in self.tasks}
}
def set_state(self, key: str, value: Any) -> None:
"""Set a state value"""
self._state[key] = value
def get_state(self, key: str, default: Any = None) -> Any:
"""Get a state value"""
return self._state.get(key, default)
def update_state(self, updates: Dict) -> None:
"""Update multiple state values"""
self._state.update(updates)
def clear_state(self) -> None:
"""Clear all state values"""
self._state.clear()
-349
View File
@@ -1,349 +0,0 @@
import os
import time
import json
import logging
from typing import List, Optional, Dict, Any, Union, Literal, Type
from openai import OpenAI
from pydantic import BaseModel
from rich import print
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from rich.markdown import Markdown
from rich.logging import RichHandler
from rich.live import Live
import asyncio
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper()
logging.basicConfig(
level=getattr(logging, LOGLEVEL, logging.INFO),
format="%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s",
datefmt="[%X]",
handlers=[RichHandler(rich_tracebacks=True)]
)
# Global list to store error logs
error_logs = []
# Separate registries for sync and async callbacks
sync_display_callbacks = {}
async_display_callbacks = {}
# At the top of the file, add display_callbacks to __all__
__all__ = [
'error_logs',
'register_display_callback',
'sync_display_callbacks',
'async_display_callbacks',
# ... other exports
]
def register_display_callback(display_type: str, callback_fn, is_async: bool = False):
"""Register a synchronous or asynchronous callback function for a specific display type.
Args:
display_type (str): Type of display event ('interaction', 'self_reflection', etc.)
callback_fn: The callback function to register
is_async (bool): Whether the callback is asynchronous
"""
if is_async:
async_display_callbacks[display_type] = callback_fn
else:
sync_display_callbacks[display_type] = callback_fn
async def execute_callback(display_type: str, **kwargs):
"""Execute both sync and async callbacks for a given display type.
Args:
display_type (str): Type of display event
**kwargs: Arguments to pass to the callback functions
"""
# Execute synchronous callback if registered
if display_type in sync_display_callbacks:
callback = sync_display_callbacks[display_type]
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, lambda: callback(**kwargs))
# Execute asynchronous callback if registered
if display_type in async_display_callbacks:
callback = async_display_callbacks[display_type]
await callback(**kwargs)
def _clean_display_content(content: str, max_length: int = 20000) -> str:
"""Helper function to clean and truncate content for display."""
if not content or not str(content).strip():
return ""
content = str(content)
# Handle base64 content
if "base64" in content:
content_parts = []
for line in content.split('\n'):
if "base64" not in line:
content_parts.append(line)
content = '\n'.join(content_parts)
# Truncate if too long
if len(content) > max_length:
content = content[:max_length] + "..."
return content.strip()
def display_interaction(message, response, markdown=True, generation_time=None, console=None):
"""Synchronous version of display_interaction."""
if console is None:
console = Console()
if isinstance(message, list):
text_content = next((item["text"] for item in message if item["type"] == "text"), "")
message = text_content
message = _clean_display_content(str(message))
response = _clean_display_content(str(response))
# Execute synchronous callback if registered
if 'interaction' in sync_display_callbacks:
sync_display_callbacks['interaction'](
message=message,
response=response,
markdown=markdown,
generation_time=generation_time
)
# Rest of the display logic...
if generation_time:
console.print(Text(f"Response generated in {generation_time:.1f}s", style="dim"))
if markdown:
console.print(Panel.fit(Markdown(message), title="Message", border_style="cyan"))
console.print(Panel.fit(Markdown(response), title="Response", border_style="cyan"))
else:
console.print(Panel.fit(Text(message, style="bold green"), title="Message", border_style="cyan"))
console.print(Panel.fit(Text(response, style="bold blue"), title="Response", border_style="cyan"))
def display_self_reflection(message: str, console=None):
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
# Execute callback if registered
if 'self_reflection' in sync_display_callbacks:
sync_display_callbacks['self_reflection'](message=message)
console.print(Panel.fit(Text(message, style="bold yellow"), title="Self Reflection", border_style="magenta"))
def display_instruction(message: str, console=None):
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
# Execute callback if registered
if 'instruction' in sync_display_callbacks:
sync_display_callbacks['instruction'](message=message)
console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
def display_tool_call(message: str, console=None):
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
# Execute callback if registered
if 'tool_call' in sync_display_callbacks:
sync_display_callbacks['tool_call'](message=message)
console.print(Panel.fit(Text(message, style="bold cyan"), title="Tool Call", border_style="green"))
def display_error(message: str, console=None):
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
# Execute callback if registered
if 'error' in sync_display_callbacks:
sync_display_callbacks['error'](message=message)
console.print(Panel.fit(Text(message, style="bold red"), title="Error", border_style="red"))
error_logs.append(message)
def display_generating(content: str = "", start_time: Optional[float] = None):
if not content or not str(content).strip():
return Panel("", title="", border_style="green")
elapsed_str = ""
if start_time is not None:
elapsed = time.time() - start_time
elapsed_str = f" {elapsed:.1f}s"
content = _clean_display_content(str(content))
# Execute callback if registered
if 'generating' in sync_display_callbacks:
sync_display_callbacks['generating'](
content=content,
elapsed_time=elapsed_str.strip() if elapsed_str else None
)
return Panel(Markdown(content), title=f"Generating...{elapsed_str}", border_style="green")
# Async versions with 'a' prefix
async def adisplay_interaction(message, response, markdown=True, generation_time=None, console=None):
"""Async version of display_interaction."""
if console is None:
console = Console()
if isinstance(message, list):
text_content = next((item["text"] for item in message if item["type"] == "text"), "")
message = text_content
message = _clean_display_content(str(message))
response = _clean_display_content(str(response))
# Execute callbacks
await execute_callback(
'interaction',
message=message,
response=response,
markdown=markdown,
generation_time=generation_time
)
# Rest of the display logic...
if generation_time:
console.print(Text(f"Response generated in {generation_time:.1f}s", style="dim"))
if markdown:
console.print(Panel.fit(Markdown(message), title="Message", border_style="cyan"))
console.print(Panel.fit(Markdown(response), title="Response", border_style="cyan"))
else:
console.print(Panel.fit(Text(message, style="bold green"), title="Message", border_style="cyan"))
console.print(Panel.fit(Text(response, style="bold blue"), title="Response", border_style="cyan"))
async def adisplay_self_reflection(message: str, console=None):
"""Async version of display_self_reflection."""
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
if 'self_reflection' in async_display_callbacks:
await async_display_callbacks['self_reflection'](message=message)
console.print(Panel.fit(Text(message, style="bold yellow"), title="Self Reflection", border_style="magenta"))
async def adisplay_instruction(message: str, console=None):
"""Async version of display_instruction."""
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
if 'instruction' in async_display_callbacks:
await async_display_callbacks['instruction'](message=message)
console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
async def adisplay_tool_call(message: str, console=None):
"""Async version of display_tool_call."""
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
if 'tool_call' in async_display_callbacks:
await async_display_callbacks['tool_call'](message=message)
console.print(Panel.fit(Text(message, style="bold cyan"), title="Tool Call", border_style="green"))
async def adisplay_error(message: str, console=None):
"""Async version of display_error."""
if not message or not message.strip():
return
if console is None:
console = Console()
message = _clean_display_content(str(message))
if 'error' in async_display_callbacks:
await async_display_callbacks['error'](message=message)
console.print(Panel.fit(Text(message, style="bold red"), title="Error", border_style="red"))
error_logs.append(message)
async def adisplay_generating(content: str = "", start_time: Optional[float] = None):
"""Async version of display_generating."""
if not content or not str(content).strip():
return Panel("", title="", border_style="green")
elapsed_str = ""
if start_time is not None:
elapsed = time.time() - start_time
elapsed_str = f" {elapsed:.1f}s"
content = _clean_display_content(str(content))
if 'generating' in async_display_callbacks:
await async_display_callbacks['generating'](
content=content,
elapsed_time=elapsed_str.strip() if elapsed_str else None
)
return Panel(Markdown(content), title=f"Generating...{elapsed_str}", border_style="green")
def clean_triple_backticks(text: str) -> str:
"""Remove triple backticks and surrounding json fences from a string."""
cleaned = text.strip()
if cleaned.startswith("```json"):
cleaned = cleaned[len("```json"):].strip()
if cleaned.startswith("```"):
cleaned = cleaned[len("```"):].strip()
if cleaned.endswith("```"):
cleaned = cleaned[:-3].strip()
return cleaned
class ReflectionOutput(BaseModel):
reflection: str
satisfactory: Literal["yes", "no"]
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
class TaskOutput(BaseModel):
description: str
summary: Optional[str] = None
raw: str
pydantic: Optional[BaseModel] = None
json_dict: Optional[Dict[str, Any]] = None
agent: str
output_format: Literal["RAW", "JSON", "Pydantic"] = "RAW"
def json(self) -> Optional[str]:
if self.output_format == "JSON" and self.json_dict:
return json.dumps(self.json_dict)
return None
def to_dict(self) -> dict:
output_dict = {}
if self.json_dict:
output_dict.update(self.json_dict)
if self.pydantic:
output_dict.update(self.pydantic.model_dump())
return output_dict
def __str__(self):
if self.pydantic:
return str(self.pydantic)
elif self.json_dict:
return json.dumps(self.json_dict)
else:
return self.raw
-534
View File
@@ -1,534 +0,0 @@
import logging
import asyncio
from typing import Dict, Optional, List, Any, AsyncGenerator
from pydantic import BaseModel
from ..agent.agent import Agent
from ..task.task import Task
from ..main import display_error, client
class LoopItems(BaseModel):
items: List[Any]
class Process:
def __init__(self, tasks: Dict[str, Task], agents: List[Agent], manager_llm: Optional[str] = None, verbose: bool = False):
self.tasks = tasks
self.agents = agents
self.manager_llm = manager_llm
self.verbose = verbose
async def aworkflow(self) -> AsyncGenerator[str, None]:
"""Async version of workflow method"""
# Build workflow relationships first
for task in self.tasks.values():
if task.next_tasks:
for next_task_name in task.next_tasks:
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
if next_task:
next_task.previous_tasks.append(task.name)
# Find start task
start_task = None
for task_id, task in self.tasks.items():
if task.is_start:
start_task = task
break
if not start_task:
start_task = list(self.tasks.values())[0]
logging.info("No start task marked, using first task")
current_task = start_task
visited_tasks = set()
loop_data = {} # Store loop-specific data
while current_task and current_task.id not in visited_tasks:
task_id = current_task.id
logging.info(f"Executing workflow task: {current_task.name if current_task.name else task_id}")
# Add context from previous tasks to description
if current_task.previous_tasks or current_task.context:
context = "\nInput data from previous tasks:"
# Add data from previous tasks in workflow
for prev_name in current_task.previous_tasks:
prev_task = next((t for t in self.tasks.values() if t.name == prev_name), None)
if prev_task and prev_task.result:
# Handle loop data
if current_task.task_type == "loop":
# create a loop manager Agent
loop_manager = Agent(
name="Loop Manager",
role="Loop data processor",
goal="Process loop data and convert it to list format",
backstory="Expert at handling loop data and converting it to proper format",
llm=self.manager_llm,
verbose=self.verbose,
markdown=True
)
# get the loop data convert it to list using calling Agent class chat
loop_prompt = f"""
Process this data into a list format:
{prev_task.result.raw}
Return a JSON object with an 'items' array containing the items to process.
"""
if current_task.async_execution:
loop_data_str = await loop_manager.achat(
prompt=loop_prompt,
output_json=LoopItems
)
else:
loop_data_str = loop_manager.chat(
prompt=loop_prompt,
output_json=LoopItems
)
try:
# The response will already be parsed into LoopItems model
loop_data[f"loop_{current_task.name}"] = {
"items": loop_data_str.items,
"index": 0,
"remaining": len(loop_data_str.items)
}
context += f"\nCurrent loop item: {loop_data_str.items[0]}"
except Exception as e:
display_error(f"Failed to process loop data: {e}")
context += f"\n{prev_name}: {prev_task.result.raw}"
else:
context += f"\n{prev_name}: {prev_task.result.raw}"
# Add data from context tasks
if current_task.context:
for ctx_task in current_task.context:
if ctx_task.result and ctx_task.name != current_task.name:
context += f"\n{ctx_task.name}: {ctx_task.result.raw}"
# Update task description with context
current_task.description = current_task.description + context
# Execute task using existing run_task method
yield task_id
visited_tasks.add(task_id)
# Handle loop progression
if current_task.task_type == "loop":
loop_key = f"loop_{current_task.name}"
if loop_key in loop_data:
loop_info = loop_data[loop_key]
loop_info["index"] += 1
has_more = loop_info["remaining"] > 0
# Update result to trigger correct condition
if current_task.result:
result = current_task.result.raw
if has_more:
result += "\nmore"
else:
result += "\ndone"
current_task.result.raw = result
# Determine next task based on result
next_task = None
if current_task.result:
if current_task.task_type in ["decision", "loop"]:
result = current_task.result.raw.lower()
# Check conditions
for condition, tasks in current_task.condition.items():
if condition.lower() in result and tasks:
next_task_name = tasks[0]
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
# For loops, allow revisiting the same task
if next_task and next_task.id == current_task.id:
visited_tasks.discard(current_task.id)
break
if not next_task and current_task.next_tasks:
next_task_name = current_task.next_tasks[0]
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
current_task = next_task
if not current_task:
logging.info("Workflow execution completed")
break
async def asequential(self) -> AsyncGenerator[str, None]:
"""Async version of sequential method"""
for task_id in self.tasks:
if self.tasks[task_id].status != "completed":
yield task_id
async def ahierarchical(self) -> AsyncGenerator[str, None]:
"""Async version of hierarchical method"""
logging.debug(f"Starting hierarchical task execution with {len(self.tasks)} tasks")
manager_agent = Agent(
name="Manager",
role="Project manager",
goal="Manage the entire flow of tasks and delegate them to the right agent",
backstory="Expert project manager to coordinate tasks among agents",
llm=self.manager_llm,
verbose=self.verbose,
markdown=True,
self_reflect=False
)
class ManagerInstructions(BaseModel):
task_id: int
agent_name: str
action: str
manager_task = Task(
name="manager_task",
description="Decide the order of tasks and which agent executes them",
expected_output="All tasks completed successfully",
agent=manager_agent
)
manager_task_id = yield manager_task
logging.info(f"Created manager task with ID {manager_task_id}")
completed_count = 0
total_tasks = len(self.tasks) - 1
logging.info(f"Need to complete {total_tasks} tasks (excluding manager task)")
while completed_count < total_tasks:
tasks_summary = []
for tid, tk in self.tasks.items():
if tk.name == "manager_task":
continue
task_info = {
"task_id": tid,
"name": tk.name,
"description": tk.description,
"status": tk.status if tk.status else "not started",
"agent": tk.agent.name if tk.agent else "No agent"
}
tasks_summary.append(task_info)
logging.info(f"Task {tid} status: {task_info}")
manager_prompt = f"""
Here is the current status of all tasks except yours (manager_task):
{tasks_summary}
Provide a JSON with the structure:
{{
"task_id": <int>,
"agent_name": "<string>",
"action": "<execute or stop>"
}}
"""
try:
logging.info("Requesting manager instructions...")
if manager_task.async_execution:
manager_response = await client.beta.chat.completions.parse(
model=self.manager_llm,
messages=[
{"role": "system", "content": manager_task.description},
{"role": "user", "content": manager_prompt}
],
temperature=0.7,
response_format=ManagerInstructions
)
else:
manager_response = client.beta.chat.completions.parse(
model=self.manager_llm,
messages=[
{"role": "system", "content": manager_task.description},
{"role": "user", "content": manager_prompt}
],
temperature=0.7,
response_format=ManagerInstructions
)
parsed_instructions = manager_response.choices[0].message.parsed
logging.info(f"Manager instructions: {parsed_instructions}")
except Exception as e:
display_error(f"Manager parse error: {e}")
logging.error(f"Manager parse error: {str(e)}", exc_info=True)
break
selected_task_id = parsed_instructions.task_id
selected_agent_name = parsed_instructions.agent_name
action = parsed_instructions.action
logging.info(f"Manager selected task_id={selected_task_id}, agent={selected_agent_name}, action={action}")
if action.lower() == "stop":
logging.info("Manager decided to stop task execution")
break
if selected_task_id not in self.tasks:
error_msg = f"Manager selected invalid task id {selected_task_id}"
display_error(error_msg)
logging.error(error_msg)
break
original_agent = self.tasks[selected_task_id].agent.name if self.tasks[selected_task_id].agent else "None"
for a in self.agents:
if a.name == selected_agent_name:
self.tasks[selected_task_id].agent = a
logging.info(f"Changed agent for task {selected_task_id} from {original_agent} to {selected_agent_name}")
break
if self.tasks[selected_task_id].status != "completed":
logging.info(f"Starting execution of task {selected_task_id}")
yield selected_task_id
logging.info(f"Finished execution of task {selected_task_id}, status: {self.tasks[selected_task_id].status}")
if self.tasks[selected_task_id].status == "completed":
completed_count += 1
logging.info(f"Task {selected_task_id} completed. Total completed: {completed_count}/{total_tasks}")
self.tasks[manager_task.id].status = "completed"
if self.verbose >= 1:
logging.info("All tasks completed under manager supervision.")
logging.info("Hierarchical task execution finished")
def workflow(self):
"""Synchronous version of workflow method"""
# Build workflow relationships first
for task in self.tasks.values():
if task.next_tasks:
for next_task_name in task.next_tasks:
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
if next_task:
next_task.previous_tasks.append(task.name)
# Find start task
start_task = None
for task_id, task in self.tasks.items():
if task.is_start:
start_task = task
break
if not start_task:
start_task = list(self.tasks.values())[0]
logging.info("No start task marked, using first task")
current_task = start_task
visited_tasks = set()
loop_data = {} # Store loop-specific data
while current_task and current_task.id not in visited_tasks:
task_id = current_task.id
logging.info(f"Executing workflow task: {current_task.name if current_task.name else task_id}")
# Add context from previous tasks to description
if current_task.previous_tasks or current_task.context:
context = "\nInput data from previous tasks:"
# Add data from previous tasks in workflow
for prev_name in current_task.previous_tasks:
prev_task = next((t for t in self.tasks.values() if t.name == prev_name), None)
if prev_task and prev_task.result:
# Handle loop data
if current_task.task_type == "loop":
# create a loop manager Agent
loop_manager = Agent(
name="Loop Manager",
role="Loop data processor",
goal="Process loop data and convert it to list format",
backstory="Expert at handling loop data and converting it to proper format",
llm=self.manager_llm,
verbose=self.verbose,
markdown=True
)
# get the loop data convert it to list using calling Agent class chat
loop_prompt = f"""
Process this data into a list format:
{prev_task.result.raw}
Return a JSON object with an 'items' array containing the items to process.
"""
loop_data_str = loop_manager.chat(
prompt=loop_prompt,
output_json=LoopItems
)
try:
# The response will already be parsed into LoopItems model
loop_data[f"loop_{current_task.name}"] = {
"items": loop_data_str.items,
"index": 0,
"remaining": len(loop_data_str.items)
}
context += f"\nCurrent loop item: {loop_data_str.items[0]}"
except Exception as e:
display_error(f"Failed to process loop data: {e}")
context += f"\n{prev_name}: {prev_task.result.raw}"
else:
context += f"\n{prev_name}: {prev_task.result.raw}"
# Add data from context tasks
if current_task.context:
for ctx_task in current_task.context:
if ctx_task.result and ctx_task.name != current_task.name:
context += f"\n{ctx_task.name}: {ctx_task.result.raw}"
# Update task description with context
current_task.description = current_task.description + context
# Execute task using existing run_task method
yield task_id
visited_tasks.add(task_id)
# Handle loop progression
if current_task.task_type == "loop":
loop_key = f"loop_{current_task.name}"
if loop_key in loop_data:
loop_info = loop_data[loop_key]
loop_info["index"] += 1
has_more = loop_info["remaining"] > 0
# Update result to trigger correct condition
if current_task.result:
result = current_task.result.raw
if has_more:
result += "\nmore"
else:
result += "\ndone"
current_task.result.raw = result
# Determine next task based on result
next_task = None
if current_task.result:
if current_task.task_type in ["decision", "loop"]:
result = current_task.result.raw.lower()
# Check conditions
for condition, tasks in current_task.condition.items():
if condition.lower() in result and tasks:
next_task_name = tasks[0]
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
# For loops, allow revisiting the same task
if next_task and next_task.id == current_task.id:
visited_tasks.discard(current_task.id)
break
if not next_task and current_task.next_tasks:
next_task_name = current_task.next_tasks[0]
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
current_task = next_task
if not current_task:
logging.info("Workflow execution completed")
break
def sequential(self):
"""Synchronous version of sequential method"""
for task_id in self.tasks:
if self.tasks[task_id].status != "completed":
yield task_id
def hierarchical(self):
"""Synchronous version of hierarchical method"""
logging.debug(f"Starting hierarchical task execution with {len(self.tasks)} tasks")
manager_agent = Agent(
name="Manager",
role="Project manager",
goal="Manage the entire flow of tasks and delegate them to the right agent",
backstory="Expert project manager to coordinate tasks among agents",
llm=self.manager_llm,
verbose=self.verbose,
markdown=True,
self_reflect=False
)
class ManagerInstructions(BaseModel):
task_id: int
agent_name: str
action: str
manager_task = Task(
name="manager_task",
description="Decide the order of tasks and which agent executes them",
expected_output="All tasks completed successfully",
agent=manager_agent
)
manager_task_id = yield manager_task
logging.info(f"Created manager task with ID {manager_task_id}")
completed_count = 0
total_tasks = len(self.tasks) - 1
logging.info(f"Need to complete {total_tasks} tasks (excluding manager task)")
while completed_count < total_tasks:
tasks_summary = []
for tid, tk in self.tasks.items():
if tk.name == "manager_task":
continue
task_info = {
"task_id": tid,
"name": tk.name,
"description": tk.description,
"status": tk.status if tk.status else "not started",
"agent": tk.agent.name if tk.agent else "No agent"
}
tasks_summary.append(task_info)
logging.info(f"Task {tid} status: {task_info}")
manager_prompt = f"""
Here is the current status of all tasks except yours (manager_task):
{tasks_summary}
Provide a JSON with the structure:
{{
"task_id": <int>,
"agent_name": "<string>",
"action": "<execute or stop>"
}}
"""
try:
logging.info("Requesting manager instructions...")
manager_response = client.beta.chat.completions.parse(
model=self.manager_llm,
messages=[
{"role": "system", "content": manager_task.description},
{"role": "user", "content": manager_prompt}
],
temperature=0.7,
response_format=ManagerInstructions
)
parsed_instructions = manager_response.choices[0].message.parsed
logging.info(f"Manager instructions: {parsed_instructions}")
except Exception as e:
display_error(f"Manager parse error: {e}")
logging.error(f"Manager parse error: {str(e)}", exc_info=True)
break
selected_task_id = parsed_instructions.task_id
selected_agent_name = parsed_instructions.agent_name
action = parsed_instructions.action
logging.info(f"Manager selected task_id={selected_task_id}, agent={selected_agent_name}, action={action}")
if action.lower() == "stop":
logging.info("Manager decided to stop task execution")
break
if selected_task_id not in self.tasks:
error_msg = f"Manager selected invalid task id {selected_task_id}"
display_error(error_msg)
logging.error(error_msg)
break
original_agent = self.tasks[selected_task_id].agent.name if self.tasks[selected_task_id].agent else "None"
for a in self.agents:
if a.name == selected_agent_name:
self.tasks[selected_task_id].agent = a
logging.info(f"Changed agent for task {selected_task_id} from {original_agent} to {selected_agent_name}")
break
if self.tasks[selected_task_id].status != "completed":
logging.info(f"Starting execution of task {selected_task_id}")
yield selected_task_id
logging.info(f"Finished execution of task {selected_task_id}, status: {self.tasks[selected_task_id].status}")
if self.tasks[selected_task_id].status == "completed":
completed_count += 1
logging.info(f"Task {selected_task_id} completed. Total completed: {completed_count}/{total_tasks}")
self.tasks[manager_task.id].status = "completed"
if self.verbose >= 1:
logging.info("All tasks completed under manager supervision.")
logging.info("Hierarchical task execution finished")
-74
View File
@@ -1,74 +0,0 @@
import logging
import asyncio
from typing import List, Optional, Dict, Any, Type, Callable, Union, Coroutine
from pydantic import BaseModel
from ..main import TaskOutput
from ..agent.agent import Agent
import uuid
class Task:
def __init__(
self,
description: str,
expected_output: str,
agent: Optional[Agent] = None,
name: Optional[str] = None,
tools: Optional[List[Any]] = None,
context: Optional[List["Task"]] = None,
async_execution: Optional[bool] = False,
config: Optional[Dict[str, Any]] = None,
output_file: Optional[str] = None,
output_json: Optional[Type[BaseModel]] = None,
output_pydantic: Optional[Type[BaseModel]] = None,
callback: Optional[Union[Callable[[TaskOutput], Any], Callable[[TaskOutput], Coroutine[Any, Any, Any]]]] = None,
status: str = "not started",
result: Optional[TaskOutput] = None,
create_directory: Optional[bool] = False,
id: Optional[int] = None,
images: Optional[List[str]] = None,
next_tasks: Optional[List[str]] = None,
task_type: str = "task",
condition: Optional[Dict[str, List[str]]] = None,
is_start: bool = False,
loop_state: Optional[Dict[str, Union[str, int]]] = None
):
self.id = str(uuid.uuid4()) if id is None else str(id)
self.name = name
self.description = description
self.expected_output = expected_output
self.agent = agent
self.tools = tools if tools else []
self.context = context if context else []
self.async_execution = async_execution
self.config = config if config else {}
self.output_file = output_file
self.output_json = output_json
self.output_pydantic = output_pydantic
self.callback = callback
self.status = status
self.result = result
self.create_directory = create_directory
self.images = images if images else []
self.next_tasks = next_tasks if next_tasks else []
self.task_type = task_type
self.condition = condition if condition else {}
self.is_start = is_start
self.loop_state = loop_state if loop_state else {}
if self.output_json and self.output_pydantic:
raise ValueError("Only one output type can be defined")
# Track previous tasks based on next_tasks relationships
self.previous_tasks = []
def __str__(self):
return f"Task(name='{self.name if self.name else 'None'}', description='{self.description}', agent='{self.agent.name if self.agent else 'None'}', status='{self.status}')"
async def execute_callback(self, task_output: TaskOutput) -> None:
"""Execute the callback function, handling both sync and async callbacks"""
if self.callback:
if asyncio.iscoroutinefunction(self.callback):
await self.callback(task_output)
else:
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, self.callback, task_output)
-4
View File
@@ -1,4 +0,0 @@
"""Tools package for PraisonAI Agents"""
from .tools import Tools
__all__ = ['Tools']
-40
View File
@@ -1,40 +0,0 @@
"""Tools module for PraisonAI Agents"""
from typing import List, Dict
import logging
import importlib
class Tools:
@staticmethod
def internet_search(query: str) -> List[Dict]:
"""
Perform a search using DuckDuckGo.
Args:
query (str): The search query.
Returns:
list: A list of search result titles, URLs, and snippets.
"""
# Check if duckduckgo_search is installed
if importlib.util.find_spec("duckduckgo_search") is None:
error_msg = "DuckDuckGo search is not available. Please install duckduckgo_search package using: pip install duckduckgo_search"
logging.error(error_msg)
return [{"error": error_msg}]
try:
# Import only when needed
from duckduckgo_search import DDGS
results = []
ddgs = DDGS()
for result in ddgs.text(keywords=query, max_results=5):
results.append({
"title": result.get("title", ""),
"url": result.get("href", ""),
"snippet": result.get("body", "")
})
return results
except Exception as e:
error_msg = f"Error during DuckDuckGo search: {e}"
logging.error(error_msg)
return [{"error": error_msg}]
-16
View File
@@ -1,16 +0,0 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "praisonaiagents"
version = "0.0.22"
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
authors = [
{ name="Mervin Praison" }
]
dependencies = [
"pydantic",
"rich",
"openai"
]
-321
View File
@@ -1,321 +0,0 @@
version = 1
requires-python = ">=3.11"
[[package]]
name = "annotated-types"
version = "0.7.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643 },
]
[[package]]
name = "anyio"
version = "4.7.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "idna" },
{ name = "sniffio" },
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/f6/40/318e58f669b1a9e00f5c4453910682e2d9dd594334539c7b7817dabb765f/anyio-4.7.0.tar.gz", hash = "sha256:2f834749c602966b7d456a7567cafcb309f96482b5081d14ac93ccd457f9dd48", size = 177076 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a0/7a/4daaf3b6c08ad7ceffea4634ec206faeff697526421c20f07628c7372156/anyio-4.7.0-py3-none-any.whl", hash = "sha256:ea60c3723ab42ba6fff7e8ccb0488c898ec538ff4df1f1d5e642c3601d07e352", size = 93052 },
]
[[package]]
name = "certifi"
version = "2024.12.14"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/0f/bd/1d41ee578ce09523c81a15426705dd20969f5abf006d1afe8aeff0dd776a/certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db", size = 166010 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a5/32/8f6669fc4798494966bf446c8c4a162e0b5d893dff088afddf76414f70e1/certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56", size = 164927 },
]
[[package]]
name = "colorama"
version = "0.4.6"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 },
]
[[package]]
name = "distro"
version = "1.9.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277 },
]
[[package]]
name = "h11"
version = "0.14.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/f5/38/3af3d3633a34a3316095b39c8e8fb4853a28a536e55d347bd8d8e9a14b03/h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", size = 100418 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761", size = 58259 },
]
[[package]]
name = "httpcore"
version = "1.0.7"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "certifi" },
{ name = "h11" },
]
sdist = { url = "https://files.pythonhosted.org/packages/6a/41/d7d0a89eb493922c37d343b607bc1b5da7f5be7e383740b4753ad8943e90/httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c", size = 85196 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/87/f5/72347bc88306acb359581ac4d52f23c0ef445b57157adedb9aee0cd689d2/httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd", size = 78551 },
]
[[package]]
name = "httpx"
version = "0.28.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
{ name = "certifi" },
{ name = "httpcore" },
{ name = "idna" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517 },
]
[[package]]
name = "idna"
version = "3.10"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442 },
]
[[package]]
name = "jiter"
version = "0.8.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/f8/70/90bc7bd3932e651486861df5c8ffea4ca7c77d28e8532ddefe2abc561a53/jiter-0.8.2.tar.gz", hash = "sha256:cd73d3e740666d0e639f678adb176fad25c1bcbdae88d8d7b857e1783bb4212d", size = 163007 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/cb/b0/c1a7caa7f9dc5f1f6cfa08722867790fe2d3645d6e7170ca280e6e52d163/jiter-0.8.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:2dd61c5afc88a4fda7d8b2cf03ae5947c6ac7516d32b7a15bf4b49569a5c076b", size = 303666 },
{ url = "https://files.pythonhosted.org/packages/f5/97/0468bc9eeae43079aaa5feb9267964e496bf13133d469cfdc135498f8dd0/jiter-0.8.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a6c710d657c8d1d2adbbb5c0b0c6bfcec28fd35bd6b5f016395f9ac43e878a15", size = 311934 },
{ url = "https://files.pythonhosted.org/packages/e5/69/64058e18263d9a5f1e10f90c436853616d5f047d997c37c7b2df11b085ec/jiter-0.8.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9584de0cd306072635fe4b89742bf26feae858a0683b399ad0c2509011b9dc0", size = 335506 },
{ url = "https://files.pythonhosted.org/packages/9d/14/b747f9a77b8c0542141d77ca1e2a7523e854754af2c339ac89a8b66527d6/jiter-0.8.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5a90a923338531b7970abb063cfc087eebae6ef8ec8139762007188f6bc69a9f", size = 355849 },
{ url = "https://files.pythonhosted.org/packages/53/e2/98a08161db7cc9d0e39bc385415890928ff09709034982f48eccfca40733/jiter-0.8.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21974d246ed0181558087cd9f76e84e8321091ebfb3a93d4c341479a736f099", size = 381700 },
{ url = "https://files.pythonhosted.org/packages/7a/38/1674672954d35bce3b1c9af99d5849f9256ac8f5b672e020ac7821581206/jiter-0.8.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:32475a42b2ea7b344069dc1e81445cfc00b9d0e3ca837f0523072432332e9f74", size = 389710 },
{ url = "https://files.pythonhosted.org/packages/f8/9b/92f9da9a9e107d019bcf883cd9125fa1690079f323f5a9d5c6986eeec3c0/jiter-0.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8b9931fd36ee513c26b5bf08c940b0ac875de175341cbdd4fa3be109f0492586", size = 345553 },
{ url = "https://files.pythonhosted.org/packages/44/a6/6d030003394e9659cd0d7136bbeabd82e869849ceccddc34d40abbbbb269/jiter-0.8.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ce0820f4a3a59ddced7fce696d86a096d5cc48d32a4183483a17671a61edfddc", size = 376388 },
{ url = "https://files.pythonhosted.org/packages/ad/8d/87b09e648e4aca5f9af89e3ab3cfb93db2d1e633b2f2931ede8dabd9b19a/jiter-0.8.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8ffc86ae5e3e6a93765d49d1ab47b6075a9c978a2b3b80f0f32628f39caa0c88", size = 511226 },
{ url = "https://files.pythonhosted.org/packages/77/95/8008ebe4cdc82eac1c97864a8042ca7e383ed67e0ec17bfd03797045c727/jiter-0.8.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5127dc1abd809431172bc3fbe8168d6b90556a30bb10acd5ded41c3cfd6f43b6", size = 504134 },
{ url = "https://files.pythonhosted.org/packages/26/0d/3056a74de13e8b2562e4d526de6dac2f65d91ace63a8234deb9284a1d24d/jiter-0.8.2-cp311-cp311-win32.whl", hash = "sha256:66227a2c7b575720c1871c8800d3a0122bb8ee94edb43a5685aa9aceb2782d44", size = 203103 },
{ url = "https://files.pythonhosted.org/packages/4e/1e/7f96b798f356e531ffc0f53dd2f37185fac60fae4d6c612bbbd4639b90aa/jiter-0.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:cde031d8413842a1e7501e9129b8e676e62a657f8ec8166e18a70d94d4682855", size = 206717 },
{ url = "https://files.pythonhosted.org/packages/a1/17/c8747af8ea4e045f57d6cfd6fc180752cab9bc3de0e8a0c9ca4e8af333b1/jiter-0.8.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e6ec2be506e7d6f9527dae9ff4b7f54e68ea44a0ef6b098256ddf895218a2f8f", size = 302027 },
{ url = "https://files.pythonhosted.org/packages/3c/c1/6da849640cd35a41e91085723b76acc818d4b7d92b0b6e5111736ce1dd10/jiter-0.8.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:76e324da7b5da060287c54f2fabd3db5f76468006c811831f051942bf68c9d44", size = 310326 },
{ url = "https://files.pythonhosted.org/packages/06/99/a2bf660d8ccffee9ad7ed46b4f860d2108a148d0ea36043fd16f4dc37e94/jiter-0.8.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:180a8aea058f7535d1c84183c0362c710f4750bef66630c05f40c93c2b152a0f", size = 334242 },
{ url = "https://files.pythonhosted.org/packages/a7/5f/cea1c17864828731f11427b9d1ab7f24764dbd9aaf4648a7f851164d2718/jiter-0.8.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:025337859077b41548bdcbabe38698bcd93cfe10b06ff66617a48ff92c9aec60", size = 356654 },
{ url = "https://files.pythonhosted.org/packages/e9/13/62774b7e5e7f5d5043efe1d0f94ead66e6d0f894ae010adb56b3f788de71/jiter-0.8.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ecff0dc14f409599bbcafa7e470c00b80f17abc14d1405d38ab02e4b42e55b57", size = 379967 },
{ url = "https://files.pythonhosted.org/packages/ec/fb/096b34c553bb0bd3f2289d5013dcad6074948b8d55212aa13a10d44c5326/jiter-0.8.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ffd9fee7d0775ebaba131f7ca2e2d83839a62ad65e8e02fe2bd8fc975cedeb9e", size = 389252 },
{ url = "https://files.pythonhosted.org/packages/17/61/beea645c0bf398ced8b199e377b61eb999d8e46e053bb285c91c3d3eaab0/jiter-0.8.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14601dcac4889e0a1c75ccf6a0e4baf70dbc75041e51bcf8d0e9274519df6887", size = 345490 },
{ url = "https://files.pythonhosted.org/packages/d5/df/834aa17ad5dcc3cf0118821da0a0cf1589ea7db9832589278553640366bc/jiter-0.8.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:92249669925bc1c54fcd2ec73f70f2c1d6a817928480ee1c65af5f6b81cdf12d", size = 376991 },
{ url = "https://files.pythonhosted.org/packages/67/80/87d140399d382fb4ea5b3d56e7ecaa4efdca17cd7411ff904c1517855314/jiter-0.8.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e725edd0929fa79f8349ab4ec7f81c714df51dc4e991539a578e5018fa4a7152", size = 510822 },
{ url = "https://files.pythonhosted.org/packages/5c/37/3394bb47bac1ad2cb0465601f86828a0518d07828a650722e55268cdb7e6/jiter-0.8.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bf55846c7b7a680eebaf9c3c48d630e1bf51bdf76c68a5f654b8524335b0ad29", size = 503730 },
{ url = "https://files.pythonhosted.org/packages/f9/e2/253fc1fa59103bb4e3aa0665d6ceb1818df1cd7bf3eb492c4dad229b1cd4/jiter-0.8.2-cp312-cp312-win32.whl", hash = "sha256:7efe4853ecd3d6110301665a5178b9856be7e2a9485f49d91aa4d737ad2ae49e", size = 203375 },
{ url = "https://files.pythonhosted.org/packages/41/69/6d4bbe66b3b3b4507e47aa1dd5d075919ad242b4b1115b3f80eecd443687/jiter-0.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:83c0efd80b29695058d0fd2fa8a556490dbce9804eac3e281f373bbc99045f6c", size = 204740 },
{ url = "https://files.pythonhosted.org/packages/6c/b0/bfa1f6f2c956b948802ef5a021281978bf53b7a6ca54bb126fd88a5d014e/jiter-0.8.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:ca1f08b8e43dc3bd0594c992fb1fd2f7ce87f7bf0d44358198d6da8034afdf84", size = 301190 },
{ url = "https://files.pythonhosted.org/packages/a4/8f/396ddb4e292b5ea57e45ade5dc48229556b9044bad29a3b4b2dddeaedd52/jiter-0.8.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5672a86d55416ccd214c778efccf3266b84f87b89063b582167d803246354be4", size = 309334 },
{ url = "https://files.pythonhosted.org/packages/7f/68/805978f2f446fa6362ba0cc2e4489b945695940656edd844e110a61c98f8/jiter-0.8.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:58dc9bc9767a1101f4e5e22db1b652161a225874d66f0e5cb8e2c7d1c438b587", size = 333918 },
{ url = "https://files.pythonhosted.org/packages/b3/99/0f71f7be667c33403fa9706e5b50583ae5106d96fab997fa7e2f38ee8347/jiter-0.8.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:37b2998606d6dadbb5ccda959a33d6a5e853252d921fec1792fc902351bb4e2c", size = 356057 },
{ url = "https://files.pythonhosted.org/packages/8d/50/a82796e421a22b699ee4d2ce527e5bcb29471a2351cbdc931819d941a167/jiter-0.8.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4ab9a87f3784eb0e098f84a32670cfe4a79cb6512fd8f42ae3d0709f06405d18", size = 379790 },
{ url = "https://files.pythonhosted.org/packages/3c/31/10fb012b00f6d83342ca9e2c9618869ab449f1aa78c8f1b2193a6b49647c/jiter-0.8.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:79aec8172b9e3c6d05fd4b219d5de1ac616bd8da934107325a6c0d0e866a21b6", size = 388285 },
{ url = "https://files.pythonhosted.org/packages/c8/81/f15ebf7de57be488aa22944bf4274962aca8092e4f7817f92ffa50d3ee46/jiter-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:711e408732d4e9a0208008e5892c2966b485c783cd2d9a681f3eb147cf36c7ef", size = 344764 },
{ url = "https://files.pythonhosted.org/packages/b3/e8/0cae550d72b48829ba653eb348cdc25f3f06f8a62363723702ec18e7be9c/jiter-0.8.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:653cf462db4e8c41995e33d865965e79641ef45369d8a11f54cd30888b7e6ff1", size = 376620 },
{ url = "https://files.pythonhosted.org/packages/b8/50/e5478ff9d82534a944c03b63bc217c5f37019d4a34d288db0f079b13c10b/jiter-0.8.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:9c63eaef32b7bebac8ebebf4dabebdbc6769a09c127294db6babee38e9f405b9", size = 510402 },
{ url = "https://files.pythonhosted.org/packages/8e/1e/3de48bbebbc8f7025bd454cedc8c62378c0e32dd483dece5f4a814a5cb55/jiter-0.8.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:eb21aaa9a200d0a80dacc7a81038d2e476ffe473ffdd9c91eb745d623561de05", size = 503018 },
{ url = "https://files.pythonhosted.org/packages/d5/cd/d5a5501d72a11fe3e5fd65c78c884e5164eefe80077680533919be22d3a3/jiter-0.8.2-cp313-cp313-win32.whl", hash = "sha256:789361ed945d8d42850f919342a8665d2dc79e7e44ca1c97cc786966a21f627a", size = 203190 },
{ url = "https://files.pythonhosted.org/packages/51/bf/e5ca301245ba951447e3ad677a02a64a8845b185de2603dabd83e1e4b9c6/jiter-0.8.2-cp313-cp313-win_amd64.whl", hash = "sha256:ab7f43235d71e03b941c1630f4b6e3055d46b6cb8728a17663eaac9d8e83a865", size = 203551 },
{ url = "https://files.pythonhosted.org/packages/2f/3c/71a491952c37b87d127790dd7a0b1ebea0514c6b6ad30085b16bbe00aee6/jiter-0.8.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b426f72cd77da3fec300ed3bc990895e2dd6b49e3bfe6c438592a3ba660e41ca", size = 308347 },
{ url = "https://files.pythonhosted.org/packages/a0/4c/c02408042e6a7605ec063daed138e07b982fdb98467deaaf1c90950cf2c6/jiter-0.8.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2dd880785088ff2ad21ffee205e58a8c1ddabc63612444ae41e5e4b321b39c0", size = 342875 },
{ url = "https://files.pythonhosted.org/packages/91/61/c80ef80ed8a0a21158e289ef70dac01e351d929a1c30cb0f49be60772547/jiter-0.8.2-cp313-cp313t-win_amd64.whl", hash = "sha256:3ac9f578c46f22405ff7f8b1f5848fb753cc4b8377fbec8470a7dc3997ca7566", size = 202374 },
]
[[package]]
name = "markdown-it-py"
version = "3.0.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "mdurl" },
]
sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528 },
]
[[package]]
name = "mdurl"
version = "0.1.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979 },
]
[[package]]
name = "openai"
version = "1.58.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
{ name = "distro" },
{ name = "httpx" },
{ name = "jiter" },
{ name = "pydantic" },
{ name = "sniffio" },
{ name = "tqdm" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/27/3c/b1ecce430ed56fa3ac1b0676966d3250aab9c70a408232b71e419ea62148/openai-1.58.1.tar.gz", hash = "sha256:f5a035fd01e141fc743f4b0e02c41ca49be8fab0866d3b67f5f29b4f4d3c0973", size = 343411 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/8e/5a/d22cd07f1a99b9e8b3c92ee0c1959188db4318828a3d88c9daac120bdd69/openai-1.58.1-py3-none-any.whl", hash = "sha256:e2910b1170a6b7f88ef491ac3a42c387f08bd3db533411f7ee391d166571d63c", size = 454279 },
]
[[package]]
name = "praisonaiagents"
version = "0.0.22"
source = { editable = "." }
dependencies = [
{ name = "openai" },
{ name = "pydantic" },
{ name = "rich" },
]
[package.metadata]
requires-dist = [
{ name = "openai" },
{ name = "pydantic" },
{ name = "rich" },
]
[[package]]
name = "pydantic"
version = "2.10.4"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "annotated-types" },
{ name = "pydantic-core" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/70/7e/fb60e6fee04d0ef8f15e4e01ff187a196fa976eb0f0ab524af4599e5754c/pydantic-2.10.4.tar.gz", hash = "sha256:82f12e9723da6de4fe2ba888b5971157b3be7ad914267dea8f05f82b28254f06", size = 762094 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/f3/26/3e1bbe954fde7ee22a6e7d31582c642aad9e84ffe4b5fb61e63b87cd326f/pydantic-2.10.4-py3-none-any.whl", hash = "sha256:597e135ea68be3a37552fb524bc7d0d66dcf93d395acd93a00682f1efcb8ee3d", size = 431765 },
]
[[package]]
name = "pydantic-core"
version = "2.27.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/fc/01/f3e5ac5e7c25833db5eb555f7b7ab24cd6f8c322d3a3ad2d67a952dc0abc/pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39", size = 413443 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c2/89/f3450af9d09d44eea1f2c369f49e8f181d742f28220f88cc4dfaae91ea6e/pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc", size = 1893421 },
{ url = "https://files.pythonhosted.org/packages/9e/e3/71fe85af2021f3f386da42d291412e5baf6ce7716bd7101ea49c810eda90/pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7", size = 1814998 },
{ url = "https://files.pythonhosted.org/packages/a6/3c/724039e0d848fd69dbf5806894e26479577316c6f0f112bacaf67aa889ac/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15", size = 1826167 },
{ url = "https://files.pythonhosted.org/packages/2b/5b/1b29e8c1fb5f3199a9a57c1452004ff39f494bbe9bdbe9a81e18172e40d3/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306", size = 1865071 },
{ url = "https://files.pythonhosted.org/packages/89/6c/3985203863d76bb7d7266e36970d7e3b6385148c18a68cc8915fd8c84d57/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99", size = 2036244 },
{ url = "https://files.pythonhosted.org/packages/0e/41/f15316858a246b5d723f7d7f599f79e37493b2e84bfc789e58d88c209f8a/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459", size = 2737470 },
{ url = "https://files.pythonhosted.org/packages/a8/7c/b860618c25678bbd6d1d99dbdfdf0510ccb50790099b963ff78a124b754f/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048", size = 1992291 },
{ url = "https://files.pythonhosted.org/packages/bf/73/42c3742a391eccbeab39f15213ecda3104ae8682ba3c0c28069fbcb8c10d/pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d", size = 1994613 },
{ url = "https://files.pythonhosted.org/packages/94/7a/941e89096d1175d56f59340f3a8ebaf20762fef222c298ea96d36a6328c5/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b", size = 2002355 },
{ url = "https://files.pythonhosted.org/packages/6e/95/2359937a73d49e336a5a19848713555605d4d8d6940c3ec6c6c0ca4dcf25/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474", size = 2126661 },
{ url = "https://files.pythonhosted.org/packages/2b/4c/ca02b7bdb6012a1adef21a50625b14f43ed4d11f1fc237f9d7490aa5078c/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6", size = 2153261 },
{ url = "https://files.pythonhosted.org/packages/72/9d/a241db83f973049a1092a079272ffe2e3e82e98561ef6214ab53fe53b1c7/pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c", size = 1812361 },
{ url = "https://files.pythonhosted.org/packages/e8/ef/013f07248041b74abd48a385e2110aa3a9bbfef0fbd97d4e6d07d2f5b89a/pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc", size = 1982484 },
{ url = "https://files.pythonhosted.org/packages/10/1c/16b3a3e3398fd29dca77cea0a1d998d6bde3902fa2706985191e2313cc76/pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4", size = 1867102 },
{ url = "https://files.pythonhosted.org/packages/d6/74/51c8a5482ca447871c93e142d9d4a92ead74de6c8dc5e66733e22c9bba89/pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0", size = 1893127 },
{ url = "https://files.pythonhosted.org/packages/d3/f3/c97e80721735868313c58b89d2de85fa80fe8dfeeed84dc51598b92a135e/pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef", size = 1811340 },
{ url = "https://files.pythonhosted.org/packages/9e/91/840ec1375e686dbae1bd80a9e46c26a1e0083e1186abc610efa3d9a36180/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7", size = 1822900 },
{ url = "https://files.pythonhosted.org/packages/f6/31/4240bc96025035500c18adc149aa6ffdf1a0062a4b525c932065ceb4d868/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934", size = 1869177 },
{ url = "https://files.pythonhosted.org/packages/fa/20/02fbaadb7808be578317015c462655c317a77a7c8f0ef274bc016a784c54/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6", size = 2038046 },
{ url = "https://files.pythonhosted.org/packages/06/86/7f306b904e6c9eccf0668248b3f272090e49c275bc488a7b88b0823444a4/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c", size = 2685386 },
{ url = "https://files.pythonhosted.org/packages/8d/f0/49129b27c43396581a635d8710dae54a791b17dfc50c70164866bbf865e3/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2", size = 1997060 },
{ url = "https://files.pythonhosted.org/packages/0d/0f/943b4af7cd416c477fd40b187036c4f89b416a33d3cc0ab7b82708a667aa/pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4", size = 2004870 },
{ url = "https://files.pythonhosted.org/packages/35/40/aea70b5b1a63911c53a4c8117c0a828d6790483f858041f47bab0b779f44/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3", size = 1999822 },
{ url = "https://files.pythonhosted.org/packages/f2/b3/807b94fd337d58effc5498fd1a7a4d9d59af4133e83e32ae39a96fddec9d/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4", size = 2130364 },
{ url = "https://files.pythonhosted.org/packages/fc/df/791c827cd4ee6efd59248dca9369fb35e80a9484462c33c6649a8d02b565/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57", size = 2158303 },
{ url = "https://files.pythonhosted.org/packages/9b/67/4e197c300976af185b7cef4c02203e175fb127e414125916bf1128b639a9/pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc", size = 1834064 },
{ url = "https://files.pythonhosted.org/packages/1f/ea/cd7209a889163b8dcca139fe32b9687dd05249161a3edda62860430457a5/pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9", size = 1989046 },
{ url = "https://files.pythonhosted.org/packages/bc/49/c54baab2f4658c26ac633d798dab66b4c3a9bbf47cff5284e9c182f4137a/pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b", size = 1885092 },
{ url = "https://files.pythonhosted.org/packages/41/b1/9bc383f48f8002f99104e3acff6cba1231b29ef76cfa45d1506a5cad1f84/pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b", size = 1892709 },
{ url = "https://files.pythonhosted.org/packages/10/6c/e62b8657b834f3eb2961b49ec8e301eb99946245e70bf42c8817350cbefc/pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154", size = 1811273 },
{ url = "https://files.pythonhosted.org/packages/ba/15/52cfe49c8c986e081b863b102d6b859d9defc63446b642ccbbb3742bf371/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9", size = 1823027 },
{ url = "https://files.pythonhosted.org/packages/b1/1c/b6f402cfc18ec0024120602bdbcebc7bdd5b856528c013bd4d13865ca473/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9", size = 1868888 },
{ url = "https://files.pythonhosted.org/packages/bd/7b/8cb75b66ac37bc2975a3b7de99f3c6f355fcc4d89820b61dffa8f1e81677/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1", size = 2037738 },
{ url = "https://files.pythonhosted.org/packages/c8/f1/786d8fe78970a06f61df22cba58e365ce304bf9b9f46cc71c8c424e0c334/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a", size = 2685138 },
{ url = "https://files.pythonhosted.org/packages/a6/74/d12b2cd841d8724dc8ffb13fc5cef86566a53ed358103150209ecd5d1999/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e", size = 1997025 },
{ url = "https://files.pythonhosted.org/packages/a0/6e/940bcd631bc4d9a06c9539b51f070b66e8f370ed0933f392db6ff350d873/pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4", size = 2004633 },
{ url = "https://files.pythonhosted.org/packages/50/cc/a46b34f1708d82498c227d5d80ce615b2dd502ddcfd8376fc14a36655af1/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27", size = 1999404 },
{ url = "https://files.pythonhosted.org/packages/ca/2d/c365cfa930ed23bc58c41463bae347d1005537dc8db79e998af8ba28d35e/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee", size = 2130130 },
{ url = "https://files.pythonhosted.org/packages/f4/d7/eb64d015c350b7cdb371145b54d96c919d4db516817f31cd1c650cae3b21/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1", size = 2157946 },
{ url = "https://files.pythonhosted.org/packages/a4/99/bddde3ddde76c03b65dfd5a66ab436c4e58ffc42927d4ff1198ffbf96f5f/pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130", size = 1834387 },
{ url = "https://files.pythonhosted.org/packages/71/47/82b5e846e01b26ac6f1893d3c5f9f3a2eb6ba79be26eef0b759b4fe72946/pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee", size = 1990453 },
{ url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186 },
]
[[package]]
name = "pygments"
version = "2.18.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/8e/62/8336eff65bcbc8e4cb5d05b55faf041285951b6e80f33e2bff2024788f31/pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199", size = 4891905 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/f7/3f/01c8b82017c199075f8f788d0d906b9ffbbc5a47dc9918a945e13d5a2bda/pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a", size = 1205513 },
]
[[package]]
name = "rich"
version = "13.9.4"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "markdown-it-py" },
{ name = "pygments" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ab/3a/0316b28d0761c6734d6bc14e770d85506c986c85ffb239e688eeaab2c2bc/rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", size = 223149 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", size = 242424 },
]
[[package]]
name = "sniffio"
version = "1.3.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235 },
]
[[package]]
name = "tqdm"
version = "4.67.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "colorama", marker = "platform_system == 'Windows'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2", size = 169737 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2", size = 78540 },
]
[[package]]
name = "typing-extensions"
version = "4.12.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438 },
]
+1134
View File
File diff suppressed because it is too large. Load diff
-21
View File
@@ -1,21 +0,0 @@
services:
ui:
build:
context: .
dockerfile: Dockerfile.ui
volumes:
- .:/app
ports:
- "8082:8082"
environment:
FLASK_ENV: development
CHAINLIT_PORT: "8082"
CHAINLIT_HOST: "0.0.0.0"
OPENAI_API_KEY: ${OPENAI_API_KEY}
CHAINLIT_AUTH_SECRET: ${CHAINLIT_AUTH_SECRET}
command: praisonai ui --host 0.0.0.0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082"]
interval: 10s
timeout: 5s
retries: 3
+59
View File
@@ -0,0 +1,59 @@
# PraisonAI Docker Environment Configuration
# Copy this file to .env and update with your values
# Required: OpenAI API Key
OPENAI_API_KEY=your_openai_api_key_here
# Required: Chainlit Authentication Secret (generate a random string)
CHAINLIT_AUTH_SECRET=your_chainlit_secret_here
# Optional: Additional API Keys
ANTHROPIC_API_KEY=your_anthropic_api_key_here
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
# Optional: Port Configuration (modify if you have conflicts)
UI_PORT=8082
CHAT_PORT=8083
API_PORT=8080
# Optional: Database Configuration
DATABASE_URL=sqlite:///root/.praison/database.sqlite
# Optional: Logging Configuration
LOG_LEVEL=INFO
PYTHONPATH=/app
# Optional: Development Settings
DEV_MODE=false
DEBUG=false
# Optional: Model Configuration
DEFAULT_MODEL=gpt-4
DEFAULT_TEMPERATURE=0.7
MAX_TOKENS=4000
# Optional: Security Settings
CORS_ORIGINS=http://localhost:3000,http://localhost:8082,http://localhost:8083
RATE_LIMIT=100
# Optional: Feature Flags
ENABLE_CHAT=true
ENABLE_UI=true
ENABLE_API=true
ENABLE_REALTIME=true
# Optional: Volume Paths (for custom mounting)
PRAISON_DATA_PATH=~/.praison
EXAMPLES_PATH=./examples
+46
View File
@@ -0,0 +1,46 @@
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 Python packages (using latest versions)
# Note: praisonai is installed from PyPI - remove version pin to use latest available
RUN pip install --no-cache-dir \
flask \
praisonai \
"praisonai[api]" \
gunicorn \
markdown
# Copy application code
COPY . .
# Set environment variables for directory management
ENV PRAISON_CONFIG_DIR=/root/.praison
ENV DOCKER_CONTAINER=true
# Create health check API if api.py doesn't exist
RUN if [ ! -f api.py ]; then \
echo "from flask import Flask\n\
app = Flask(__name__)\n\
\n\
@app.route('/health')\n\
def health():\n\
return {'status': 'healthy'}, 200\n\
\n\
if __name__ == '__main__':\n\
app.run()" > api.py; \
fi
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
+12 -3
View File
@@ -7,18 +7,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages
# Create praison config directory
RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonaiagents>=0.0.4 \
praisonai_tools \
"praisonai==2.0.18" \
"praisonai>=4.2.4" \
"praisonai[chat]" \
"embedchain[github,youtube]"
# Copy application code
COPY . .
# Set environment variables for directory management
ENV PRAISON_CONFIG_DIR=/root/.praison
ENV CHAINLIT_CONFIG_DIR=/root/.praison
ENV CHAINLIT_DB_DIR=/root/.praison
ENV DOCKER_CONTAINER=true
# Default command (will be overridden by docker-compose)
CMD ["praisonai", "chat"]
+47
View File
@@ -0,0 +1,47 @@
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
portaudio19-dev \
python3-pyaudio \
curl \
git \
vim \
nano \
&& rm -rf /var/lib/apt/lists/*
# Create praison config directory
RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.2.4" \
"praisonai[ui]" \
"praisonai[chat]" \
"praisonai[realtime]" \
"praisonai[code]" \
"embedchain[github,youtube]" \
jupyter \
jupyterlab \
notebook \
pytest \
pytest-asyncio \
mkdocs \
mkdocs-material
# Copy application code
COPY . .
# Set environment variables for directory management
ENV PRAISON_CONFIG_DIR=/root/.praison
ENV CHAINLIT_CONFIG_DIR=/root/.praison
ENV CHAINLIT_DB_DIR=/root/.praison
ENV DOCKER_CONTAINER=true
# Default command (will be overridden by docker-compose)
CMD ["praisonai", "ui"]
+32
View File
@@ -0,0 +1,32 @@
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
# Copy praisonaiagents source
COPY src/praisonai-agents/ /app/praisonaiagents/
WORKDIR /app/praisonaiagents
# Install praisonaiagents with all features (non-editable for production)
RUN pip install --no-cache-dir ".[all]"
# Set environment variables for directory management
ENV PRAISON_CONFIG_DIR=/root/.praison
ENV CHAINLIT_CONFIG_DIR=/root/.praison
ENV CHAINLIT_DB_DIR=/root/.praison
ENV DOCKER_CONTAINER=true
WORKDIR /app
# Default command
CMD ["python", "-c", "import praisonaiagents; print('PraisonAI Agents installed successfully')"]
+25
View File
@@ -0,0 +1,25 @@
# Dockerfile for PraisonAI Serve API
# Deploy to Railway, Render, Fly.io, or any container platform
#
# Build: docker build -f Dockerfile.serve -t praisonai-serve .
# Run: docker run -p 8005:8005 -e OPENAI_API_KEY=sk-xxx praisonai-serve
FROM python:3.11-slim
WORKDIR /app
# Install dependencies
RUN pip install --no-cache-dir praisonai praisonaiagents
# Copy agents configuration
COPY agents.yaml .
# Expose the API port
EXPOSE 8005
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8005/health || exit 1
# Start the API server
CMD ["praisonai", "serve", "agents.yaml", "--host", "0.0.0.0", "--port", "8005"]
+12 -3
View File
@@ -7,18 +7,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages
# Create praison config directory
RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonaiagents>=0.0.4 \
praisonai_tools \
"praisonai==2.0.18" \
"praisonai>=4.2.4" \
"praisonai[ui]" \
"praisonai[crewai]"
# Copy application code
COPY . .
# Set environment variables for directory management
ENV PRAISON_CONFIG_DIR=/root/.praison
ENV CHAINLIT_CONFIG_DIR=/root/.praison
ENV CHAINLIT_DB_DIR=/root/.praison
ENV DOCKER_CONTAINER=true
# Default command (will be overridden by docker-compose)
CMD ["praisonai", "ui"]
+265
View File
@@ -0,0 +1,265 @@
# PraisonAI Docker Setup
This directory contains Docker configurations for running PraisonAI services in containerized environments. The setup addresses directory management issues and provides comprehensive multi-service deployment options.
## 🐳 Available Services
### Core Services
- **UI Service** (`port 8082`) - Chainlit-based web interface
- **Chat Service** (`port 8083`) - Dedicated chat interface
- **API Service** (`port 8080`) - REST API endpoint
- **Agents Service** - Standalone PraisonAI Agents runtime
### Docker Files
- `Dockerfile` - Basic API service
- `Dockerfile.ui` - UI service with web interface
- `Dockerfile.chat` - Chat-focused service
- `Dockerfile.dev` - Development environment with tools
- `Dockerfile.praisonaiagents` - Standalone agents framework
- `docker-compose.yml` - Multi-service orchestration
## 🚀 Quick Start
### Single Service
```bash
# Run UI service
docker run -p 8082:8082 -e OPENAI_API_KEY=your_key ghcr.io/mervinpraison/praisonai:ui
# Run Chat service
docker run -p 8083:8083 -e OPENAI_API_KEY=your_key ghcr.io/mervinpraison/praisonai:chat
# Run API service
docker run -p 8080:8080 -e OPENAI_API_KEY=your_key ghcr.io/mervinpraison/praisonai:api
```
### Multi-Service with Docker Compose
```bash
# Create environment file
cat > .env << EOF
OPENAI_API_KEY=your_openai_api_key_here
CHAINLIT_AUTH_SECRET=your_secret_here
EOF
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
```
## 📁 Directory Management
### Problem Solved
The original issue was that files like `chainlit.md`, `.chainlit` directory, and `public` folder were cluttering the root directory.
### Solution Implemented
All PraisonAI configuration and runtime files are now stored in `~/.praison/`:
```bash
~/.praison/
├── database.sqlite # Chainlit database
├── chainlit.md # Chainlit configuration
├── .chainlit/ # Chainlit runtime files
└── config/ # PraisonAI configuration
```
### Environment Variables
```bash
PRAISON_CONFIG_DIR=/root/.praison # Main config directory
CHAINLIT_CONFIG_DIR=/root/.praison # Chainlit config location
CHAINLIT_DB_DIR=/root/.praison # Database location
```
## 🔧 Service Configuration
### UI Service (Port 8082)
```yaml
environment:
- CHAINLIT_PORT=8082
- CHAINLIT_HOST=0.0.0.0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- CHAINLIT_AUTH_SECRET=${CHAINLIT_AUTH_SECRET}
```
### Chat Service (Port 8083)
```yaml
environment:
- CHAINLIT_PORT=8083
- CHAINLIT_HOST=0.0.0.0
- OPENAI_API_KEY=${OPENAI_API_KEY}
```
### API Service (Port 8080)
```yaml
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
```
## 🎯 Service Endpoints
| Service | Port | Endpoint | Description |
|---------|------|----------|-------------|
| UI | 8082 | http://localhost:8082 | Web interface |
| Chat | 8083 | http://localhost:8083 | Chat interface |
| API | 8080 | http://localhost:8080 | REST API |
| API Health | 8080 | http://localhost:8080/health | Health check |
## 🔍 Health Checks
All services include health checks:
```yaml
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:PORT"]
interval: 10s
timeout: 5s
retries: 3
```
## 📦 Package Versions
All Docker images use consistent, up-to-date versions:
- PraisonAI: `>=2.2.95`
- PraisonAI Agents: `>=0.0.92`
- Python: `3.11-slim`
## 🔒 Security Features
- Non-root user execution where possible
- Minimal base image (python:3.11-slim)
- No unnecessary packages installed
- Environment variable-based configuration
- Volume mounting for persistent data
## 🛠 Development
### Development Environment
```bash
# Use development Dockerfile with additional tools
docker build -f Dockerfile.dev -t praisonai:dev .
docker run -it -v $(pwd):/app praisonai:dev bash
```
### Custom Configuration
```bash
# Mount custom config directory
docker run -v ~/.praison:/root/.praison praisonai:ui
```
## 📊 Monitoring
### Docker Compose Monitoring
```bash
# View service status
docker-compose ps
# View resource usage
docker-compose top
# View logs for specific service
docker-compose logs ui
docker-compose logs chat
docker-compose logs api
```
## 🚨 Troubleshooting
### Common Issues
1. **Port conflicts**
```bash
# Check port usage
netstat -tlnp | grep :8082
# Use different ports
docker run -p 9082:8082 praisonai:ui
```
2. **Environment variables not loading**
```bash
# Verify .env file
cat .env
# Set variables directly
docker run -e OPENAI_API_KEY=your_key praisonai:ui
```
3. **Permission issues**
```bash
# Check volume permissions
ls -la ~/.praison/
# Fix permissions
sudo chown -R $(id -u):$(id -g) ~/.praison/
```
4. **Service won't start**
```bash
# Check logs
docker-compose logs service_name
# Restart service
docker-compose restart service_name
```
## 🔄 Updates
### Pulling Latest Images
```bash
# Pull latest images
docker-compose pull
# Restart with new images
docker-compose up -d
```
### Version Pinning
To use specific versions, update the Dockerfile:
```dockerfile
RUN pip install "praisonai==2.2.95" "praisonaiagents==0.0.92"
```
## 🌐 Production Deployment
### Recommended Production Setup
```yaml
# docker-compose.prod.yml
version: '3.8'
services:
ui:
image: ghcr.io/mervinpraison/praisonai:ui
restart: unless-stopped
environment:
- CHAINLIT_HOST=0.0.0.0
- CHAINLIT_PORT=8082
volumes:
- praison_data:/root/.praison
networks:
- praison_network
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 512M
```
### Load Balancer Configuration
For production environments, consider using nginx or similar:
```nginx
upstream praisonai {
server localhost:8082;
server localhost:8083;
}
server {
listen 80;
location / {
proxy_pass http://praisonai;
}
}
```
This Docker setup provides a clean, organized, and scalable way to deploy PraisonAI services while solving the directory management issues mentioned in the original request.
+15
View File
@@ -0,0 +1,15 @@
# 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
@@ -0,0 +1,42 @@
# 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
@@ -0,0 +1,66 @@
# 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
@@ -0,0 +1,53 @@
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
+190
View File
@@ -0,0 +1,190 @@
version: '3.8'
# Development Docker Compose Configuration
# Extends the main docker-compose.yml with development-specific settings
services:
# Development UI Service with hot reload
ui-dev:
build:
context: ..
dockerfile: docker/Dockerfile.dev
volumes:
- praison_data:/root/.praison
- ../src:/app/src:rw
- ../examples:/app/examples:rw
- ../docs:/app/docs:ro
ports:
- "${UI_PORT:-8082}:8082"
environment:
FLASK_ENV: development
CHAINLIT_PORT: "8082"
CHAINLIT_HOST: "0.0.0.0"
OPENAI_API_KEY: ${OPENAI_API_KEY}
CHAINLIT_AUTH_SECRET: ${CHAINLIT_AUTH_SECRET}
PRAISON_CONFIG_DIR: /root/.praison
CHAINLIT_CONFIG_DIR: /root/.praison
CHAINLIT_DB_DIR: /root/.praison
DEBUG: "true"
DEV_MODE: "true"
PYTHONPATH: /app/src
command: praisonai ui --host 0.0.0.0 --reload
networks:
- praison_network
depends_on:
- database
# Development Chat Service
chat-dev:
build:
context: ..
dockerfile: docker/Dockerfile.dev
volumes:
- praison_data:/root/.praison
- ../src:/app/src:rw
- ../examples:/app/examples:rw
ports:
- "${CHAT_PORT:-8083}:8083"
environment:
CHAINLIT_PORT: "8083"
CHAINLIT_HOST: "0.0.0.0"
OPENAI_API_KEY: ${OPENAI_API_KEY}
CHAINLIT_AUTH_SECRET: ${CHAINLIT_AUTH_SECRET}
PRAISON_CONFIG_DIR: /root/.praison
CHAINLIT_CONFIG_DIR: /root/.praison
CHAINLIT_DB_DIR: /root/.praison
DEBUG: "true"
DEV_MODE: "true"
PYTHONPATH: /app/src
command: praisonai chat --host 0.0.0.0 --port 8083 --reload
networks:
- praison_network
depends_on:
- database
# Development API Service with hot reload
api-dev:
build:
context: ..
dockerfile: docker/Dockerfile.dev
volumes:
- praison_data:/root/.praison
- ../src:/app/src:rw
- ../examples:/app/examples:rw
ports:
- "${API_PORT:-8080}:8080"
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
PRAISON_CONFIG_DIR: /root/.praison
FLASK_ENV: development
DEBUG: "true"
DEV_MODE: "true"
PYTHONPATH: /app/src
command: python -m flask --app api run --host 0.0.0.0 --port 8080 --debug
networks:
- praison_network
depends_on:
- database
# Development Jupyter Notebook Service
jupyter:
build:
context: ..
dockerfile: docker/Dockerfile.dev
volumes:
- praison_data:/root/.praison
- ../src:/app/src:rw
- ../examples:/app/examples:rw
- ../docs:/app/docs:rw
ports:
- "8888:8888"
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
PRAISON_CONFIG_DIR: /root/.praison
JUPYTER_ENABLE_LAB: "yes"
PYTHONPATH: /app/src
command: jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --LabApp.token='' --LabApp.password=''
networks:
- praison_network
# Development Testing Service
test:
build:
context: ..
dockerfile: docker/Dockerfile.dev
volumes:
- ../src:/app/src:rw
- ../tests:/app/tests:rw
- praison_data:/root/.praison
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
PRAISON_CONFIG_DIR: /root/.praison
PYTHONPATH: /app/src
PYTEST_CURRENT_TEST: "true"
command: python -m pytest tests/ -v
networks:
- praison_network
profiles:
- test
# Standalone database for development
database:
security_opt:
- "no-new-privileges:true"
image: postgres:15-alpine
environment:
POSTGRES_DB: praisonai_dev
POSTGRES_USER: praisonai
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-praisonai_dev_pass}
volumes:
- postgres_data:/var/lib/postgresql/data
read_only: true
tmpfs:
- /tmp
- /var/tmp
ports:
- "5432:5432"
networks:
- praison_network
profiles:
- database
# Redis for caching and session management
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- praison_network
profiles:
- cache
# Development documentation server
docs:
build:
context: ..
dockerfile: docker/Dockerfile.dev
volumes:
- ../docs:/app/docs:rw
- ../README.md:/app/README.md:ro
ports:
- "8000:8000"
command: sh -c "cd docs && mkdocs serve --dev-addr 0.0.0.0:8000"
networks:
- praison_network
profiles:
- docs
volumes:
praison_data:
driver: local
postgres_data:
driver: local
redis_data:
driver: local
networks:
praison_network:
driver: bridge
+100
View File
@@ -0,0 +1,100 @@
version: '3.8'
services:
# PraisonAI UI Service
ui:
build:
context: ..
dockerfile: docker/Dockerfile.ui
volumes:
- praison_data:/root/.praison
- .:/app
ports:
- "8082:8082"
environment:
FLASK_ENV: development
CHAINLIT_PORT: "8082"
CHAINLIT_HOST: "0.0.0.0"
OPENAI_API_KEY: ${OPENAI_API_KEY}
CHAINLIT_AUTH_SECRET: ${CHAINLIT_AUTH_SECRET}
PRAISON_CONFIG_DIR: /root/.praison
CHAINLIT_CONFIG_DIR: /root/.praison
CHAINLIT_DB_DIR: /root/.praison
command: praisonai ui --host 0.0.0.0
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8082" ]
interval: 10s
timeout: 5s
retries: 3
networks:
- praison_network
# PraisonAI Chat Service
chat:
build:
context: ..
dockerfile: docker/Dockerfile.chat
volumes:
- praison_data:/root/.praison
- .:/app
ports:
- "8083:8083"
environment:
CHAINLIT_PORT: "8083"
CHAINLIT_HOST: "0.0.0.0"
OPENAI_API_KEY: ${OPENAI_API_KEY}
CHAINLIT_AUTH_SECRET: ${CHAINLIT_AUTH_SECRET}
PRAISON_CONFIG_DIR: /root/.praison
CHAINLIT_CONFIG_DIR: /root/.praison
CHAINLIT_DB_DIR: /root/.praison
command: praisonai chat --host 0.0.0.0 --port 8083
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8083" ]
interval: 10s
timeout: 5s
retries: 3
networks:
- praison_network
# PraisonAI API Service
api:
build:
context: ..
dockerfile: docker/Dockerfile
volumes:
- praison_data:/root/.praison
ports:
- "8080:8080"
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
PRAISON_CONFIG_DIR: /root/.praison
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
interval: 10s
timeout: 5s
retries: 3
networks:
- praison_network
# PraisonAI Agents Service (standalone)
agents:
build:
context: ..
dockerfile: docker/Dockerfile.praisonaiagents
volumes:
- praison_data:/root/.praison
- ./examples:/app/examples
environment:
OPENAI_API_KEY: ${OPENAI_API_KEY}
PRAISON_CONFIG_DIR: /root/.praison
networks:
- praison_network
# For bot services (Slack, Discord, Telegram), see docker/bots/
volumes:
praison_data:
driver: local
networks:
praison_network:
driver: bridge
+289
View File
@@ -0,0 +1,289 @@
#!/bin/bash
# PraisonAI Docker Quick Start Script
# This script helps users quickly get started with PraisonAI using Docker
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Docker is installed
check_docker() {
if ! command -v docker &> /dev/null; then
print_error "Docker is not installed. Please install Docker first:"
echo " - Visit: https://docs.docker.com/get-docker/"
exit 1
fi
if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then
print_error "Docker Compose is not available. Please install Docker Compose:"
echo " - Visit: https://docs.docker.com/compose/install/"
exit 1
fi
print_success "Docker and Docker Compose are available"
}
# Check if .env file exists, create from template if not
setup_environment() {
if [ ! -f ".env" ]; then
print_status "Creating .env file from template..."
if [ -f ".env.template" ]; then
cp .env.template .env
else
cat > .env << EOF
# PraisonAI Docker Environment Configuration
OPENAI_API_KEY=your_openai_api_key_here
CHAINLIT_AUTH_SECRET=$(openssl rand -hex 32 2>/dev/null || echo "your_chainlit_secret_here")
FLASK_ENV=development
CHAINLIT_HOST=0.0.0.0
UI_PORT=8082
CHAT_PORT=8083
API_PORT=8080
EOF
fi
print_warning "Please edit .env file and add your API keys before continuing"
print_status "Required: OPENAI_API_KEY"
read -p "Press Enter to continue after updating .env file..."
else
print_success ".env file already exists"
fi
}
# Function to show menu
show_menu() {
echo ""
echo "=== PraisonAI Docker Quick Start ==="
echo ""
echo "1) Start UI Service (Web Interface) - Port 8082"
echo "2) Start Chat Service - Port 8083"
echo "3) Start API Service - Port 8080"
echo "4) Start All Services (Recommended)"
echo "5) Start Development Environment"
echo "6) View Service Status"
echo "7) View Logs"
echo "8) Stop All Services"
echo "9) Pull Latest Images"
echo "10) Clean Up (Remove containers and volumes)"
echo "11) Show Service URLs"
echo "0) Exit"
echo ""
}
# Start specific service
start_service() {
local service=$1
print_status "Starting $service service..."
docker-compose up -d $service
print_success "$service service started"
}
# Start all services
start_all_services() {
print_status "Starting all PraisonAI services..."
docker-compose up -d
print_success "All services started"
show_service_urls
}
# Start development environment
start_dev_environment() {
print_status "Starting development environment..."
if [ -f "docker-compose.dev.yml" ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d ui-dev chat-dev api-dev
print_success "Development environment started"
echo ""
echo "Development services available:"
echo " - UI (with hot reload): http://localhost:${UI_PORT:-8082}"
echo " - Chat (with hot reload): http://localhost:${CHAT_PORT:-8083}"
echo " - API (with hot reload): http://localhost:${API_PORT:-8080}"
echo " - Jupyter Lab: http://localhost:8888"
echo ""
else
print_warning "Development configuration not found, starting regular services"
start_all_services
fi
}
# Show service status
show_status() {
print_status "Service Status:"
docker-compose ps
}
# Show logs
show_logs() {
echo ""
echo "Which service logs would you like to view?"
echo "1) All services"
echo "2) UI service"
echo "3) Chat service"
echo "4) API service"
echo "5) Agents service"
read -p "Enter choice (1-5): " log_choice
case $log_choice in
1) docker-compose logs -f ;;
2) docker-compose logs -f ui ;;
3) docker-compose logs -f chat ;;
4) docker-compose logs -f api ;;
5) docker-compose logs -f agents ;;
*) print_error "Invalid choice" ;;
esac
}
# Stop all services
stop_services() {
print_status "Stopping all services..."
docker-compose down
print_success "All services stopped"
}
# Pull latest images
pull_images() {
print_status "Pulling latest images..."
docker-compose pull
print_success "Images updated"
}
# Clean up
cleanup() {
print_warning "This will remove all containers, networks, and volumes"
read -p "Are you sure? (y/N): " confirm
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then
print_status "Cleaning up..."
docker-compose down -v --remove-orphans
docker system prune -f
print_success "Cleanup completed"
fi
}
# Show service URLs
show_service_urls() {
local ui_port=${UI_PORT:-8082}
local chat_port=${CHAT_PORT:-8083}
local api_port=${API_PORT:-8080}
echo ""
echo "=== Service URLs ==="
echo "UI Service: http://localhost:$ui_port"
echo "Chat Service: http://localhost:$chat_port"
echo "API Service: http://localhost:$api_port"
echo "API Health: http://localhost:$api_port/health"
echo ""
}
# Check system requirements
check_requirements() {
print_status "Checking system requirements..."
# Check available memory
if command -v free &> /dev/null; then
available_ram=$(free -m | awk 'NR==2{printf "%.1f", $7/1024}')
print_status "Available RAM: ${available_ram}GB"
if (( $(echo "$available_ram < 2.0" | bc -l 2>/dev/null || echo "1") )); then
print_warning "Low available memory. Recommended: 2GB+ available RAM"
fi
fi
# Check disk space
if command -v df &> /dev/null; then
available_space=$(df -BG . | awk 'NR==2{print $4}' | sed 's/G//')
print_status "Available disk space: ${available_space}GB"
if [ "$available_space" -lt 5 ]; then
print_warning "Low disk space. Recommended: 5GB+ available space"
fi
fi
}
# Main function
main() {
clear
echo "🤖 Welcome to PraisonAI Docker Setup!"
echo ""
# Check prerequisites
check_docker
check_requirements
setup_environment
# Main loop
while true; do
show_menu
read -p "Enter your choice (0-11): " choice
case $choice in
1)
start_service "ui"
echo "UI Service: http://localhost:${UI_PORT:-8082}"
;;
2)
start_service "chat"
echo "Chat Service: http://localhost:${CHAT_PORT:-8083}"
;;
3)
start_service "api"
echo "API Service: http://localhost:${API_PORT:-8080}"
;;
4)
start_all_services
;;
5)
start_dev_environment
;;
6)
show_status
;;
7)
show_logs
;;
8)
stop_services
;;
9)
pull_images
;;
10)
cleanup
;;
11)
show_service_urls
;;
0)
print_success "Thank you for using PraisonAI!"
exit 0
;;
*)
print_error "Invalid choice. Please try again."
;;
esac
echo ""
read -p "Press Enter to continue..."
done
}
# Run main function
main
File renamed without changes.
File renamed without changes.
-1
View File
@@ -1 +0,0 @@
docs.praison.ai
-20
View File
@@ -1,20 +0,0 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-45
View File
@@ -1,45 +0,0 @@
---
title: 'API Reference'
description: 'PraisonAI API documentation with framework-specific details'
icon: "book-open"
---
# API Reference
This section provides detailed information about the PraisonAI API and its framework-specific implementations.
## Core Modules
- [praisonai](../api/praisonai/index) - Core package functionality
- [praisonai.auto](../api/praisonai/auto) - Automated agent generation
- [praisonai.agents_generator](../api/praisonai/agents_generator) - Framework-specific agent generation
- [praisonai.cli](../api/praisonai/cli) - Command-line interface
- [praisonai.deploy](../api/praisonai/deploy) - Deployment utilities
## Framework Support
### CrewAI Integration
Requires installation with:
```bash
pip install "praisonai[crewai]"
```
Features:
- Task delegation
- Sequential/parallel execution
- Built-in tools
- Structured workflows
### AutoGen Integration
Requires installation with:
```bash
pip install "praisonai[autogen]"
```
Features:
- Multi-agent conversations
- Code execution
- Built-in tools
- Flexible interactions
For detailed API documentation of each module, please refer to the generated files in the `api` folder.
-79
View File
@@ -1,79 +0,0 @@
---
title: "API Reference"
description: "Complete API reference for PraisonAI, including core modules, installation options, and framework-specific features"
icon: "code"
---
## Core Modules
### praisonai
The main package containing core functionality.
```python
from praisonai import PraisonAI
```
### praisonai.auto
Automated agent generation functionality.
```python
from praisonai.auto import AutoGenerator
```
### praisonai.agents_generator
Framework-specific agent generation and orchestration:
- CrewAI support (requires `praisonai[crewai]`)
- AutoGen support (requires `praisonai[autogen]`)
```python
from praisonai.agents_generator import AgentsGenerator
```
### praisonai.cli
Command-line interface with framework-specific handling.
```python
from praisonai.cli import PraisonAI
```
### praisonai.deploy
Deployment utilities.
```python
from praisonai.deploy import CloudDeployer
```
## Installation Options
```bash
# Basic installation
pip install praisonai
# Framework-specific installations
pip install "praisonai[crewai]" # Install with CrewAI support
pip install "praisonai[autogen]" # Install with AutoGen support
pip install "praisonai[crewai,autogen]" # Install both frameworks
# Additional features
pip install "praisonai[ui]" # Install UI support
pip install "praisonai[chat]" # Install Chat interface
pip install "praisonai[code]" # Install Code interface
pip install "praisonai[realtime]" # Install Realtime voice interaction
pip install "praisonai[call]" # Install Call feature
```
## Framework-specific Features
### CrewAI
When installing with `pip install "praisonai[crewai]"`, you get:
- CrewAI framework support
- PraisonAI tools integration
- Task delegation capabilities
- Sequential and parallel task execution
### AutoGen
When installing with `pip install "praisonai[autogen]"`, you get:
- AutoGen framework support
- PraisonAI tools integration
- Multi-agent conversation capabilities
- Code execution environment
-566
View File
@@ -1,566 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.agents_generator API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.agents_generator</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.agents_generator.disable_crewai_telemetry"><code class="name flex">
<span>def <span class="ident">disable_crewai_telemetry</span></span>(<span>)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.agents_generator.noop"><code class="name flex">
<span>def <span class="ident">noop</span></span>(<span>*args, **kwargs)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.agents_generator.AgentsGenerator"><code class="flex name class">
<span>class <span class="ident">AgentsGenerator</span></span>
<span>(</span><span>agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None, agent_yaml=None, tools=None)</span>
</code></dt>
<dd>
<div class="desc"><p>Initialize the AgentsGenerator object.</p>
<h2 id="parameters">Parameters</h2>
<p>agent_file (str): The path to the agent file.
framework (str): The framework to be used for the agents.
config_list (list): A list of configurations for the agents.
log_level (int, optional): The logging level to use. Defaults to logging.INFO.
agent_callback (callable, optional): A callback function to be executed after each agent step.
task_callback (callable, optional): A callback function to be executed after each tool run.
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
tools (dict, optional): A dictionary containing the tools to be used for the agents. Defaults to None.</p>
<h2 id="attributes">Attributes</h2>
<dl>
<dt><strong><code>agent_file</code></strong> :&ensp;<code>str</code></dt>
<dd>The path to the agent file.</dd>
<dt><strong><code>framework</code></strong> :&ensp;<code>str</code></dt>
<dd>The framework to be used for the agents.</dd>
<dt><strong><code>config_list</code></strong> :&ensp;<code>list</code></dt>
<dd>A list of configurations for the agents.</dd>
<dt><strong><code>log_level</code></strong> :&ensp;<code>int</code></dt>
<dd>The logging level to use.</dd>
<dt><strong><code>agent_callback</code></strong> :&ensp;<code>callable</code>, optional</dt>
<dd>A callback function to be executed after each agent step.</dd>
<dt><strong><code>task_callback</code></strong> :&ensp;<code>callable</code>, optional</dt>
<dd>A callback function to be executed after each tool run.</dd>
<dt><strong><code>tools</code></strong> :&ensp;<code>dict</code></dt>
<dd>A dictionary containing the tools to be used for the agents.</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class AgentsGenerator:
def __init__(self, agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None, agent_yaml=None, tools=None):
&#34;&#34;&#34;
Initialize the AgentsGenerator object.
Parameters:
agent_file (str): The path to the agent file.
framework (str): The framework to be used for the agents.
config_list (list): A list of configurations for the agents.
log_level (int, optional): The logging level to use. Defaults to logging.INFO.
agent_callback (callable, optional): A callback function to be executed after each agent step.
task_callback (callable, optional): A callback function to be executed after each tool run.
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
tools (dict, optional): A dictionary containing the tools to be used for the agents. Defaults to None.
Attributes:
agent_file (str): The path to the agent file.
framework (str): The framework to be used for the agents.
config_list (list): A list of configurations for the agents.
log_level (int): The logging level to use.
agent_callback (callable, optional): A callback function to be executed after each agent step.
task_callback (callable, optional): A callback function to be executed after each tool run.
tools (dict): A dictionary containing the tools to be used for the agents.
&#34;&#34;&#34;
self.agent_file = agent_file
self.framework = framework
self.config_list = config_list
self.log_level = log_level
self.agent_callback = agent_callback
self.task_callback = task_callback
self.agent_yaml = agent_yaml
self.tools = tools or [] # Store tool class names as a list
self.log_level = log_level or logging.getLogger().getEffectiveLevel()
if self.log_level == logging.NOTSET:
self.log_level = os.environ.get(&#39;LOGLEVEL&#39;, &#39;INFO&#39;).upper()
logging.basicConfig(level=self.log_level, format=&#39;%(asctime)s - %(levelname)s - %(message)s&#39;)
self.logger = logging.getLogger(__name__)
self.logger.setLevel(self.log_level)
def is_function_or_decorated(self, obj):
&#34;&#34;&#34;
Checks if the given object is a function or has a __call__ method.
Parameters:
obj (object): The object to be checked.
Returns:
bool: True if the object is a function or has a __call__ method, False otherwise.
&#34;&#34;&#34;
return inspect.isfunction(obj) or hasattr(obj, &#39;__call__&#39;)
def load_tools_from_module(self, module_path):
&#34;&#34;&#34;
Loads tools from a specified module path.
Parameters:
module_path (str): The path to the module containing the tools.
Returns:
dict: A dictionary containing the names of the tools as keys and the corresponding functions or objects as values.
Raises:
FileNotFoundError: If the specified module path does not exist.
&#34;&#34;&#34;
spec = importlib.util.spec_from_file_location(&#34;tools_module&#34;, module_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return {name: obj for name, obj in inspect.getmembers(module, self.is_function_or_decorated)}
def load_tools_from_module_class(self, module_path):
&#34;&#34;&#34;
Loads tools from a specified module path containing classes that inherit from BaseTool or are part of langchain_community.tools package.
Parameters:
module_path (str): The path to the module containing the tools.
Returns:
dict: A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
Raises:
FileNotFoundError: If the specified module path does not exist.
&#34;&#34;&#34;
spec = importlib.util.spec_from_file_location(&#34;tools_module&#34;, module_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return {name: obj() for name, obj in inspect.getmembers(module, lambda x: inspect.isclass(x) and (x.__module__.startswith(&#39;langchain_community.tools&#39;) or issubclass(x, BaseTool)) and x is not BaseTool)}
def load_tools_from_package(self, package_path):
&#34;&#34;&#34;
Loads tools from a specified package path containing modules with functions or classes.
Parameters:
package_path (str): The path to the package containing the tools.
Returns:
dict: A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
Raises:
FileNotFoundError: If the specified package path does not exist.
This function iterates through all the .py files in the specified package path, excluding those that start with &#34;__&#34;. For each file, it imports the corresponding module and checks if it contains any functions or classes that can be loaded as tools. The function then returns a dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.
&#34;&#34;&#34;
tools_dict = {}
for module_file in os.listdir(package_path):
if module_file.endswith(&#39;.py&#39;) and not module_file.startswith(&#39;__&#39;):
module_name = f&#34;{package_path.name}.{module_file[:-3]}&#34; # Remove .py for import
module = importlib.import_module(module_name)
for name, obj in inspect.getmembers(module, self.is_function_or_decorated):
tools_dict[name] = obj
return tools_dict
def generate_crew_and_kickoff(self):
&#34;&#34;&#34;
Generates a crew of agents and initiates tasks based on the provided configuration.
Parameters:
agent_file (str): The path to the agent file.
framework (str): The framework to be used for the agents.
config_list (list): A list of configurations for the agents.
Returns:
str: The output of the tasks performed by the crew of agents.
Raises:
FileNotFoundError: If the specified agent file does not exist.
This function first loads the agent configuration from the specified file. It then initializes the tools required for the agents based on the specified framework. If the specified framework is &#34;autogen&#34;, it loads the LLM configuration dynamically and creates an AssistantAgent for each role in the configuration. It then adds tools to the agents if specified in the configuration. Finally, it prepares tasks for the agents based on the configuration and initiates the tasks using the crew of agents. If the specified framework is not &#34;autogen&#34;, it creates a crew of agents and initiates tasks based on the configuration.
&#34;&#34;&#34;
if self.agent_yaml:
config = yaml.safe_load(self.agent_yaml)
else:
if self.agent_file == &#39;/app/api:app&#39; or self.agent_file == &#39;api:app&#39;:
self.agent_file = &#39;agents.yaml&#39;
try:
with open(self.agent_file, &#39;r&#39;) as f:
config = yaml.safe_load(f)
except FileNotFoundError:
print(f&#34;File not found: {self.agent_file}&#34;)
return
topic = config[&#39;topic&#39;]
tools_dict = {
&#39;CodeDocsSearchTool&#39;: CodeDocsSearchTool(),
&#39;CSVSearchTool&#39;: CSVSearchTool(),
&#39;DirectorySearchTool&#39;: DirectorySearchTool(),
&#39;DOCXSearchTool&#39;: DOCXSearchTool(),
&#39;DirectoryReadTool&#39;: DirectoryReadTool(),
&#39;FileReadTool&#39;: FileReadTool(),
# &#39;GithubSearchTool&#39;: GithubSearchTool(),
# &#39;SeperDevTool&#39;: SeperDevTool(),
&#39;TXTSearchTool&#39;: TXTSearchTool(),
&#39;JSONSearchTool&#39;: JSONSearchTool(),
&#39;MDXSearchTool&#39;: MDXSearchTool(),
&#39;PDFSearchTool&#39;: PDFSearchTool(),
# &#39;PGSearchTool&#39;: PGSearchTool(),
&#39;RagTool&#39;: RagTool(),
&#39;ScrapeElementFromWebsiteTool&#39;: ScrapeElementFromWebsiteTool(),
&#39;ScrapeWebsiteTool&#39;: ScrapeWebsiteTool(),
&#39;WebsiteSearchTool&#39;: WebsiteSearchTool(),
&#39;XMLSearchTool&#39;: XMLSearchTool(),
&#39;YoutubeChannelSearchTool&#39;: YoutubeChannelSearchTool(),
&#39;YoutubeVideoSearchTool&#39;: YoutubeVideoSearchTool(),
}
# Add tools from class names
for tool_class in self.tools:
if isinstance(tool_class, type) and issubclass(tool_class, BaseTool):
tool_name = tool_class.__name__
tools_dict[tool_name] = tool_class()
self.logger.debug(f&#34;Added tool: {tool_name}&#34;)
root_directory = os.getcwd()
tools_py_path = os.path.join(root_directory, &#39;tools.py&#39;)
tools_dir_path = Path(root_directory) / &#39;tools&#39;
if os.path.isfile(tools_py_path):
tools_dict.update(self.load_tools_from_module_class(tools_py_path))
self.logger.debug(&#34;tools.py exists in the root directory. Loading tools.py and skipping tools folder.&#34;)
elif tools_dir_path.is_dir():
tools_dict.update(self.load_tools_from_module_class(tools_dir_path))
self.logger.debug(&#34;tools folder exists in the root directory&#34;)
framework = self.framework or config.get(&#39;framework&#39;)
agents = {}
tasks = []
if framework == &#34;autogen&#34;:
# Load the LLM configuration dynamically
# print(self.config_list)
llm_config = {&#34;config_list&#34;: self.config_list}
if agentops_exists:
agentops.init(os.environ.get(&#34;AGENTOPS_API_KEY&#34;), tags=[&#34;autogen&#34;])
# Assuming the user proxy agent is set up as per your requirements
user_proxy = autogen.UserProxyAgent(
name=&#34;User&#34;,
human_input_mode=&#34;NEVER&#34;,
is_termination_msg=lambda x: (x.get(&#34;content&#34;) or &#34;&#34;).rstrip().rstrip(&#34;.&#34;).lower().endswith(&#34;terminate&#34;) or &#34;TERMINATE&#34; in (x.get(&#34;content&#34;) or &#34;&#34;),
code_execution_config={
&#34;work_dir&#34;: &#34;coding&#34;,
&#34;use_docker&#34;: False,
},
# additional setup for the user proxy agent
)
for role, details in config[&#39;roles&#39;].items():
agent_name = details[&#39;role&#39;].format(topic=topic).replace(&#34;{topic}&#34;, topic)
agent_goal = details[&#39;goal&#39;].format(topic=topic)
# Creating an AssistantAgent for each role dynamically
agents[role] = autogen.AssistantAgent(
name=agent_name,
llm_config=llm_config,
system_message=details[&#39;backstory&#39;].format(topic=topic)+&#34;. Must Reply \&#34;TERMINATE\&#34; in the end when everything is done.&#34;,
)
for tool in details.get(&#39;tools&#39;, []):
if tool in tools_dict:
try:
tool_class = globals()[f&#39;autogen_{type(tools_dict[tool]).__name__}&#39;]
print(f&#34;Found {tool_class.__name__} for {tool}&#34;)
except KeyError:
print(f&#34;Warning: autogen_{type(tools_dict[tool]).__name__} function not found. Skipping this tool.&#34;)
continue
tool_class(agents[role], user_proxy)
# Preparing tasks for initiate_chats
for task_name, task_details in details.get(&#39;tasks&#39;, {}).items():
description_filled = task_details[&#39;description&#39;].format(topic=topic)
expected_output_filled = task_details[&#39;expected_output&#39;].format(topic=topic)
chat_task = {
&#34;recipient&#34;: agents[role],
&#34;message&#34;: description_filled,
&#34;summary_method&#34;: &#34;last_msg&#34;,
# Additional fields like carryover can be added based on dependencies
}
tasks.append(chat_task)
response = user_proxy.initiate_chats(tasks)
result = &#34;### Output ###\n&#34;+response[-1].summary if hasattr(response[-1], &#39;summary&#39;) else &#34;&#34;
if agentops_exists:
agentops.end_session(&#34;Success&#34;)
else: # framework=crewai
if agentops_exists:
agentops.init(os.environ.get(&#34;AGENTOPS_API_KEY&#34;), tags=[&#34;crewai&#34;])
tasks_dict = {}
for role, details in config[&#39;roles&#39;].items():
role_filled = details[&#39;role&#39;].format(topic=topic)
goal_filled = details[&#39;goal&#39;].format(topic=topic)
backstory_filled = details[&#39;backstory&#39;].format(topic=topic)
# Adding tools to the agent if exists
agent_tools = [tools_dict[tool] for tool in details.get(&#39;tools&#39;, []) if tool in tools_dict]
llm_model = details.get(&#39;llm&#39;) # Get the llm configuration
if llm_model:
llm = PraisonAIModel(
model=llm_model.get(&#34;model&#34;, os.environ.get(&#34;MODEL_NAME&#34;, &#34;openai/gpt-4o&#34;)),
).get_model()
else:
llm = PraisonAIModel().get_model()
function_calling_llm_model = details.get(&#39;function_calling_llm&#39;)
if function_calling_llm_model:
function_calling_llm = PraisonAIModel(
model=function_calling_llm_model.get(&#34;model&#34;, os.environ.get(&#34;MODEL_NAME&#34;, &#34;openai/gpt-4o&#34;)),
).get_model()
else:
function_calling_llm = PraisonAIModel().get_model()
agent = Agent(
role=role_filled,
goal=goal_filled,
backstory=backstory_filled,
tools=agent_tools,
allow_delegation=details.get(&#39;allow_delegation&#39;, False),
llm=llm,
function_calling_llm=function_calling_llm,
max_iter=details.get(&#39;max_iter&#39;, 15),
max_rpm=details.get(&#39;max_rpm&#39;),
max_execution_time=details.get(&#39;max_execution_time&#39;),
verbose=details.get(&#39;verbose&#39;, True),
cache=details.get(&#39;cache&#39;, True),
system_template=details.get(&#39;system_template&#39;),
prompt_template=details.get(&#39;prompt_template&#39;),
response_template=details.get(&#39;response_template&#39;),
)
# Set agent callback if provided
if self.agent_callback:
agent.step_callback = self.agent_callback
agents[role] = agent
for task_name, task_details in details.get(&#39;tasks&#39;, {}).items():
description_filled = task_details[&#39;description&#39;].format(topic=topic)
expected_output_filled = task_details[&#39;expected_output&#39;].format(topic=topic)
task = Task(
description=description_filled, # Clear, concise statement of what the task entails
expected_output=expected_output_filled, # Detailed description of what task&#39;s completion looks like
agent=agent, # The agent responsible for the task
tools=task_details.get(&#39;tools&#39;, []), # Functions or capabilities the agent can utilize
async_execution=task_details.get(&#39;async_execution&#39;) if task_details.get(&#39;async_execution&#39;) is not None else False, # Execute asynchronously if set
context=[], ## TODO:
config=task_details.get(&#39;config&#39;) if task_details.get(&#39;config&#39;) is not None else {}, # Additional configuration details
output_json=task_details.get(&#39;output_json&#39;) if task_details.get(&#39;output_json&#39;) is not None else None, # Outputs a JSON object
output_pydantic=task_details.get(&#39;output_pydantic&#39;) if task_details.get(&#39;output_pydantic&#39;) is not None else None, # Outputs a Pydantic model object
output_file=task_details.get(&#39;output_file&#39;) if task_details.get(&#39;output_file&#39;) is not None else &#34;&#34;, # Saves the task output to a file
callback=task_details.get(&#39;callback&#39;) if task_details.get(&#39;callback&#39;) is not None else None, # Python callable executed with the task&#39;s output
human_input=task_details.get(&#39;human_input&#39;) if task_details.get(&#39;human_input&#39;) is not None else False, # Indicates if the task requires human feedback
create_directory=task_details.get(&#39;create_directory&#39;) if task_details.get(&#39;create_directory&#39;) is not None else False # Indicates if a directory needs to be created
)
# Set tool callback if provided
if self.task_callback:
task.callback = self.task_callback
tasks.append(task)
tasks_dict[task_name] = task
for role, details in config[&#39;roles&#39;].items():
for task_name, task_details in details.get(&#39;tasks&#39;, {}).items():
task = tasks_dict[task_name]
context_tasks = [tasks_dict[ctx] for ctx in task_details.get(&#39;context&#39;, []) if ctx in tasks_dict]
task.context = context_tasks
crew = Crew(
agents=list(agents.values()),
tasks=tasks,
verbose=2
)
self.logger.debug(&#34;Final Crew Configuration:&#34;)
self.logger.debug(f&#34;Agents: {crew.agents}&#34;)
self.logger.debug(f&#34;Tasks: {crew.tasks}&#34;)
response = crew.kickoff()
result = f&#34;### Task Output ###\n{response}&#34;
if agentops_exists:
agentops.end_session(&#34;Success&#34;)
return result</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="praisonai.agents_generator.AgentsGenerator.generate_crew_and_kickoff"><code class="name flex">
<span>def <span class="ident">generate_crew_and_kickoff</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Generates a crew of agents and initiates tasks based on the provided configuration.</p>
<h2 id="parameters">Parameters</h2>
<p>agent_file (str): The path to the agent file.
framework (str): The framework to be used for the agents.
config_list (list): A list of configurations for the agents.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>str</code></dt>
<dd>The output of the tasks performed by the crew of agents.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>FileNotFoundError</code></dt>
<dd>If the specified agent file does not exist.</dd>
</dl>
<p>This function first loads the agent configuration from the specified file. It then initializes the tools required for the agents based on the specified framework. If the specified framework is "autogen", it loads the LLM configuration dynamically and creates an AssistantAgent for each role in the configuration. It then adds tools to the agents if specified in the configuration. Finally, it prepares tasks for the agents based on the configuration and initiates the tasks using the crew of agents. If the specified framework is not "autogen", it creates a crew of agents and initiates tasks based on the configuration.</p></div>
</dd>
<dt id="praisonai.agents_generator.AgentsGenerator.is_function_or_decorated"><code class="name flex">
<span>def <span class="ident">is_function_or_decorated</span></span>(<span>self, obj)</span>
</code></dt>
<dd>
<div class="desc"><p>Checks if the given object is a function or has a <strong>call</strong> method.</p>
<h2 id="parameters">Parameters</h2>
<p>obj (object): The object to be checked.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>bool</code></dt>
<dd>True if the object is a function or has a <strong>call</strong> method, False otherwise.</dd>
</dl></div>
</dd>
<dt id="praisonai.agents_generator.AgentsGenerator.load_tools_from_module"><code class="name flex">
<span>def <span class="ident">load_tools_from_module</span></span>(<span>self, module_path)</span>
</code></dt>
<dd>
<div class="desc"><p>Loads tools from a specified module path.</p>
<h2 id="parameters">Parameters</h2>
<p>module_path (str): The path to the module containing the tools.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>dict</code></dt>
<dd>A dictionary containing the names of the tools as keys and the corresponding functions or objects as values.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>FileNotFoundError</code></dt>
<dd>If the specified module path does not exist.</dd>
</dl></div>
</dd>
<dt id="praisonai.agents_generator.AgentsGenerator.load_tools_from_module_class"><code class="name flex">
<span>def <span class="ident">load_tools_from_module_class</span></span>(<span>self, module_path)</span>
</code></dt>
<dd>
<div class="desc"><p>Loads tools from a specified module path containing classes that inherit from BaseTool or are part of langchain_community.tools package.</p>
<h2 id="parameters">Parameters</h2>
<p>module_path (str): The path to the module containing the tools.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>dict</code></dt>
<dd>A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>FileNotFoundError</code></dt>
<dd>If the specified module path does not exist.</dd>
</dl></div>
</dd>
<dt id="praisonai.agents_generator.AgentsGenerator.load_tools_from_package"><code class="name flex">
<span>def <span class="ident">load_tools_from_package</span></span>(<span>self, package_path)</span>
</code></dt>
<dd>
<div class="desc"><p>Loads tools from a specified package path containing modules with functions or classes.</p>
<h2 id="parameters">Parameters</h2>
<p>package_path (str): The path to the package containing the tools.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>dict</code></dt>
<dd>A dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>FileNotFoundError</code></dt>
<dd>If the specified package path does not exist.</dd>
</dl>
<p>This function iterates through all the .py files in the specified package path, excluding those that start with "__". For each file, it imports the corresponding module and checks if it contains any functions or classes that can be loaded as tools. The function then returns a dictionary containing the names of the tools as keys and the corresponding initialized instances of the classes as values.</p></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.agents_generator.disable_crewai_telemetry" href="#praisonai.agents_generator.disable_crewai_telemetry">disable_crewai_telemetry</a></code></li>
<li><code><a title="praisonai.agents_generator.noop" href="#praisonai.agents_generator.noop">noop</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.agents_generator.AgentsGenerator" href="#praisonai.agents_generator.AgentsGenerator">AgentsGenerator</a></code></h4>
<ul class="">
<li><code><a title="praisonai.agents_generator.AgentsGenerator.generate_crew_and_kickoff" href="#praisonai.agents_generator.AgentsGenerator.generate_crew_and_kickoff">generate_crew_and_kickoff</a></code></li>
<li><code><a title="praisonai.agents_generator.AgentsGenerator.is_function_or_decorated" href="#praisonai.agents_generator.AgentsGenerator.is_function_or_decorated">is_function_or_decorated</a></code></li>
<li><code><a title="praisonai.agents_generator.AgentsGenerator.load_tools_from_module" href="#praisonai.agents_generator.AgentsGenerator.load_tools_from_module">load_tools_from_module</a></code></li>
<li><code><a title="praisonai.agents_generator.AgentsGenerator.load_tools_from_module_class" href="#praisonai.agents_generator.AgentsGenerator.load_tools_from_module_class">load_tools_from_module_class</a></code></li>
<li><code><a title="praisonai.agents_generator.AgentsGenerator.load_tools_from_package" href="#praisonai.agents_generator.AgentsGenerator.load_tools_from_package">load_tools_from_package</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-622
View File
@@ -1,622 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.auto API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.auto</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.auto.AutoGenerator"><code class="flex name class">
<span>class <span class="ident">AutoGenerator</span></span>
<span>(</span><span>topic='Movie Story writing about AI', agent_file='test.yaml', framework='crewai', config_list: Optional[List[Dict]] = None)</span>
</code></dt>
<dd>
<div class="desc"><p>Initialize the AutoGenerator class with the specified topic, agent file, and framework.
Note: autogen framework is different from this AutoGenerator class.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>topic</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The topic for the generated team structure. Defaults to "Movie Story writing about AI".</dd>
<dt><strong><code>agent_file</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The name of the YAML file to save the generated team structure. Defaults to "test.yaml".</dd>
<dt><strong><code>framework</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The framework for the generated team structure. Defaults to "crewai".</dd>
<dt><strong><code>config_list</code></strong> :&ensp;<code>Optional[List[Dict]]</code>, optional</dt>
<dd>A list containing the configuration details for the OpenAI API.
If None, it defaults to using environment variables or hardcoded values.</dd>
</dl>
<h2 id="attributes">Attributes</h2>
<dl>
<dt><strong><code>config_list</code></strong> :&ensp;<code>list</code></dt>
<dd>A list containing the configuration details for the OpenAI API.</dd>
<dt><strong><code>topic</code></strong> :&ensp;<code>str</code></dt>
<dd>The specified topic for the generated team structure.</dd>
<dt><strong><code>agent_file</code></strong> :&ensp;<code>str</code></dt>
<dd>The specified name of the YAML file to save the generated team structure.</dd>
<dt><strong><code>framework</code></strong> :&ensp;<code>str</code></dt>
<dd>The specified framework for the generated team structure.</dd>
<dt><strong><code>client</code></strong> :&ensp;<code>instructor.Client</code></dt>
<dd>An instance of the instructor.Client class initialized with the specified OpenAI API configuration.</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class AutoGenerator:
def __init__(self, topic=&#34;Movie Story writing about AI&#34;, agent_file=&#34;test.yaml&#34;, framework=&#34;crewai&#34;, config_list: Optional[List[Dict]] = None):
&#34;&#34;&#34;
Initialize the AutoGenerator class with the specified topic, agent file, and framework.
Note: autogen framework is different from this AutoGenerator class.
Args:
topic (str, optional): The topic for the generated team structure. Defaults to &#34;Movie Story writing about AI&#34;.
agent_file (str, optional): The name of the YAML file to save the generated team structure. Defaults to &#34;test.yaml&#34;.
framework (str, optional): The framework for the generated team structure. Defaults to &#34;crewai&#34;.
config_list (Optional[List[Dict]], optional): A list containing the configuration details for the OpenAI API.
If None, it defaults to using environment variables or hardcoded values.
Attributes:
config_list (list): A list containing the configuration details for the OpenAI API.
topic (str): The specified topic for the generated team structure.
agent_file (str): The specified name of the YAML file to save the generated team structure.
framework (str): The specified framework for the generated team structure.
client (instructor.Client): An instance of the instructor.Client class initialized with the specified OpenAI API configuration.
&#34;&#34;&#34;
self.config_list = config_list or [
{
&#39;model&#39;: os.environ.get(&#34;OPENAI_MODEL_NAME&#34;, &#34;gpt-4o&#34;),
&#39;base_url&#39;: os.environ.get(&#34;OPENAI_API_BASE&#34;, &#34;https://api.openai.com/v1&#34;),
&#39;api_key&#39;: os.environ.get(&#34;OPENAI_API_KEY&#34;)
}
]
self.topic = topic
self.agent_file = agent_file
self.framework = framework or &#34;crewai&#34;
self.client = instructor.patch(
OpenAI(
base_url=self.config_list[0][&#39;base_url&#39;],
api_key=os.getenv(&#34;OPENAI_API_KEY&#34;),
),
mode=instructor.Mode.JSON,
)
def generate(self):
&#34;&#34;&#34;
Generates a team structure for the specified topic.
Args:
None
Returns:
str: The full path of the YAML file containing the generated team structure.
Raises:
Exception: If the generation process fails.
Usage:
generator = AutoGenerator(framework=&#34;crewai&#34;, topic=&#34;Create a movie script about Cat in Mars&#34;)
path = generator.generate()
print(path)
&#34;&#34;&#34;
response = self.client.chat.completions.create(
model=self.config_list[0][&#39;model&#39;],
response_model=TeamStructure,
max_retries=10,
messages=[
{&#34;role&#34;: &#34;system&#34;, &#34;content&#34;: &#34;You are a helpful assistant designed to output complex team structures.&#34;},
{&#34;role&#34;: &#34;user&#34;, &#34;content&#34;: self.get_user_content()}
]
)
json_data = json.loads(response.model_dump_json())
self.convert_and_save(json_data)
full_path = os.path.abspath(self.agent_file)
return full_path
def convert_and_save(self, json_data):
&#34;&#34;&#34;Converts the provided JSON data into the desired YAML format and saves it to a file.
Args:
json_data (dict): The JSON data representing the team structure.
topic (str, optional): The topic to be inserted into the YAML. Defaults to &#34;Artificial Intelligence&#34;.
agent_file (str, optional): The name of the YAML file to save. Defaults to &#34;test.yaml&#34;.
&#34;&#34;&#34;
yaml_data = {
&#34;framework&#34;: self.framework,
&#34;topic&#34;: self.topic,
&#34;roles&#34;: {},
&#34;dependencies&#34;: []
}
for role_id, role_details in json_data[&#39;roles&#39;].items():
yaml_data[&#39;roles&#39;][role_id] = {
&#34;backstory&#34;: &#34;&#34; + role_details[&#39;backstory&#39;],
&#34;goal&#34;: role_details[&#39;goal&#39;],
&#34;role&#34;: role_details[&#39;role&#39;],
&#34;tasks&#34;: {},
# &#34;tools&#34;: role_details.get(&#39;tools&#39;, []),
&#34;tools&#34;: [&#39;&#39;]
}
for task_id, task_details in role_details[&#39;tasks&#39;].items():
yaml_data[&#39;roles&#39;][role_id][&#39;tasks&#39;][task_id] = {
&#34;description&#34;: &#34;&#34; + task_details[&#39;description&#39;],
&#34;expected_output&#34;: &#34;&#34; + task_details[&#39;expected_output&#39;]
}
# Save to YAML file, maintaining the order
with open(self.agent_file, &#39;w&#39;) as f:
yaml.dump(yaml_data, f, allow_unicode=True, sort_keys=False)
def get_user_content(self):
&#34;&#34;&#34;
Generates a prompt for the OpenAI API to generate a team structure.
Args:
None
Returns:
str: The prompt for the OpenAI API.
Usage:
generator = AutoGenerator(framework=&#34;crewai&#34;, topic=&#34;Create a movie script about Cat in Mars&#34;)
prompt = generator.get_user_content()
print(prompt)
&#34;&#34;&#34;
user_content = &#34;&#34;&#34;Generate a team structure for \&#34;&#34;&#34;&#34; + self.topic + &#34;&#34;&#34;\&#34; task.
No Input data will be provided to the team.
The team will work in sequence. First role will pass the output to the next role, and so on.
The last role will generate the final output.
Think step by step.
With maximum 3 roles, each with 1 task. Include role goals, backstories, task descriptions, and expected outputs.
List of Available Tools: CodeDocsSearchTool, CSVSearchTool, DirectorySearchTool, DOCXSearchTool, DirectoryReadTool, FileReadTool, TXTSearchTool, JSONSearchTool, MDXSearchTool, PDFSearchTool, RagTool, ScrapeElementFromWebsiteTool, ScrapeWebsiteTool, WebsiteSearchTool, XMLSearchTool, YoutubeChannelSearchTool, YoutubeVideoSearchTool.
Only use Available Tools. Do Not use any other tools.
Example Below:
Use below example to understand the structure of the output.
The final role you create should satisfy the provided task: &#34;&#34;&#34; + self.topic + &#34;&#34;&#34;.
{
&#34;roles&#34;: {
&#34;narrative_designer&#34;: {
&#34;role&#34;: &#34;Narrative Designer&#34;,
&#34;goal&#34;: &#34;Create AI storylines&#34;,
&#34;backstory&#34;: &#34;Skilled in narrative development for AI, with a focus on story resonance.&#34;,
&#34;tools&#34;: [&#34;ScrapeWebsiteTool&#34;],
&#34;tasks&#34;: {
&#34;story_concept_development&#34;: {
&#34;description&#34;: &#34;Craft a unique AI story concept with depth and engagement using concept from this page the content https://www.asthebirdfliesblog.com/posts/how-to-write-book-story-development .&#34;,
&#34;expected_output&#34;: &#34;Document with narrative arcs, character bios, and settings.&#34;
}
}
},
&#34;scriptwriter&#34;: {
&#34;role&#34;: &#34;Scriptwriter&#34;,
&#34;goal&#34;: &#34;Write scripts from AI concepts&#34;,
&#34;backstory&#34;: &#34;Expert in dialogue and script structure, translating concepts into scripts.&#34;,
&#34;tasks&#34;: {
&#34;scriptwriting_task&#34;: {
&#34;description&#34;: &#34;Turn narrative concepts into scripts, including dialogue and scenes.&#34;,
&#34;expected_output&#34;: &#34;Production-ready script with dialogue and scene details.&#34;
}
}
}
}
}
&#34;&#34;&#34;
return user_content</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="praisonai.auto.AutoGenerator.convert_and_save"><code class="name flex">
<span>def <span class="ident">convert_and_save</span></span>(<span>self, json_data)</span>
</code></dt>
<dd>
<div class="desc"><p>Converts the provided JSON data into the desired YAML format and saves it to a file.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>json_data</code></strong> :&ensp;<code>dict</code></dt>
<dd>The JSON data representing the team structure.</dd>
<dt><strong><code>topic</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The topic to be inserted into the YAML. Defaults to "Artificial Intelligence".</dd>
<dt><strong><code>agent_file</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The name of the YAML file to save. Defaults to "test.yaml".</dd>
</dl></div>
</dd>
<dt id="praisonai.auto.AutoGenerator.generate"><code class="name flex">
<span>def <span class="ident">generate</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Generates a team structure for the specified topic.</p>
<h2 id="args">Args</h2>
<p>None</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>str</code></dt>
<dd>The full path of the YAML file containing the generated team structure.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>Exception</code></dt>
<dd>If the generation process fails.</dd>
</dl>
<h2 id="usage">Usage</h2>
<p>generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
path = generator.generate()
print(path)</p></div>
</dd>
<dt id="praisonai.auto.AutoGenerator.get_user_content"><code class="name flex">
<span>def <span class="ident">get_user_content</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Generates a prompt for the OpenAI API to generate a team structure.</p>
<h2 id="args">Args</h2>
<p>None</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>str</code></dt>
<dd>The prompt for the OpenAI API.</dd>
</dl>
<h2 id="usage">Usage</h2>
<p>generator = AutoGenerator(framework="crewai", topic="Create a movie script about Cat in Mars")
prompt = generator.get_user_content()
print(prompt)</p></div>
</dd>
</dl>
</dd>
<dt id="praisonai.auto.RoleDetails"><code class="flex name class">
<span>class <span class="ident">RoleDetails</span></span>
<span>(</span><span>**data: Any)</span>
</code></dt>
<dd>
<div class="desc"><p>Usage docs: <a href="https://docs.pydantic.dev/2.9/concepts/models/">https://docs.pydantic.dev/2.9/concepts/models/</a></p>
<p>A base class for creating Pydantic models.</p>
<h2 id="attributes">Attributes</h2>
<dl>
<dt><strong><code>__class_vars__</code></strong></dt>
<dd>The names of the class variables defined on the model.</dd>
<dt><strong><code>__private_attributes__</code></strong></dt>
<dd>Metadata about the private attributes of the model.</dd>
<dt><strong><code>__signature__</code></strong></dt>
<dd>The synthesized <code>__init__</code> [<code>Signature</code>][inspect.Signature] of the model.</dd>
<dt><strong><code>__pydantic_complete__</code></strong></dt>
<dd>Whether model building is completed, or if there are still undefined fields.</dd>
<dt><strong><code>__pydantic_core_schema__</code></strong></dt>
<dd>The core schema of the model.</dd>
<dt><strong><code>__pydantic_custom_init__</code></strong></dt>
<dd>Whether the model has a custom <code>__init__</code> function.</dd>
<dt><strong><code>__pydantic_decorators__</code></strong></dt>
<dd>Metadata containing the decorators defined on the model.
This replaces <code>Model.__validators__</code> and <code>Model.__root_validators__</code> from Pydantic V1.</dd>
<dt><strong><code>__pydantic_generic_metadata__</code></strong></dt>
<dd>Metadata for generic models; contains data used for a similar purpose to
<strong>args</strong>, <strong>origin</strong>, <strong>parameters</strong> in typing-module generics. May eventually be replaced by these.</dd>
<dt><strong><code>__pydantic_parent_namespace__</code></strong></dt>
<dd>Parent namespace of the model, used for automatic rebuilding of models.</dd>
<dt><strong><code>__pydantic_post_init__</code></strong></dt>
<dd>The name of the post-init method for the model, if defined.</dd>
<dt><strong><code>__pydantic_root_model__</code></strong></dt>
<dd>Whether the model is a [<code>RootModel</code>][pydantic.root_model.RootModel].</dd>
<dt><strong><code>__pydantic_serializer__</code></strong></dt>
<dd>The <code>pydantic-core</code> <code>SchemaSerializer</code> used to dump instances of the model.</dd>
<dt><strong><code>__pydantic_validator__</code></strong></dt>
<dd>The <code>pydantic-core</code> <code>SchemaValidator</code> used to validate instances of the model.</dd>
<dt><strong><code>__pydantic_extra__</code></strong></dt>
<dd>A dictionary containing extra values, if [<code>extra</code>][pydantic.config.ConfigDict.extra]
is set to <code>'allow'</code>.</dd>
<dt><strong><code>__pydantic_fields_set__</code></strong></dt>
<dd>The names of fields explicitly set during instantiation.</dd>
<dt><strong><code>__pydantic_private__</code></strong></dt>
<dd>Values of private attributes set on the model instance.</dd>
</dl>
<p>Create a new model by parsing and validating input data from keyword arguments.</p>
<p>Raises [<code>ValidationError</code>][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.</p>
<p><code>self</code> is explicitly positional-only to allow <code>self</code> as a field name.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class RoleDetails(BaseModel):
role: str
goal: str
backstory: str
tasks: Dict[str, TaskDetails]
tools: List[str]</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li>pydantic.main.BaseModel</li>
</ul>
<h3>Class variables</h3>
<dl>
<dt id="praisonai.auto.RoleDetails.backstory"><code class="name">var <span class="ident">backstory</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.goal"><code class="name">var <span class="ident">goal</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.model_computed_fields"><code class="name">var <span class="ident">model_computed_fields</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.model_config"><code class="name">var <span class="ident">model_config</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.model_fields"><code class="name">var <span class="ident">model_fields</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.role"><code class="name">var <span class="ident">role</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.tasks"><code class="name">var <span class="ident">tasks</span> : Dict[str, <a title="praisonai.auto.TaskDetails" href="#praisonai.auto.TaskDetails">TaskDetails</a>]</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.RoleDetails.tools"><code class="name">var <span class="ident">tools</span> : List[str]</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</dd>
<dt id="praisonai.auto.TaskDetails"><code class="flex name class">
<span>class <span class="ident">TaskDetails</span></span>
<span>(</span><span>**data: Any)</span>
</code></dt>
<dd>
<div class="desc"><p>Usage docs: <a href="https://docs.pydantic.dev/2.9/concepts/models/">https://docs.pydantic.dev/2.9/concepts/models/</a></p>
<p>A base class for creating Pydantic models.</p>
<h2 id="attributes">Attributes</h2>
<dl>
<dt><strong><code>__class_vars__</code></strong></dt>
<dd>The names of the class variables defined on the model.</dd>
<dt><strong><code>__private_attributes__</code></strong></dt>
<dd>Metadata about the private attributes of the model.</dd>
<dt><strong><code>__signature__</code></strong></dt>
<dd>The synthesized <code>__init__</code> [<code>Signature</code>][inspect.Signature] of the model.</dd>
<dt><strong><code>__pydantic_complete__</code></strong></dt>
<dd>Whether model building is completed, or if there are still undefined fields.</dd>
<dt><strong><code>__pydantic_core_schema__</code></strong></dt>
<dd>The core schema of the model.</dd>
<dt><strong><code>__pydantic_custom_init__</code></strong></dt>
<dd>Whether the model has a custom <code>__init__</code> function.</dd>
<dt><strong><code>__pydantic_decorators__</code></strong></dt>
<dd>Metadata containing the decorators defined on the model.
This replaces <code>Model.__validators__</code> and <code>Model.__root_validators__</code> from Pydantic V1.</dd>
<dt><strong><code>__pydantic_generic_metadata__</code></strong></dt>
<dd>Metadata for generic models; contains data used for a similar purpose to
<strong>args</strong>, <strong>origin</strong>, <strong>parameters</strong> in typing-module generics. May eventually be replaced by these.</dd>
<dt><strong><code>__pydantic_parent_namespace__</code></strong></dt>
<dd>Parent namespace of the model, used for automatic rebuilding of models.</dd>
<dt><strong><code>__pydantic_post_init__</code></strong></dt>
<dd>The name of the post-init method for the model, if defined.</dd>
<dt><strong><code>__pydantic_root_model__</code></strong></dt>
<dd>Whether the model is a [<code>RootModel</code>][pydantic.root_model.RootModel].</dd>
<dt><strong><code>__pydantic_serializer__</code></strong></dt>
<dd>The <code>pydantic-core</code> <code>SchemaSerializer</code> used to dump instances of the model.</dd>
<dt><strong><code>__pydantic_validator__</code></strong></dt>
<dd>The <code>pydantic-core</code> <code>SchemaValidator</code> used to validate instances of the model.</dd>
<dt><strong><code>__pydantic_extra__</code></strong></dt>
<dd>A dictionary containing extra values, if [<code>extra</code>][pydantic.config.ConfigDict.extra]
is set to <code>'allow'</code>.</dd>
<dt><strong><code>__pydantic_fields_set__</code></strong></dt>
<dd>The names of fields explicitly set during instantiation.</dd>
<dt><strong><code>__pydantic_private__</code></strong></dt>
<dd>Values of private attributes set on the model instance.</dd>
</dl>
<p>Create a new model by parsing and validating input data from keyword arguments.</p>
<p>Raises [<code>ValidationError</code>][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.</p>
<p><code>self</code> is explicitly positional-only to allow <code>self</code> as a field name.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class TaskDetails(BaseModel):
description: str
expected_output: str</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li>pydantic.main.BaseModel</li>
</ul>
<h3>Class variables</h3>
<dl>
<dt id="praisonai.auto.TaskDetails.description"><code class="name">var <span class="ident">description</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TaskDetails.expected_output"><code class="name">var <span class="ident">expected_output</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TaskDetails.model_computed_fields"><code class="name">var <span class="ident">model_computed_fields</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TaskDetails.model_config"><code class="name">var <span class="ident">model_config</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TaskDetails.model_fields"><code class="name">var <span class="ident">model_fields</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</dd>
<dt id="praisonai.auto.TeamStructure"><code class="flex name class">
<span>class <span class="ident">TeamStructure</span></span>
<span>(</span><span>**data: Any)</span>
</code></dt>
<dd>
<div class="desc"><p>Usage docs: <a href="https://docs.pydantic.dev/2.9/concepts/models/">https://docs.pydantic.dev/2.9/concepts/models/</a></p>
<p>A base class for creating Pydantic models.</p>
<h2 id="attributes">Attributes</h2>
<dl>
<dt><strong><code>__class_vars__</code></strong></dt>
<dd>The names of the class variables defined on the model.</dd>
<dt><strong><code>__private_attributes__</code></strong></dt>
<dd>Metadata about the private attributes of the model.</dd>
<dt><strong><code>__signature__</code></strong></dt>
<dd>The synthesized <code>__init__</code> [<code>Signature</code>][inspect.Signature] of the model.</dd>
<dt><strong><code>__pydantic_complete__</code></strong></dt>
<dd>Whether model building is completed, or if there are still undefined fields.</dd>
<dt><strong><code>__pydantic_core_schema__</code></strong></dt>
<dd>The core schema of the model.</dd>
<dt><strong><code>__pydantic_custom_init__</code></strong></dt>
<dd>Whether the model has a custom <code>__init__</code> function.</dd>
<dt><strong><code>__pydantic_decorators__</code></strong></dt>
<dd>Metadata containing the decorators defined on the model.
This replaces <code>Model.__validators__</code> and <code>Model.__root_validators__</code> from Pydantic V1.</dd>
<dt><strong><code>__pydantic_generic_metadata__</code></strong></dt>
<dd>Metadata for generic models; contains data used for a similar purpose to
<strong>args</strong>, <strong>origin</strong>, <strong>parameters</strong> in typing-module generics. May eventually be replaced by these.</dd>
<dt><strong><code>__pydantic_parent_namespace__</code></strong></dt>
<dd>Parent namespace of the model, used for automatic rebuilding of models.</dd>
<dt><strong><code>__pydantic_post_init__</code></strong></dt>
<dd>The name of the post-init method for the model, if defined.</dd>
<dt><strong><code>__pydantic_root_model__</code></strong></dt>
<dd>Whether the model is a [<code>RootModel</code>][pydantic.root_model.RootModel].</dd>
<dt><strong><code>__pydantic_serializer__</code></strong></dt>
<dd>The <code>pydantic-core</code> <code>SchemaSerializer</code> used to dump instances of the model.</dd>
<dt><strong><code>__pydantic_validator__</code></strong></dt>
<dd>The <code>pydantic-core</code> <code>SchemaValidator</code> used to validate instances of the model.</dd>
<dt><strong><code>__pydantic_extra__</code></strong></dt>
<dd>A dictionary containing extra values, if [<code>extra</code>][pydantic.config.ConfigDict.extra]
is set to <code>'allow'</code>.</dd>
<dt><strong><code>__pydantic_fields_set__</code></strong></dt>
<dd>The names of fields explicitly set during instantiation.</dd>
<dt><strong><code>__pydantic_private__</code></strong></dt>
<dd>Values of private attributes set on the model instance.</dd>
</dl>
<p>Create a new model by parsing and validating input data from keyword arguments.</p>
<p>Raises [<code>ValidationError</code>][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.</p>
<p><code>self</code> is explicitly positional-only to allow <code>self</code> as a field name.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class TeamStructure(BaseModel):
roles: Dict[str, RoleDetails]</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li>pydantic.main.BaseModel</li>
</ul>
<h3>Class variables</h3>
<dl>
<dt id="praisonai.auto.TeamStructure.model_computed_fields"><code class="name">var <span class="ident">model_computed_fields</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TeamStructure.model_config"><code class="name">var <span class="ident">model_config</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TeamStructure.model_fields"><code class="name">var <span class="ident">model_fields</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.auto.TeamStructure.roles"><code class="name">var <span class="ident">roles</span> : Dict[str, <a title="praisonai.auto.RoleDetails" href="#praisonai.auto.RoleDetails">RoleDetails</a>]</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.auto.AutoGenerator" href="#praisonai.auto.AutoGenerator">AutoGenerator</a></code></h4>
<ul class="">
<li><code><a title="praisonai.auto.AutoGenerator.convert_and_save" href="#praisonai.auto.AutoGenerator.convert_and_save">convert_and_save</a></code></li>
<li><code><a title="praisonai.auto.AutoGenerator.generate" href="#praisonai.auto.AutoGenerator.generate">generate</a></code></li>
<li><code><a title="praisonai.auto.AutoGenerator.get_user_content" href="#praisonai.auto.AutoGenerator.get_user_content">get_user_content</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="praisonai.auto.RoleDetails" href="#praisonai.auto.RoleDetails">RoleDetails</a></code></h4>
<ul class="">
<li><code><a title="praisonai.auto.RoleDetails.backstory" href="#praisonai.auto.RoleDetails.backstory">backstory</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.goal" href="#praisonai.auto.RoleDetails.goal">goal</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.model_computed_fields" href="#praisonai.auto.RoleDetails.model_computed_fields">model_computed_fields</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.model_config" href="#praisonai.auto.RoleDetails.model_config">model_config</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.model_fields" href="#praisonai.auto.RoleDetails.model_fields">model_fields</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.role" href="#praisonai.auto.RoleDetails.role">role</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.tasks" href="#praisonai.auto.RoleDetails.tasks">tasks</a></code></li>
<li><code><a title="praisonai.auto.RoleDetails.tools" href="#praisonai.auto.RoleDetails.tools">tools</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="praisonai.auto.TaskDetails" href="#praisonai.auto.TaskDetails">TaskDetails</a></code></h4>
<ul class="">
<li><code><a title="praisonai.auto.TaskDetails.description" href="#praisonai.auto.TaskDetails.description">description</a></code></li>
<li><code><a title="praisonai.auto.TaskDetails.expected_output" href="#praisonai.auto.TaskDetails.expected_output">expected_output</a></code></li>
<li><code><a title="praisonai.auto.TaskDetails.model_computed_fields" href="#praisonai.auto.TaskDetails.model_computed_fields">model_computed_fields</a></code></li>
<li><code><a title="praisonai.auto.TaskDetails.model_config" href="#praisonai.auto.TaskDetails.model_config">model_config</a></code></li>
<li><code><a title="praisonai.auto.TaskDetails.model_fields" href="#praisonai.auto.TaskDetails.model_fields">model_fields</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="praisonai.auto.TeamStructure" href="#praisonai.auto.TeamStructure">TeamStructure</a></code></h4>
<ul class="">
<li><code><a title="praisonai.auto.TeamStructure.model_computed_fields" href="#praisonai.auto.TeamStructure.model_computed_fields">model_computed_fields</a></code></li>
<li><code><a title="praisonai.auto.TeamStructure.model_config" href="#praisonai.auto.TeamStructure.model_config">model_config</a></code></li>
<li><code><a title="praisonai.auto.TeamStructure.model_fields" href="#praisonai.auto.TeamStructure.model_fields">model_fields</a></code></li>
<li><code><a title="praisonai.auto.TeamStructure.roles" href="#praisonai.auto.TeamStructure.roles">roles</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-664
View File
@@ -1,664 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.cli API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.cli</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.cli.stream_subprocess"><code class="name flex">
<span>def <span class="ident">stream_subprocess</span></span>(<span>command, env=None)</span>
</code></dt>
<dd>
<div class="desc"><p>Execute a subprocess command and stream the output to the terminal in real-time.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>command</code></strong> :&ensp;<code>list</code></dt>
<dd>A list containing the command and its arguments.</dd>
<dt><strong><code>env</code></strong> :&ensp;<code>dict</code>, optional</dt>
<dd>Environment variables for the subprocess.</dd>
</dl></div>
</dd>
</dl>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.cli.PraisonAI"><code class="flex name class">
<span>class <span class="ident">PraisonAI</span></span>
<span>(</span><span>agent_file='agents.yaml', framework='', auto=False, init=False, agent_yaml=None, tools=None)</span>
</code></dt>
<dd>
<div class="desc"><p>Initialize the PraisonAI object with default parameters.</p>
<h2 id="parameters">Parameters</h2>
<p>agent_file (str): The default agent file to use. Defaults to "agents.yaml".
framework (str): The default framework to use. Defaults to "crewai".
auto (bool): A flag indicating whether to enable auto mode. Defaults to False.
init (bool): A flag indicating whether to enable initialization mode. Defaults to False.</p>
<h2 id="attributes">Attributes</h2>
<dl>
<dt><strong><code>config_list</code></strong> :&ensp;<code>list</code></dt>
<dd>A list of configuration dictionaries for the OpenAI API.</dd>
<dt><strong><code>agent_file</code></strong> :&ensp;<code>str</code></dt>
<dd>The agent file to use.</dd>
<dt><strong><code>framework</code></strong> :&ensp;<code>str</code></dt>
<dd>The framework to use.</dd>
<dt><strong><code>auto</code></strong> :&ensp;<code>bool</code></dt>
<dd>A flag indicating whether to enable auto mode.</dd>
<dt><strong><code>init</code></strong> :&ensp;<code>bool</code></dt>
<dd>A flag indicating whether to enable initialization mode.</dd>
<dt><strong><code>agent_yaml</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The content of the YAML file. Defaults to None.</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class PraisonAI:
def __init__(self, agent_file=&#34;agents.yaml&#34;, framework=&#34;&#34;, auto=False, init=False, agent_yaml=None, tools=None):
&#34;&#34;&#34;
Initialize the PraisonAI object with default parameters.
Parameters:
agent_file (str): The default agent file to use. Defaults to &#34;agents.yaml&#34;.
framework (str): The default framework to use. Defaults to &#34;crewai&#34;.
auto (bool): A flag indicating whether to enable auto mode. Defaults to False.
init (bool): A flag indicating whether to enable initialization mode. Defaults to False.
Attributes:
config_list (list): A list of configuration dictionaries for the OpenAI API.
agent_file (str): The agent file to use.
framework (str): The framework to use.
auto (bool): A flag indicating whether to enable auto mode.
init (bool): A flag indicating whether to enable initialization mode.
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
&#34;&#34;&#34;
self.agent_yaml = agent_yaml
self.config_list = [
{
&#39;model&#39;: os.environ.get(&#34;OPENAI_MODEL_NAME&#34;, &#34;gpt-4o&#34;),
&#39;base_url&#39;: os.environ.get(&#34;OPENAI_API_BASE&#34;, &#34;https://api.openai.com/v1&#34;),
&#39;api_key&#39;: os.environ.get(&#34;OPENAI_API_KEY&#34;)
}
]
self.agent_file = agent_file
self.framework = framework
self.auto = auto
self.init = init
self.tools = tools or [] # Store tool class names as a list
def run(self):
&#34;&#34;&#34;
Run the PraisonAI application.
&#34;&#34;&#34;
self.main()
def main(self):
&#34;&#34;&#34;
The main function of the PraisonAI object. It parses the command-line arguments,
initializes the necessary attributes, and then calls the appropriate methods based on the
provided arguments.
Args:
self (PraisonAI): An instance of the PraisonAI class.
Returns:
Any: Depending on the arguments provided, the function may return a result from the
AgentsGenerator, a deployment result from the CloudDeployer, or a message indicating
the successful creation of a file.
&#34;&#34;&#34;
args = self.parse_args()
if args is None:
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
result = agents_generator.generate_crew_and_kickoff()
return result
if args.deploy:
from .deploy import CloudDeployer
deployer = CloudDeployer()
deployer.run_commands()
return
if getattr(args, &#39;chat&#39;, False):
self.create_chainlit_chat_interface()
return
if getattr(args, &#39;code&#39;, False):
self.create_code_interface()
return
if getattr(args, &#39;realtime&#39;, False):
self.create_realtime_interface()
return
if getattr(args, &#39;call&#39;, False):
call_args = []
if args.public:
call_args.append(&#39;--public&#39;)
call_module.main(call_args)
return
if args.agent_file == &#39;train&#39;:
package_root = os.path.dirname(os.path.abspath(__file__))
config_yaml_destination = os.path.join(os.getcwd(), &#39;config.yaml&#39;)
# Create config.yaml only if it doesn&#39;t exist or --model or --dataset is provided
if not os.path.exists(config_yaml_destination) or args.model or args.dataset:
config = generate_config(
model_name=args.model,
hf_model_name=args.hf,
ollama_model_name=args.ollama,
dataset=[{
&#34;name&#34;: args.dataset
}]
)
with open(&#39;config.yaml&#39;, &#39;w&#39;) as f:
yaml.dump(config, f, default_flow_style=False, indent=2)
# Overwrite huggingface_save and ollama_save if --hf or --ollama are provided
if args.hf:
config[&#34;huggingface_save&#34;] = &#34;true&#34;
if args.ollama:
config[&#34;ollama_save&#34;] = &#34;true&#34;
if &#39;init&#39; in sys.argv:
from praisonai.setup.setup_conda_env import main as setup_conda_main
setup_conda_main()
print(&#34;All packages installed&#34;)
return
try:
result = subprocess.check_output([&#39;conda&#39;, &#39;env&#39;, &#39;list&#39;])
if &#39;praison_env&#39; in result.decode(&#39;utf-8&#39;):
print(&#34;Conda environment &#39;praison_env&#39; found.&#34;)
else:
raise subprocess.CalledProcessError(1, &#39;grep&#39;)
except subprocess.CalledProcessError:
print(&#34;Conda environment &#39;praison_env&#39; not found. Setting it up...&#34;)
from praisonai.setup.setup_conda_env import main as setup_conda_main
setup_conda_main()
print(&#34;All packages installed.&#34;)
train_args = sys.argv[2:] # Get all arguments after &#39;train&#39;
train_script_path = os.path.join(package_root, &#39;train.py&#39;)
# Set environment variables
env = os.environ.copy()
env[&#39;PYTHONUNBUFFERED&#39;] = &#39;1&#39;
stream_subprocess([&#39;conda&#39;, &#39;run&#39;, &#39;--no-capture-output&#39;, &#39;--name&#39;, &#39;praison_env&#39;, &#39;python&#39;, &#39;-u&#39;, train_script_path, &#39;train&#39;], env=env)
return
invocation_cmd = &#34;praisonai&#34;
version_string = f&#34;PraisonAI version {__version__}&#34;
self.framework = args.framework or self.framework
if args.agent_file:
if args.agent_file.startswith(&#34;tests.test&#34;): # Argument used for testing purposes. eg: python -m unittest tests.test
print(&#34;test&#34;)
else:
self.agent_file = args.agent_file
if args.auto or args.init:
temp_topic = &#39; &#39;.join(args.auto) if args.auto else &#39; &#39;.join(args.init)
self.topic = temp_topic
elif self.auto or self.init: # Use the auto attribute if args.auto is not provided
self.topic = self.auto
if args.auto or self.auto:
self.agent_file = &#34;test.yaml&#34;
generator = AutoGenerator(topic=self.topic , framework=self.framework, agent_file=self.agent_file)
self.agent_file = generator.generate()
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
result = agents_generator.generate_crew_and_kickoff()
return result
elif args.init or self.init:
self.agent_file = &#34;agents.yaml&#34;
generator = AutoGenerator(topic=self.topic , framework=self.framework, agent_file=self.agent_file)
self.agent_file = generator.generate()
print(&#34;File {} created successfully&#34;.format(self.agent_file))
return &#34;File {} created successfully&#34;.format(self.agent_file)
if args.ui:
if args.ui == &#34;gradio&#34;:
self.create_gradio_interface()
elif args.ui == &#34;chainlit&#34;:
self.create_chainlit_interface()
else:
# Modify below code to allow default ui
agents_generator = AgentsGenerator(
self.agent_file,
self.framework,
self.config_list,
agent_yaml=self.agent_yaml,
tools=self.tools # Pass tools to AgentsGenerator
)
result = agents_generator.generate_crew_and_kickoff()
return result
else:
agents_generator = AgentsGenerator(
self.agent_file,
self.framework,
self.config_list,
agent_yaml=self.agent_yaml,
tools=self.tools # Pass tools to AgentsGenerator
)
result = agents_generator.generate_crew_and_kickoff()
return result
def parse_args(self):
&#34;&#34;&#34;
Parse the command-line arguments for the PraisonAI CLI.
Args:
self (PraisonAI): An instance of the PraisonAI class.
Returns:
argparse.Namespace: An object containing the parsed command-line arguments.
Raises:
argparse.ArgumentError: If the arguments provided are invalid.
Example:
&gt;&gt;&gt; args = praison_ai.parse_args()
&gt;&gt;&gt; print(args.agent_file) # Output: &#39;agents.yaml&#39;
&#34;&#34;&#34;
parser = argparse.ArgumentParser(prog=&#34;praisonai&#34;, description=&#34;praisonAI command-line interface&#34;)
parser.add_argument(&#34;--framework&#34;, choices=[&#34;crewai&#34;, &#34;autogen&#34;], help=&#34;Specify the framework&#34;)
parser.add_argument(&#34;--ui&#34;, choices=[&#34;chainlit&#34;, &#34;gradio&#34;], help=&#34;Specify the UI framework (gradio or chainlit).&#34;)
parser.add_argument(&#34;--auto&#34;, nargs=argparse.REMAINDER, help=&#34;Enable auto mode and pass arguments for it&#34;)
parser.add_argument(&#34;--init&#34;, nargs=argparse.REMAINDER, help=&#34;Enable auto mode and pass arguments for it&#34;)
parser.add_argument(&#34;agent_file&#34;, nargs=&#34;?&#34;, help=&#34;Specify the agent file&#34;)
parser.add_argument(&#34;--deploy&#34;, action=&#34;store_true&#34;, help=&#34;Deploy the application&#34;)
parser.add_argument(&#34;--model&#34;, type=str, help=&#34;Model name&#34;)
parser.add_argument(&#34;--hf&#34;, type=str, help=&#34;Hugging Face model name&#34;)
parser.add_argument(&#34;--ollama&#34;, type=str, help=&#34;Ollama model name&#34;)
parser.add_argument(&#34;--dataset&#34;, type=str, help=&#34;Dataset name for training&#34;, default=&#34;yahma/alpaca-cleaned&#34;)
parser.add_argument(&#34;--realtime&#34;, action=&#34;store_true&#34;, help=&#34;Start the realtime voice interaction interface&#34;)
parser.add_argument(&#34;--call&#34;, action=&#34;store_true&#34;, help=&#34;Start the PraisonAI Call server&#34;)
parser.add_argument(&#34;--public&#34;, action=&#34;store_true&#34;, help=&#34;Use ngrok to expose the server publicly (only with --call)&#34;)
args, unknown_args = parser.parse_known_args()
if unknown_args and unknown_args[0] == &#39;-b&#39; and unknown_args[1] == &#39;api:app&#39;:
args.agent_file = &#39;agents.yaml&#39;
if args.agent_file == &#39;api:app&#39; or args.agent_file == &#39;/app/api:app&#39;:
args.agent_file = &#39;agents.yaml&#39;
if args.agent_file == &#39;ui&#39;:
args.ui = &#39;chainlit&#39;
if args.agent_file == &#39;chat&#39;:
args.ui = &#39;chainlit&#39;
args.chat = True
if args.agent_file == &#39;code&#39;:
args.ui = &#39;chainlit&#39;
args.code = True
if args.agent_file == &#39;realtime&#39;:
args.realtime = True
if args.agent_file == &#39;call&#39;:
args.call = True
return args
def create_chainlit_chat_interface(self):
&#34;&#34;&#34;
Create a Chainlit interface for the chat application.
This function sets up a Chainlit application that listens for messages.
When a message is received, it runs PraisonAI with the provided message as the topic.
The generated agents are then used to perform tasks.
Returns:
None: This function does not return any value. It starts the Chainlit application.
&#34;&#34;&#34;
if CHAINLIT_AVAILABLE:
import praisonai
os.environ[&#34;CHAINLIT_PORT&#34;] = &#34;8084&#34;
root_path = os.path.join(os.path.expanduser(&#34;~&#34;), &#34;.praison&#34;)
os.environ[&#34;CHAINLIT_APP_ROOT&#34;] = root_path
public_folder = os.path.join(os.path.dirname(praisonai.__file__), &#39;public&#39;)
if not os.path.exists(os.path.join(root_path, &#34;public&#34;)): # Check if the folder exists in the current directory
if os.path.exists(public_folder):
shutil.copytree(public_folder, os.path.join(root_path, &#34;public&#34;), dirs_exist_ok=True)
logging.info(&#34;Public folder copied successfully!&#34;)
else:
logging.info(&#34;Public folder not found in the package.&#34;)
else:
logging.info(&#34;Public folder already exists.&#34;)
chat_ui_path = os.path.join(os.path.dirname(praisonai.__file__), &#39;ui&#39;, &#39;chat.py&#39;)
chainlit_run([chat_ui_path])
else:
print(&#34;ERROR: Chat UI is not installed. Please install it with &#39;pip install \&#34;praisonai\[chat]\&#34;&#39; to use the chat UI.&#34;)
def create_code_interface(self):
&#34;&#34;&#34;
Create a Chainlit interface for the code application.
This function sets up a Chainlit application that listens for messages.
When a message is received, it runs PraisonAI with the provided message as the topic.
The generated agents are then used to perform tasks.
Returns:
None: This function does not return any value. It starts the Chainlit application.
&#34;&#34;&#34;
if CHAINLIT_AVAILABLE:
import praisonai
os.environ[&#34;CHAINLIT_PORT&#34;] = &#34;8086&#34;
root_path = os.path.join(os.path.expanduser(&#34;~&#34;), &#34;.praison&#34;)
os.environ[&#34;CHAINLIT_APP_ROOT&#34;] = root_path
public_folder = os.path.join(os.path.dirname(__file__), &#39;public&#39;)
if not os.path.exists(os.path.join(root_path, &#34;public&#34;)): # Check if the folder exists in the current directory
if os.path.exists(public_folder):
shutil.copytree(public_folder, os.path.join(root_path, &#34;public&#34;), dirs_exist_ok=True)
logging.info(&#34;Public folder copied successfully!&#34;)
else:
logging.info(&#34;Public folder not found in the package.&#34;)
else:
logging.info(&#34;Public folder already exists.&#34;)
code_ui_path = os.path.join(os.path.dirname(praisonai.__file__), &#39;ui&#39;, &#39;code.py&#39;)
chainlit_run([code_ui_path])
else:
print(&#34;ERROR: Code UI is not installed. Please install it with &#39;pip install \&#34;praisonai\[code]\&#34;&#39; to use the code UI.&#34;)
def create_gradio_interface(self):
&#34;&#34;&#34;
Create a Gradio interface for generating agents and performing tasks.
Args:
self (PraisonAI): An instance of the PraisonAI class.
Returns:
None: This method does not return any value. It launches the Gradio interface.
Raises:
None: This method does not raise any exceptions.
Example:
&gt;&gt;&gt; praison_ai.create_gradio_interface()
&#34;&#34;&#34;
if GRADIO_AVAILABLE:
def generate_crew_and_kickoff_interface(auto_args, framework):
&#34;&#34;&#34;
Generate a crew and kick off tasks based on the provided auto arguments and framework.
Args:
auto_args (list): Topic.
framework (str): The framework to use for generating agents.
Returns:
str: A string representing the result of generating the crew and kicking off tasks.
Raises:
None: This method does not raise any exceptions.
Example:
&gt;&gt;&gt; result = generate_crew_and_kickoff_interface(&#34;Create a movie about Cat in Mars&#34;, &#34;crewai&#34;)
&gt;&gt;&gt; print(result)
&#34;&#34;&#34;
self.framework = framework
self.agent_file = &#34;test.yaml&#34;
generator = AutoGenerator(topic=auto_args , framework=self.framework)
self.agent_file = generator.generate()
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
result = agents_generator.generate_crew_and_kickoff()
return result
gr.Interface(
fn=generate_crew_and_kickoff_interface,
inputs=[gr.Textbox(lines=2, label=&#34;Auto Args&#34;), gr.Dropdown(choices=[&#34;crewai&#34;, &#34;autogen&#34;], label=&#34;Framework&#34;)],
outputs=&#34;textbox&#34;,
title=&#34;Praison AI Studio&#34;,
description=&#34;Create Agents and perform tasks&#34;,
theme=&#34;default&#34;
).launch()
else:
print(&#34;ERROR: Gradio is not installed. Please install it with &#39;pip install gradio&#39; to use this feature.&#34;)
def create_chainlit_interface(self):
&#34;&#34;&#34;
Create a Chainlit interface for generating agents and performing tasks.
This function sets up a Chainlit application that listens for messages.
When a message is received, it runs PraisonAI with the provided message as the topic.
The generated agents are then used to perform tasks.
Returns:
None: This function does not return any value. It starts the Chainlit application.
&#34;&#34;&#34;
if CHAINLIT_AVAILABLE:
import praisonai
os.environ[&#34;CHAINLIT_PORT&#34;] = &#34;8082&#34;
# Get the path to the &#39;public&#39; folder within the package
public_folder = os.path.join(os.path.dirname(praisonai.__file__), &#39;public&#39;)
if not os.path.exists(&#34;public&#34;): # Check if the folder exists in the current directory
if os.path.exists(public_folder):
shutil.copytree(public_folder, &#39;public&#39;, dirs_exist_ok=True)
logging.info(&#34;Public folder copied successfully!&#34;)
else:
logging.info(&#34;Public folder not found in the package.&#34;)
else:
logging.info(&#34;Public folder already exists.&#34;)
chainlit_ui_path = os.path.join(os.path.dirname(praisonai.__file__), &#39;chainlit_ui.py&#39;)
chainlit_run([chainlit_ui_path])
else:
print(&#34;ERROR: Chainlit is not installed. Please install it with &#39;pip install \&#34;praisonai\[ui]\&#34;&#39; to use the UI.&#34;)
def create_realtime_interface(self):
&#34;&#34;&#34;
Create a Chainlit interface for the realtime voice interaction application.
&#34;&#34;&#34;
if CHAINLIT_AVAILABLE:
import praisonai
os.environ[&#34;CHAINLIT_PORT&#34;] = &#34;8088&#34; # Ensure this port is not in use by another service
root_path = os.path.join(os.path.expanduser(&#34;~&#34;), &#34;.praison&#34;)
os.environ[&#34;CHAINLIT_APP_ROOT&#34;] = root_path
public_folder = os.path.join(os.path.dirname(praisonai.__file__), &#39;public&#39;)
if not os.path.exists(os.path.join(root_path, &#34;public&#34;)):
if os.path.exists(public_folder):
shutil.copytree(public_folder, os.path.join(root_path, &#34;public&#34;), dirs_exist_ok=True)
logging.info(&#34;Public folder copied successfully!&#34;)
else:
logging.info(&#34;Public folder not found in the package.&#34;)
else:
logging.info(&#34;Public folder already exists.&#34;)
realtime_ui_path = os.path.join(os.path.dirname(praisonai.__file__), &#39;ui&#39;, &#39;realtime.py&#39;)
chainlit_run([realtime_ui_path])
else:
print(&#34;ERROR: Realtime UI is not installed. Please install it with &#39;pip install \&#34;praisonai[realtime]\&#34;&#39; to use the realtime UI.&#34;)</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="praisonai.cli.PraisonAI.create_chainlit_chat_interface"><code class="name flex">
<span>def <span class="ident">create_chainlit_chat_interface</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a Chainlit interface for the chat application.</p>
<p>This function sets up a Chainlit application that listens for messages.
When a message is received, it runs PraisonAI with the provided message as the topic.
The generated agents are then used to perform tasks.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>None</code></dt>
<dd>This function does not return any value. It starts the Chainlit application.</dd>
</dl></div>
</dd>
<dt id="praisonai.cli.PraisonAI.create_chainlit_interface"><code class="name flex">
<span>def <span class="ident">create_chainlit_interface</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a Chainlit interface for generating agents and performing tasks.</p>
<p>This function sets up a Chainlit application that listens for messages.
When a message is received, it runs PraisonAI with the provided message as the topic.
The generated agents are then used to perform tasks.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>None</code></dt>
<dd>This function does not return any value. It starts the Chainlit application.</dd>
</dl></div>
</dd>
<dt id="praisonai.cli.PraisonAI.create_code_interface"><code class="name flex">
<span>def <span class="ident">create_code_interface</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a Chainlit interface for the code application.</p>
<p>This function sets up a Chainlit application that listens for messages.
When a message is received, it runs PraisonAI with the provided message as the topic.
The generated agents are then used to perform tasks.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>None</code></dt>
<dd>This function does not return any value. It starts the Chainlit application.</dd>
</dl></div>
</dd>
<dt id="praisonai.cli.PraisonAI.create_gradio_interface"><code class="name flex">
<span>def <span class="ident">create_gradio_interface</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a Gradio interface for generating agents and performing tasks.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>self</code></strong> :&ensp;<code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></dt>
<dd>An instance of the PraisonAI class.</dd>
</dl>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>None</code></dt>
<dd>This method does not return any value. It launches the Gradio interface.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>None</code></dt>
<dd>This method does not raise any exceptions.</dd>
</dl>
<h2 id="example">Example</h2>
<pre><code class="language-python-repl">&gt;&gt;&gt; praison_ai.create_gradio_interface()
</code></pre></div>
</dd>
<dt id="praisonai.cli.PraisonAI.create_realtime_interface"><code class="name flex">
<span>def <span class="ident">create_realtime_interface</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a Chainlit interface for the realtime voice interaction application.</p></div>
</dd>
<dt id="praisonai.cli.PraisonAI.main"><code class="name flex">
<span>def <span class="ident">main</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>The main function of the PraisonAI object. It parses the command-line arguments,
initializes the necessary attributes, and then calls the appropriate methods based on the
provided arguments.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>self</code></strong> :&ensp;<code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></dt>
<dd>An instance of the PraisonAI class.</dd>
</dl>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>Any</code></dt>
<dd>Depending on the arguments provided, the function may return a result from the</dd>
</dl>
<p>AgentsGenerator, a deployment result from the CloudDeployer, or a message indicating
the successful creation of a file.</p></div>
</dd>
<dt id="praisonai.cli.PraisonAI.parse_args"><code class="name flex">
<span>def <span class="ident">parse_args</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Parse the command-line arguments for the PraisonAI CLI.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>self</code></strong> :&ensp;<code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></dt>
<dd>An instance of the PraisonAI class.</dd>
</dl>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>argparse.Namespace</code></dt>
<dd>An object containing the parsed command-line arguments.</dd>
</dl>
<h2 id="raises">Raises</h2>
<dl>
<dt><code>argparse.ArgumentError</code></dt>
<dd>If the arguments provided are invalid.</dd>
</dl>
<h2 id="example">Example</h2>
<pre><code class="language-python-repl">&gt;&gt;&gt; args = praison_ai.parse_args()
&gt;&gt;&gt; print(args.agent_file) # Output: 'agents.yaml'
</code></pre></div>
</dd>
<dt id="praisonai.cli.PraisonAI.run"><code class="name flex">
<span>def <span class="ident">run</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Run the PraisonAI application.</p></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.cli.stream_subprocess" href="#praisonai.cli.stream_subprocess">stream_subprocess</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.cli.PraisonAI" href="#praisonai.cli.PraisonAI">PraisonAI</a></code></h4>
<ul class="">
<li><code><a title="praisonai.cli.PraisonAI.create_chainlit_chat_interface" href="#praisonai.cli.PraisonAI.create_chainlit_chat_interface">create_chainlit_chat_interface</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.create_chainlit_interface" href="#praisonai.cli.PraisonAI.create_chainlit_interface">create_chainlit_interface</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.create_code_interface" href="#praisonai.cli.PraisonAI.create_code_interface">create_code_interface</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.create_gradio_interface" href="#praisonai.cli.PraisonAI.create_gradio_interface">create_gradio_interface</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.create_realtime_interface" href="#praisonai.cli.PraisonAI.create_realtime_interface">create_realtime_interface</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.main" href="#praisonai.cli.PraisonAI.main">main</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.parse_args" href="#praisonai.cli.PraisonAI.parse_args">parse_args</a></code></li>
<li><code><a title="praisonai.cli.PraisonAI.run" href="#praisonai.cli.PraisonAI.run">run</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-279
View File
@@ -1,279 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.deploy API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.deploy</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.deploy.CloudDeployer"><code class="flex name class">
<span>class <span class="ident">CloudDeployer</span></span>
</code></dt>
<dd>
<div class="desc"><p>A class for deploying a cloud-based application.</p>
<h2 id="attributes">Attributes</h2>
<p>None</p>
<h2 id="methods">Methods</h2>
<p><strong>init</strong>(self):
Loads environment variables from .env file or system and sets them.</p>
<p>Loads environment variables from .env file or system and sets them.</p>
<h2 id="parameters">Parameters</h2>
<p>self: An instance of the CloudDeployer class.</p>
<h2 id="returns">Returns</h2>
<p>None</p>
<h2 id="raises">Raises</h2>
<p>None</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class CloudDeployer:
&#34;&#34;&#34;
A class for deploying a cloud-based application.
Attributes:
None
Methods:
__init__(self):
Loads environment variables from .env file or system and sets them.
&#34;&#34;&#34;
def __init__(self):
&#34;&#34;&#34;
Loads environment variables from .env file or system and sets them.
Parameters:
self: An instance of the CloudDeployer class.
Returns:
None
Raises:
None
&#34;&#34;&#34;
# Load environment variables from .env file or system
load_dotenv()
self.set_environment_variables()
def create_dockerfile(self):
&#34;&#34;&#34;
Creates a Dockerfile for the application.
Parameters:
self: An instance of the CloudDeployer class.
Returns:
None
Raises:
None
This method creates a Dockerfile in the current directory with the specified content.
The Dockerfile is used to build a Docker image for the application.
The content of the Dockerfile includes instructions to use the Python 3.11-slim base image,
set the working directory to /app, copy the current directory contents into the container,
install the required Python packages (flask, praisonai, gunicorn, and markdown),
expose port 8080, and run the application using Gunicorn.
&#34;&#34;&#34;
with open(&#34;Dockerfile&#34;, &#34;w&#34;) as file:
file.write(&#34;FROM python:3.11-slim\n&#34;)
file.write(&#34;WORKDIR /app\n&#34;)
file.write(&#34;COPY . .\n&#34;)
file.write(&#34;RUN pip install flask praisonai==2.0.31 gunicorn markdown\n&#34;)
file.write(&#34;EXPOSE 8080\n&#34;)
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
def create_api_file(self):
&#34;&#34;&#34;
Creates an API file for the application.
Parameters:
self (CloudDeployer): An instance of the CloudDeployer class.
Returns:
None
This method creates an API file named &#34;api.py&#34; in the current directory. The file contains a basic Flask application that uses the PraisonAI library to run a simple agent and returns the output as an HTML page. The application listens on the root path (&#34;/&#34;) and uses the Markdown library to format the output.
&#34;&#34;&#34;
with open(&#34;api.py&#34;, &#34;w&#34;) as file:
file.write(&#34;from flask import Flask\n&#34;)
file.write(&#34;from praisonai import PraisonAI\n&#34;)
file.write(&#34;import markdown\n\n&#34;)
file.write(&#34;app = Flask(__name__)\n\n&#34;)
file.write(&#34;def basic():\n&#34;)
file.write(&#34; praisonai = PraisonAI(agent_file=\&#34;agents.yaml\&#34;)\n&#34;)
file.write(&#34; return praisonai.run()\n\n&#34;)
file.write(&#34;@app.route(&#39;/&#39;)\n&#34;)
file.write(&#34;def home():\n&#34;)
file.write(&#34; output = basic()\n&#34;)
file.write(&#34; html_output = markdown.markdown(output)\n&#34;)
file.write(&#34; return f&#39;&lt;html&gt;&lt;body&gt;{html_output}&lt;/body&gt;&lt;/html&gt;&#39;\n\n&#34;)
file.write(&#34;if __name__ == \&#34;__main__\&#34;:\n&#34;)
file.write(&#34; app.run(debug=True)\n&#34;)
def set_environment_variables(self):
&#34;&#34;&#34;Sets environment variables with fallback to .env values or defaults.&#34;&#34;&#34;
os.environ[&#34;OPENAI_MODEL_NAME&#34;] = os.getenv(&#34;OPENAI_MODEL_NAME&#34;, &#34;gpt-4o&#34;)
os.environ[&#34;OPENAI_API_KEY&#34;] = os.getenv(&#34;OPENAI_API_KEY&#34;, &#34;Enter your API key&#34;)
os.environ[&#34;OPENAI_API_BASE&#34;] = os.getenv(&#34;OPENAI_API_BASE&#34;, &#34;https://api.openai.com/v1&#34;)
def run_commands(self):
&#34;&#34;&#34;
Sets environment variables with fallback to .env values or defaults.
Parameters:
None
Returns:
None
Raises:
None
This method sets environment variables for the application. It uses the `os.environ` dictionary to set the following environment variables:
- `OPENAI_MODEL_NAME`: The name of the OpenAI model to use. If not specified in the .env file, it defaults to &#34;gpt-4o&#34;.
- `OPENAI_API_KEY`: The API key for accessing the OpenAI API. If not specified in the .env file, it defaults to &#34;Enter your API key&#34;.
- `OPENAI_API_BASE`: The base URL for the OpenAI API. If not specified in the .env file, it defaults to &#34;https://api.openai.com/v1&#34;.
&#34;&#34;&#34;
self.create_api_file()
self.create_dockerfile()
&#34;&#34;&#34;Runs a sequence of shell commands for deployment, continues on error.&#34;&#34;&#34;
commands = [
&#34;yes | gcloud auth configure-docker us-central1-docker.pkg.dev&#34;,
&#34;gcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1&#34;,
&#34;docker build --platform linux/amd64 -t gcr.io/$(gcloud config get-value project)/praisonai-app:latest .&#34;,
&#34;docker tag gcr.io/$(gcloud config get-value project)/praisonai-app:latest us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest&#34;,
&#34;docker push us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest&#34;,
&#34;gcloud run deploy praisonai-service --image us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest --platform managed --region us-central1 --allow-unauthenticated --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}&#34;
]
for cmd in commands:
try:
subprocess.run(cmd, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f&#34;ERROR: Command &#39;{e.cmd}&#39; failed with exit status {e.returncode}&#34;)
print(f&#34;Continuing with the next command...&#34;)</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="praisonai.deploy.CloudDeployer.create_api_file"><code class="name flex">
<span>def <span class="ident">create_api_file</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Creates an API file for the application.</p>
<h2 id="parameters">Parameters</h2>
<p>self (CloudDeployer): An instance of the CloudDeployer class.</p>
<h2 id="returns">Returns</h2>
<p>None
This method creates an API file named "api.py" in the current directory. The file contains a basic Flask application that uses the PraisonAI library to run a simple agent and returns the output as an HTML page. The application listens on the root path ("/") and uses the Markdown library to format the output.</p></div>
</dd>
<dt id="praisonai.deploy.CloudDeployer.create_dockerfile"><code class="name flex">
<span>def <span class="ident">create_dockerfile</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Creates a Dockerfile for the application.</p>
<h2 id="parameters">Parameters</h2>
<p>self: An instance of the CloudDeployer class.</p>
<h2 id="returns">Returns</h2>
<p>None</p>
<h2 id="raises">Raises</h2>
<p>None
This method creates a Dockerfile in the current directory with the specified content.
The Dockerfile is used to build a Docker image for the application.
The content of the Dockerfile includes instructions to use the Python 3.11-slim base image,
set the working directory to /app, copy the current directory contents into the container,
install the required Python packages (flask, praisonai, gunicorn, and markdown),
expose port 8080, and run the application using Gunicorn.</p></div>
</dd>
<dt id="praisonai.deploy.CloudDeployer.run_commands"><code class="name flex">
<span>def <span class="ident">run_commands</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Sets environment variables with fallback to .env values or defaults.</p>
<h2 id="parameters">Parameters</h2>
<p>None</p>
<h2 id="returns">Returns</h2>
<p>None</p>
<h2 id="raises">Raises</h2>
<p>None
This method sets environment variables for the application. It uses the <code>os.environ</code> dictionary to set the following environment variables:</p>
<ul>
<li><code>OPENAI_MODEL_NAME</code>: The name of the OpenAI model to use. If not specified in the .env file, it defaults to "gpt-4o".</li>
<li><code>OPENAI_API_KEY</code>: The API key for accessing the OpenAI API. If not specified in the .env file, it defaults to "Enter your API key".</li>
<li><code>OPENAI_API_BASE</code>: The base URL for the OpenAI API. If not specified in the .env file, it defaults to "https://api.openai.com/v1".</li>
</ul></div>
</dd>
<dt id="praisonai.deploy.CloudDeployer.set_environment_variables"><code class="name flex">
<span>def <span class="ident">set_environment_variables</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Sets environment variables with fallback to .env values or defaults.</p></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.deploy.CloudDeployer" href="#praisonai.deploy.CloudDeployer">CloudDeployer</a></code></h4>
<ul class="">
<li><code><a title="praisonai.deploy.CloudDeployer.create_api_file" href="#praisonai.deploy.CloudDeployer.create_api_file">create_api_file</a></code></li>
<li><code><a title="praisonai.deploy.CloudDeployer.create_dockerfile" href="#praisonai.deploy.CloudDeployer.create_dockerfile">create_dockerfile</a></code></li>
<li><code><a title="praisonai.deploy.CloudDeployer.run_commands" href="#praisonai.deploy.CloudDeployer.run_commands">run_commands</a></code></li>
<li><code><a title="praisonai.deploy.CloudDeployer.set_environment_variables" href="#praisonai.deploy.CloudDeployer.set_environment_variables">set_environment_variables</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
@@ -1,188 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.inbuilt_tools.autogen_tools API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.inbuilt_tools.autogen_tools</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_CSVSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_CSVSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_CodeDocsSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_CodeDocsSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_DOCXSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_DOCXSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_DirectoryReadTool"><code class="name flex">
<span>def <span class="ident">autogen_DirectoryReadTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_DirectorySearchTool"><code class="name flex">
<span>def <span class="ident">autogen_DirectorySearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_FileReadTool"><code class="name flex">
<span>def <span class="ident">autogen_FileReadTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_JSONSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_JSONSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_MDXSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_MDXSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_PDFSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_PDFSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_RagTool"><code class="name flex">
<span>def <span class="ident">autogen_RagTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeElementFromWebsiteTool"><code class="name flex">
<span>def <span class="ident">autogen_ScrapeElementFromWebsiteTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeWebsiteTool"><code class="name flex">
<span>def <span class="ident">autogen_ScrapeWebsiteTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_TXTSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_TXTSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_WebsiteSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_WebsiteSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_XMLSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_XMLSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeChannelSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_YoutubeChannelSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeVideoSearchTool"><code class="name flex">
<span>def <span class="ident">autogen_YoutubeVideoSearchTool</span></span>(<span>assistant, user_proxy)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.inbuilt_tools.autogen_tools.create_autogen_tool_function"><code class="name flex">
<span>def <span class="ident">create_autogen_tool_function</span></span>(<span>tool_name)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.inbuilt_tools" href="index.html">praisonai.inbuilt_tools</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_CSVSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_CSVSearchTool">autogen_CSVSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_CodeDocsSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_CodeDocsSearchTool">autogen_CodeDocsSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_DOCXSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_DOCXSearchTool">autogen_DOCXSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_DirectoryReadTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_DirectoryReadTool">autogen_DirectoryReadTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_DirectorySearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_DirectorySearchTool">autogen_DirectorySearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_FileReadTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_FileReadTool">autogen_FileReadTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_JSONSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_JSONSearchTool">autogen_JSONSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_MDXSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_MDXSearchTool">autogen_MDXSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_PDFSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_PDFSearchTool">autogen_PDFSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_RagTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_RagTool">autogen_RagTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeElementFromWebsiteTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeElementFromWebsiteTool">autogen_ScrapeElementFromWebsiteTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeWebsiteTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_ScrapeWebsiteTool">autogen_ScrapeWebsiteTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_TXTSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_TXTSearchTool">autogen_TXTSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_WebsiteSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_WebsiteSearchTool">autogen_WebsiteSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_XMLSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_XMLSearchTool">autogen_XMLSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeChannelSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeChannelSearchTool">autogen_YoutubeChannelSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeVideoSearchTool" href="#praisonai.inbuilt_tools.autogen_tools.autogen_YoutubeVideoSearchTool">autogen_YoutubeVideoSearchTool</a></code></li>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools.create_autogen_tool_function" href="#praisonai.inbuilt_tools.autogen_tools.create_autogen_tool_function">create_autogen_tool_function</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
@@ -1,67 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.inbuilt_tools API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.inbuilt_tools</code></h1>
</header>
<section id="section-intro">
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
<dl>
<dt><code class="name"><a title="praisonai.inbuilt_tools.autogen_tools" href="autogen_tools.html">praisonai.inbuilt_tools.autogen_tools</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
<ul>
<li><code><a title="praisonai.inbuilt_tools.autogen_tools" href="autogen_tools.html">praisonai.inbuilt_tools.autogen_tools</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-69
View File
@@ -1,69 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.inc.config API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.inc.config</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.inc.config.generate_config"><code class="name flex">
<span>def <span class="ident">generate_config</span></span>(<span>ollama_save=None, huggingface_save=None, train=None, model_name=None, hf_model_name=None, ollama_model_name=None, model_parameters=None, max_seq_length=None, load_in_4bit=None, lora_r=None, lora_target_modules=None, lora_alpha=None, lora_dropout=None, lora_bias=None, use_gradient_checkpointing=None, random_state=None, use_rslora=None, loftq_config=None, dataset=None, dataset_text_field=None, dataset_num_proc=None, packing=None, per_device_train_batch_size=None, gradient_accumulation_steps=None, warmup_steps=None, num_train_epochs=None, max_steps=None, learning_rate=None, logging_steps=None, optim=None, weight_decay=None, lr_scheduler_type=None, seed=None, output_dir=None, quantization_method=None)</span>
</code></dt>
<dd>
<div class="desc"><p>Generates the configuration for PraisonAI with dynamic overrides.</p></div>
</dd>
</dl>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.inc" href="index.html">praisonai.inc</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.inc.config.generate_config" href="#praisonai.inc.config.generate_config">generate_config</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-72
View File
@@ -1,72 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.inc API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.inc</code></h1>
</header>
<section id="section-intro">
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
<dl>
<dt><code class="name"><a title="praisonai.inc.config" href="config.html">praisonai.inc.config</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.inc.models" href="models.html">praisonai.inc.models</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
<ul>
<li><code><a title="praisonai.inc.config" href="config.html">praisonai.inc.config</a></code></li>
<li><code><a title="praisonai.inc.models" href="models.html">praisonai.inc.models</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-200
View File
@@ -1,200 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.inc.models API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.inc.models</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.inc.models.PraisonAIModel"><code class="flex name class">
<span>class <span class="ident">PraisonAIModel</span></span>
<span>(</span><span>model=None, api_key_var=None, base_url=None)</span>
</code></dt>
<dd>
<div class="desc"><p>Initializes the PraisonAIModel with the provided parameters or environment variables.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>model</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The name of the OpenAI model. Defaults to None.</dd>
<dt><strong><code>api_key_var</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The OpenAI API key. Defaults to None.</dd>
<dt><strong><code>base_url</code></strong> :&ensp;<code>str</code>, optional</dt>
<dd>The base URL for the OpenAI API. Defaults to None.</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class PraisonAIModel:
def __init__(self, model=None, api_key_var=None, base_url=None):
&#34;&#34;&#34;
Initializes the PraisonAIModel with the provided parameters or environment variables.
Args:
model (str, optional): The name of the OpenAI model. Defaults to None.
api_key_var (str, optional): The OpenAI API key. Defaults to None.
base_url (str, optional): The base URL for the OpenAI API. Defaults to None.
&#34;&#34;&#34;
self.model = model or os.getenv(&#34;OPENAI_MODEL_NAME&#34;, &#34;gpt-4o&#34;)
if self.model.startswith(&#34;openai/&#34;):
self.api_key_var = &#34;OPENAI_API_KEY&#34;
self.base_url = base_url or &#34;https://api.openai.com/v1&#34;
self.model_name = self.model.replace(&#34;openai/&#34;, &#34;&#34;)
elif self.model.startswith(&#34;groq/&#34;):
self.api_key_var = &#34;GROQ_API_KEY&#34;
self.base_url = base_url or &#34;https://api.groq.com/openai/v1&#34;
self.model_name = self.model.replace(&#34;groq/&#34;, &#34;&#34;)
elif self.model.startswith(&#34;cohere/&#34;):
self.api_key_var = &#34;COHERE_API_KEY&#34;
self.base_url = &#34;&#34;
self.model_name = self.model.replace(&#34;cohere/&#34;, &#34;&#34;)
elif self.model.startswith(&#34;ollama/&#34;):
self.api_key_var = &#34;OLLAMA_API_KEY&#34;
self.base_url = base_url or &#34;http://localhost:11434/v1&#34;
self.model_name = self.model.replace(&#34;ollama/&#34;, &#34;&#34;)
elif self.model.startswith(&#34;anthropic/&#34;):
self.api_key_var = &#34;ANTHROPIC_API_KEY&#34;
self.base_url = &#34;&#34;
self.model_name = self.model.replace(&#34;anthropic/&#34;, &#34;&#34;)
elif self.model.startswith(&#34;google/&#34;):
self.api_key_var = &#34;GOOGLE_API_KEY&#34;
self.base_url = &#34;&#34;
self.model_name = self.model.replace(&#34;google/&#34;, &#34;&#34;)
elif self.model.startswith(&#34;openrouter/&#34;):
self.api_key_var = &#34;OPENROUTER_API_KEY&#34;
self.base_url = base_url or &#34;https://openrouter.ai/api/v1&#34;
self.model_name = self.model.replace(&#34;openrouter/&#34;, &#34;&#34;)
else:
self.api_key_var = api_key_var or &#34;OPENAI_API_KEY&#34;
self.base_url = base_url or os.environ.get(&#34;OPENAI_API_BASE&#34;, &#34;https://api.openai.com/v1&#34;)
self.model_name = self.model
logger.debug(f&#34;Initialized PraisonAIModel with model {self.model_name}, api_key_var {self.api_key_var}, and base_url {self.base_url}&#34;)
self.api_key = os.environ.get(self.api_key_var, &#34;nokey&#34;)
def get_model(self):
&#34;&#34;&#34;
Returns an instance of the langchain Chat client with the configured parameters.
Returns:
Chat: An instance of the langchain Chat client.
&#34;&#34;&#34;
if self.model.startswith(&#34;google/&#34;):
if GOOGLE_GENAI_AVAILABLE:
return ChatGoogleGenerativeAI(
model=self.model_name,
google_api_key=self.api_key
)
else:
raise ImportError(
&#34;Required Langchain Integration &#39;langchain-google-genai&#39; not found. &#34;
&#34;Please install with &#39;pip install langchain-google-genai&#39;&#34;
)
elif self.model.startswith(&#34;cohere/&#34;):
if COHERE_AVAILABLE:
return ChatCohere(
model=self.model_name,
cohere_api_key=self.api_key,
)
else:
raise ImportError(
&#34;Required Langchain Integration &#39;langchain-cohere&#39; not found. &#34;
&#34;Please install with &#39;pip install langchain-cohere&#39;&#34;
)
elif self.model.startswith(&#34;anthropic/&#34;):
if ANTHROPIC_AVAILABLE:
return ChatAnthropic(
model=self.model_name,
anthropic_api_key=self.api_key,
)
else:
raise ImportError(
&#34;Required Langchain Integration &#39;langchain-anthropic&#39; not found. &#34;
&#34;Please install with &#39;pip install langchain-anthropic&#39;&#34;
)
elif OPENAI_AVAILABLE:
return ChatOpenAI(
model=self.model_name,
api_key=self.api_key,
base_url=self.base_url,
)
else:
raise ImportError(
&#34;Required Langchain Integration &#39;langchain-openai&#39; not found. &#34;
&#34;Please install with &#39;pip install langchain-openai&#39;&#34;
)</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="praisonai.inc.models.PraisonAIModel.get_model"><code class="name flex">
<span>def <span class="ident">get_model</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Returns an instance of the langchain Chat client with the configured parameters.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><code>Chat</code></dt>
<dd>An instance of the langchain Chat client.</dd>
</dl></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.inc" href="index.html">praisonai.inc</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.inc.models.PraisonAIModel" href="#praisonai.inc.models.PraisonAIModel">PraisonAIModel</a></code></h4>
<ul class="">
<li><code><a title="praisonai.inc.models.PraisonAIModel.get_model" href="#praisonai.inc.models.PraisonAIModel.get_model">get_model</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-107
View File
@@ -1,107 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Package <code>praisonai</code></h1>
</header>
<section id="section-intro">
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
<dl>
<dt><code class="name"><a title="praisonai.agents_generator" href="agents_generator.html">praisonai.agents_generator</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.auto" href="auto.html">praisonai.auto</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.cli" href="cli.html">praisonai.cli</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.deploy" href="deploy.html">praisonai.deploy</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.inbuilt_tools" href="inbuilt_tools/index.html">praisonai.inbuilt_tools</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.inc" href="inc/index.html">praisonai.inc</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.setup" href="setup/index.html">praisonai.setup</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.test" href="test.html">praisonai.test</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.ui" href="ui/index.html">praisonai.ui</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.version" href="version.html">praisonai.version</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
<ul>
<li><code><a title="praisonai.agents_generator" href="agents_generator.html">praisonai.agents_generator</a></code></li>
<li><code><a title="praisonai.auto" href="auto.html">praisonai.auto</a></code></li>
<li><code><a title="praisonai.cli" href="cli.html">praisonai.cli</a></code></li>
<li><code><a title="praisonai.deploy" href="deploy.html">praisonai.deploy</a></code></li>
<li><code><a title="praisonai.inbuilt_tools" href="inbuilt_tools/index.html">praisonai.inbuilt_tools</a></code></li>
<li><code><a title="praisonai.inc" href="inc/index.html">praisonai.inc</a></code></li>
<li><code><a title="praisonai.setup" href="setup/index.html">praisonai.setup</a></code></li>
<li><code><a title="praisonai.test" href="test.html">praisonai.test</a></code></li>
<li><code><a title="praisonai.ui" href="ui/index.html">praisonai.ui</a></code></li>
<li><code><a title="praisonai.version" href="version.html">praisonai.version</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-69
View File
@@ -1,69 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.setup.build API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.setup.build</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.setup.build.build"><code class="name flex">
<span>def <span class="ident">build</span></span>(<span>setup_kwargs)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.setup" href="index.html">praisonai.setup</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.setup.build.build" href="#praisonai.setup.build.build">build</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-77
View File
@@ -1,77 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.setup API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.setup</code></h1>
</header>
<section id="section-intro">
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
<dl>
<dt><code class="name"><a title="praisonai.setup.build" href="build.html">praisonai.setup.build</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.setup.post_install" href="post_install.html">praisonai.setup.post_install</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.setup.setup_conda_env" href="setup_conda_env.html">praisonai.setup.setup_conda_env</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
<ul>
<li><code><a title="praisonai.setup.build" href="build.html">praisonai.setup.build</a></code></li>
<li><code><a title="praisonai.setup.post_install" href="post_install.html">praisonai.setup.post_install</a></code></li>
<li><code><a title="praisonai.setup.setup_conda_env" href="setup_conda_env.html">praisonai.setup.setup_conda_env</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
@@ -1,69 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.setup.post_install API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.setup.post_install</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.setup.post_install.main"><code class="name flex">
<span>def <span class="ident">main</span></span>(<span>)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.setup" href="index.html">praisonai.setup</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.setup.post_install.main" href="#praisonai.setup.post_install.main">main</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
@@ -1,69 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.setup.setup_conda_env API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.setup.setup_conda_env</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.setup.setup_conda_env.main"><code class="name flex">
<span>def <span class="ident">main</span></span>(<span>)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.setup" href="index.html">praisonai.setup</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.setup.setup_conda_env.main" href="#praisonai.setup.setup_conda_env.main">main</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-73
View File
@@ -1,73 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.test API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.test</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.test.generate_crew_and_kickoff"><code class="name flex">
<span>def <span class="ident">generate_crew_and_kickoff</span></span>(<span>agent_file)</span>
</code></dt>
<dd>
<div class="desc"><p>This function generates a crew of agents and kicks off tasks based on the configuration provided in a YAML file.</p>
<p>Parameters:
agent_file (str): The path to the YAML file containing the configuration for the agents and tasks.</p>
<p>Returns:
str: The result of the last task executed by the crew.</p></div>
</dd>
</dl>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.test.generate_crew_and_kickoff" href="#praisonai.test.generate_crew_and_kickoff">generate_crew_and_kickoff</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-428
View File
@@ -1,428 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.ui.context API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.ui.context</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="praisonai.ui.context.main"><code class="name flex">
<span>def <span class="ident">main</span></span>(<span>)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.ui.context.ContextGatherer"><code class="flex name class">
<span>class <span class="ident">ContextGatherer</span></span>
<span>(</span><span>directory='.', output_file='context.txt', relevant_extensions=None, max_file_size=1000000, max_tokens=900000)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class ContextGatherer:
def __init__(self, directory=&#39;.&#39;, output_file=&#39;context.txt&#39;,
relevant_extensions=None, max_file_size=1_000_000, max_tokens=900000):
self.directory = directory
self.output_file = output_file
self.relevant_extensions = relevant_extensions or [
&#39;.py&#39;, &#39;.js&#39;, &#39;.ts&#39;, &#39;.java&#39;, &#39;.rb&#39;, &#39;.php&#39;, &#39;.pl&#39;, &#39;.pm&#39;, &#39;.c&#39;, &#39;.h&#39;,
&#39;.cpp&#39;, &#39;.hpp&#39;, &#39;.cs&#39;, &#39;.vb&#39;, &#39;.swift&#39;, &#39;.kt&#39;, &#39;.m&#39;, &#39;.mm&#39;, &#39;.go&#39;, &#39;.rs&#39;,
&#39;.hs&#39;, &#39;.r&#39;, &#39;.lua&#39;, &#39;.sh&#39;, &#39;.bat&#39;, &#39;.clj&#39;, &#39;.scala&#39;, &#39;.erl&#39;, &#39;.ex&#39;,
&#39;.ml&#39;, &#39;.fs&#39;, &#39;.groovy&#39;, &#39;.jsm&#39;, &#39;.jsx&#39;, &#39;.tsx&#39;, &#39;.yaml&#39;
]
self.max_file_size = max_file_size
self.max_tokens = int(os.getenv(&#34;PRAISONAI_MAX_TOKENS&#34;, max_tokens))
self.ignore_patterns = self.get_ignore_patterns()
self.include_paths = self.get_include_paths()
self.included_files = []
def get_ignore_patterns(self):
&#34;&#34;&#34;
Loads ignore patterns from various sources, prioritizing them in
the following order:
1. .praisonignore
2. settings.yaml (under code.ignore_files)
3. PRAISONAI_IGNORE_FILES environment variable
4. .gitignore
5. Default patterns
&#34;&#34;&#34;
ignore_patterns = []
def load_from_file(filepath):
if os.path.exists(filepath):
with open(filepath, &#39;r&#39;) as f:
ignore_patterns.extend(
line.strip() for line in f
if line.strip() and not line.startswith(&#39;#&#39;)
)
# 1. Load from .praisonignore
load_from_file(os.path.join(self.directory, &#39;.praisonignore&#39;))
# 2. Load from settings.yaml
settings_path = os.path.join(self.directory, &#39;settings.yaml&#39;)
if os.path.exists(settings_path):
with open(settings_path, &#39;r&#39;) as f:
settings = yaml.safe_load(f)
if &#39;code&#39; in settings and &#39;ignore_files&#39; in settings[&#39;code&#39;]:
ignore_patterns.extend(settings[&#39;code&#39;][&#39;ignore_files&#39;])
# 3. Load from environment variable
ignore_files_env = os.getenv(&#34;PRAISONAI_IGNORE_FILES&#34;)
if ignore_files_env:
ignore_patterns.extend(ignore_files_env.split(&#34;,&#34;))
# 4. Load from .gitignore
load_from_file(os.path.join(self.directory, &#39;.gitignore&#39;))
# 5. Default patterns (only if no patterns loaded from above sources)
if not ignore_patterns:
ignore_patterns = [
&#34;.*&#34;, &#34;*.pyc&#34;, &#34;__pycache__&#34;, &#34;.git&#34;, &#34;.gitignore&#34;, &#34;.vscode&#34;,
&#34;.idea&#34;, &#34;.DS_Store&#34;, &#34;*.lock&#34;, &#34;*.pyc&#34;, &#34;.env&#34;, &#34;docs&#34;, &#34;tests&#34;,
&#34;test&#34;, &#34;tmp&#34;, &#34;temp&#34;, &#34;*.txt&#34;, &#34;*.md&#34;, &#34;*.json&#34;, &#34;*.csv&#34;, &#34;*.tsv&#34;,
&#34;public&#34;, &#34;*.sql&#34;, &#34;*.sqlite&#34;, &#34;*.db&#34;, &#34;*.db3&#34;, &#34;*.sqlite3&#34;,
&#34;*.log&#34;, &#34;*.zip&#34;, &#34;*.gz&#34;, &#34;*.tar&#34;, &#34;*.rar&#34;, &#34;*.7z&#34;, &#34;*.pdf&#34;,
&#34;*.jpg&#34;, &#34;*.jpeg&#34;, &#34;*.png&#34;, &#34;*.gif&#34;, &#34;*.svg&#34;, &#34;cookbooks&#34;,
&#34;assets&#34;, &#34;__pycache__&#34;, &#34;dist&#34;, &#34;build&#34;, &#34;node_modules&#34;, &#34;venv&#34;
]
logger.debug(f&#34;Using default ignore patterns: {ignore_patterns}&#34;)
# Modify patterns to match directories and add leading &#39;*&#39; if necessary
modified_ignore_patterns = [
&#39;*&#39; + pattern if not pattern.startswith(&#39;.&#39;) and not pattern.startswith(&#39;*&#39;) else pattern
for pattern in ignore_patterns
]
logger.debug(f&#34;Final ignore patterns: {modified_ignore_patterns}&#34;)
return modified_ignore_patterns
def get_include_paths(self):
&#34;&#34;&#34;
Loads include paths from:
1. .praisoninclude (includes ONLY files/directories listed)
2. .praisoncontext (if .praisoninclude doesn&#39;t exist, this is used
to include all other relevant files, excluding ignore patterns)
&#34;&#34;&#34;
include_paths = []
include_all = False # Flag to indicate if we need to include all files
include_file = os.path.join(self.directory, &#39;.praisoncontext&#39;)
if os.path.exists(include_file):
with open(include_file, &#39;r&#39;) as f:
include_paths.extend(
line.strip() for line in f
if line.strip() and not line.startswith(&#39;#&#39;)
)
# If .praisoncontext doesn&#39;t exist, fall back to .praisoninclude
# for including all relevant files
if not include_paths:
include_file = os.path.join(self.directory, &#39;.praisoninclude&#39;)
if os.path.exists(include_file):
with open(include_file, &#39;r&#39;) as f:
include_paths.extend(
line.strip() for line in f
if line.strip() and not line.startswith(&#39;#&#39;)
)
include_all = True # Include all files along with specified paths
return include_paths, include_all
def should_ignore(self, file_path):
&#34;&#34;&#34;
Check if a file or directory should be ignored based on patterns.
Handles both file names and directory names for more comprehensive filtering.
&#34;&#34;&#34;
relative_path = os.path.relpath(file_path, self.directory)
if relative_path.startswith(&#39;.&#39;):
return True
for pattern in self.ignore_patterns:
if fnmatch.fnmatch(relative_path, pattern) or \
fnmatch.fnmatch(os.path.basename(file_path), pattern):
return True
return False
def is_relevant_file(self, file_path):
&#34;&#34;&#34;Determine if a file is relevant for the context.&#34;&#34;&#34;
return os.path.isfile(file_path) and \
os.path.getsize(file_path) &lt;= self.max_file_size and \
any(file_path.endswith(ext) for ext in self.relevant_extensions)
def gather_context(self):
&#34;&#34;&#34;
Gather context from relevant files, respecting ignore patterns
and include options from .praisoninclude and .praisoncontext.
&#34;&#34;&#34;
context = []
total_files = 0
processed_files = 0
self.include_paths, include_all = self.get_include_paths()
def add_file_content(file_path):
&#34;&#34;&#34;Helper function to add file content to context.&#34;&#34;&#34;
try:
with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as f:
content = f.read()
context.append(
f&#34;File: {file_path}\n\n{content}\n\n{&#39;=&#39; * 50}\n&#34;
)
self.included_files.append(
Path(file_path).relative_to(self.directory)
)
except Exception as e:
logger.error(f&#34;Error reading {file_path}: {e}&#34;)
def process_path(path):
&#34;&#34;&#34;Helper function to process a single path (file or directory).&#34;&#34;&#34;
nonlocal total_files, processed_files
if os.path.isdir(path):
for root, dirs, files in os.walk(path):
total_files += len(files)
dirs[:] = [
d
for d in dirs
if not self.should_ignore(os.path.join(root, d))
]
for file in files:
file_path = os.path.join(root, file)
if not self.should_ignore(file_path) and self.is_relevant_file(file_path):
add_file_content(file_path)
processed_files += 1
print(
f&#34;\rProcessed {processed_files}/{total_files} files&#34;,
end=&#34;&#34;,
flush=True,
)
elif os.path.isfile(path) and self.is_relevant_file(path):
add_file_content(path)
processed_files += 1
print(
f&#34;\rProcessed {processed_files}/1 files&#34;,
end=&#34;&#34;,
flush=True,
)
if include_all:
# Include ALL relevant files from the entire directory
process_path(self.directory)
# Include files from .praisoninclude specifically
for include_path in self.include_paths:
full_path = os.path.join(self.directory, include_path)
process_path(full_path)
elif self.include_paths:
# Include only files specified in .praisoncontext
for include_path in self.include_paths:
full_path = os.path.join(self.directory, include_path)
process_path(full_path)
else:
# No include options, process the entire directory
process_path(self.directory)
print() # New line after progress indicator
return &#34;\n&#34;.join(context)
def count_tokens(self, text):
&#34;&#34;&#34;Count tokens using a simple whitespace-based tokenizer.&#34;&#34;&#34;
return len(text.split())
def truncate_context(self, context):
&#34;&#34;&#34;Truncate context to stay within the token limit.&#34;&#34;&#34;
tokens = context.split()
if len(tokens) &gt; self.max_tokens:
truncated_context = &#39; &#39;.join(tokens[:self.max_tokens])
logger.warning(&#34;Context truncated due to token limit.&#34;)
return truncated_context
return context
def save_context(self, context):
&#34;&#34;&#34;Save the gathered context to a file.&#34;&#34;&#34;
with open(self.output_file, &#39;w&#39;, encoding=&#39;utf-8&#39;) as f:
f.write(context)
def get_context_tree(self):
&#34;&#34;&#34;Generate a formatted tree structure of included files and folders.&#34;&#34;&#34;
tree = []
start_dir = Path(self.directory)
def add_to_tree(path, prefix=&#39;&#39;):
contents = sorted(path.iterdir())
pointers = [(&#39;└── &#39; if i == len(contents) - 1 else &#39;├── &#39;) for i in range(len(contents))]
for pointer, item in zip(pointers, contents):
rel_path = item.relative_to(start_dir)
if rel_path in self.included_files:
tree.append(f&#34;{prefix}{pointer}{rel_path}&#34;)
if item.is_dir():
add_to_tree(item, prefix + (&#39; &#39; if pointer == &#39;└── &#39; else &#39;│ &#39;))
add_to_tree(start_dir)
return &#39;\n&#39;.join(tree)
def run(self):
&#34;&#34;&#34;Execute the context gathering, truncation, and reporting.&#34;&#34;&#34;
context = self.gather_context()
context = self.truncate_context(context)
token_count = self.count_tokens(context)
print(f&#34;Context gathered successfully.&#34;)
print(f&#34;Total number of tokens (estimated): {token_count}&#34;)
# self.save_context(context)
context_tree = self.get_context_tree()
logger.debug(f&#34;Context tree:\n{context_tree}&#34;)
return context, token_count, context_tree</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="praisonai.ui.context.ContextGatherer.count_tokens"><code class="name flex">
<span>def <span class="ident">count_tokens</span></span>(<span>self, text)</span>
</code></dt>
<dd>
<div class="desc"><p>Count tokens using a simple whitespace-based tokenizer.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.gather_context"><code class="name flex">
<span>def <span class="ident">gather_context</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Gather context from relevant files, respecting ignore patterns
and include options from .praisoninclude and .praisoncontext.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.get_context_tree"><code class="name flex">
<span>def <span class="ident">get_context_tree</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Generate a formatted tree structure of included files and folders.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.get_ignore_patterns"><code class="name flex">
<span>def <span class="ident">get_ignore_patterns</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Loads ignore patterns from various sources, prioritizing them in
the following order:
1. .praisonignore
2. settings.yaml (under code.ignore_files)
3. PRAISONAI_IGNORE_FILES environment variable
4. .gitignore
5. Default patterns</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.get_include_paths"><code class="name flex">
<span>def <span class="ident">get_include_paths</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Loads include paths from:
1. .praisoninclude (includes ONLY files/directories listed)
2. .praisoncontext (if .praisoninclude doesn't exist, this is used
to include all other relevant files, excluding ignore patterns)</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.is_relevant_file"><code class="name flex">
<span>def <span class="ident">is_relevant_file</span></span>(<span>self, file_path)</span>
</code></dt>
<dd>
<div class="desc"><p>Determine if a file is relevant for the context.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.run"><code class="name flex">
<span>def <span class="ident">run</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>Execute the context gathering, truncation, and reporting.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.save_context"><code class="name flex">
<span>def <span class="ident">save_context</span></span>(<span>self, context)</span>
</code></dt>
<dd>
<div class="desc"><p>Save the gathered context to a file.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.should_ignore"><code class="name flex">
<span>def <span class="ident">should_ignore</span></span>(<span>self, file_path)</span>
</code></dt>
<dd>
<div class="desc"><p>Check if a file or directory should be ignored based on patterns.
Handles both file names and directory names for more comprehensive filtering.</p></div>
</dd>
<dt id="praisonai.ui.context.ContextGatherer.truncate_context"><code class="name flex">
<span>def <span class="ident">truncate_context</span></span>(<span>self, context)</span>
</code></dt>
<dd>
<div class="desc"><p>Truncate context to stay within the token limit.</p></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.ui" href="index.html">praisonai.ui</a></code></li>
</ul>
</li>
<li><h3><a href="#header-functions">Functions</a></h3>
<ul class="">
<li><code><a title="praisonai.ui.context.main" href="#praisonai.ui.context.main">main</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.ui.context.ContextGatherer" href="#praisonai.ui.context.ContextGatherer">ContextGatherer</a></code></h4>
<ul class="two-column">
<li><code><a title="praisonai.ui.context.ContextGatherer.count_tokens" href="#praisonai.ui.context.ContextGatherer.count_tokens">count_tokens</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.gather_context" href="#praisonai.ui.context.ContextGatherer.gather_context">gather_context</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.get_context_tree" href="#praisonai.ui.context.ContextGatherer.get_context_tree">get_context_tree</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.get_ignore_patterns" href="#praisonai.ui.context.ContextGatherer.get_ignore_patterns">get_ignore_patterns</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.get_include_paths" href="#praisonai.ui.context.ContextGatherer.get_include_paths">get_include_paths</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.is_relevant_file" href="#praisonai.ui.context.ContextGatherer.is_relevant_file">is_relevant_file</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.run" href="#praisonai.ui.context.ContextGatherer.run">run</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.save_context" href="#praisonai.ui.context.ContextGatherer.save_context">save_context</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.should_ignore" href="#praisonai.ui.context.ContextGatherer.should_ignore">should_ignore</a></code></li>
<li><code><a title="praisonai.ui.context.ContextGatherer.truncate_context" href="#praisonai.ui.context.ContextGatherer.truncate_context">truncate_context</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-77
View File
@@ -1,77 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.ui API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Namespace <code>praisonai.ui</code></h1>
</header>
<section id="section-intro">
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
<dl>
<dt><code class="name"><a title="praisonai.ui.context" href="context.html">praisonai.ui.context</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.ui.realtimeclient" href="realtimeclient/index.html">praisonai.ui.realtimeclient</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt><code class="name"><a title="praisonai.ui.sql_alchemy" href="sql_alchemy.html">praisonai.ui.sql_alchemy</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
</ul>
</li>
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
<ul>
<li><code><a title="praisonai.ui.context" href="context.html">praisonai.ui.context</a></code></li>
<li><code><a title="praisonai.ui.realtimeclient" href="realtimeclient/index.html">praisonai.ui.realtimeclient</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy" href="sql_alchemy.html">praisonai.ui.sql_alchemy</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
File diff suppressed because it is too large. Load diff
-898
View File
@@ -1,898 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.ui.sql_alchemy API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.ui.sql_alchemy</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer"><code class="flex name class">
<span>class <span class="ident">SQLAlchemyDataLayer</span></span>
<span>(</span><span>conninfo: str, ssl_require: bool = False, storage_provider: Optional[chainlit.data.base.BaseStorageClient] = None, user_thread_limit: Optional[int] = 1000, show_logger: Optional[bool] = False)</span>
</code></dt>
<dd>
<div class="desc"><p>Base class for data persistence.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class SQLAlchemyDataLayer(BaseDataLayer):
def __init__(
self,
conninfo: str,
ssl_require: bool = False,
storage_provider: Optional[BaseStorageClient] = None,
user_thread_limit: Optional[int] = 1000,
show_logger: Optional[bool] = False,
):
self._conninfo = conninfo
self.user_thread_limit = user_thread_limit
self.show_logger = show_logger
ssl_args = {}
if ssl_require:
# Create an SSL context to require an SSL connection
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
ssl_args[&#34;ssl&#34;] = ssl_context
self.engine: AsyncEngine = create_async_engine(
self._conninfo, connect_args=ssl_args
)
self.async_session = sessionmaker(
bind=self.engine, expire_on_commit=False, class_=AsyncSession
) # type: ignore
if storage_provider:
self.storage_provider: Optional[BaseStorageClient] = storage_provider
if self.show_logger:
logger.info(&#34;SQLAlchemyDataLayer storage client initialized&#34;)
else:
self.storage_provider = None
logger.warn(
&#34;SQLAlchemyDataLayer storage client is not initialized and elements will not be persisted!&#34;
)
async def build_debug_url(self) -&gt; str:
return &#34;&#34;
###### SQL Helpers ######
async def execute_sql(
self, query: str, parameters: dict
) -&gt; Union[List[Dict[str, Any]], int, None]:
parameterized_query = text(query)
async with self.async_session() as session:
try:
await session.begin()
result = await session.execute(parameterized_query, parameters)
await session.commit()
if result.returns_rows:
json_result = [dict(row._mapping) for row in result.fetchall()]
clean_json_result = self.clean_result(json_result)
assert isinstance(clean_json_result, list) or isinstance(
clean_json_result, int
)
return clean_json_result
else:
return result.rowcount
except SQLAlchemyError as e:
await session.rollback()
logger.warn(f&#34;An error occurred: {e}&#34;)
return None
except Exception as e:
await session.rollback()
logger.warn(f&#34;An unexpected error occurred: {e}&#34;)
return None
async def get_current_timestamp(self) -&gt; str:
return datetime.now().isoformat() + &#34;Z&#34;
def clean_result(self, obj):
&#34;&#34;&#34;Recursively change UUID -&gt; str and serialize dictionaries&#34;&#34;&#34;
if isinstance(obj, dict):
return {k: self.clean_result(v) for k, v in obj.items()}
elif isinstance(obj, list):
return [self.clean_result(item) for item in obj]
elif isinstance(obj, uuid.UUID):
return str(obj)
return obj
###### User ######
async def get_user(self, identifier: str) -&gt; Optional[PersistedUser]:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: get_user, identifier={identifier}&#34;)
query = &#34;SELECT * FROM users WHERE identifier = :identifier&#34;
parameters = {&#34;identifier&#34;: identifier}
result = await self.execute_sql(query=query, parameters=parameters)
if result and isinstance(result, list):
user_data = result[0]
# SQLite returns JSON as string, we most convert it. (#1137)
metadata = user_data.get(&#34;metadata&#34;, {})
if isinstance(metadata, str):
metadata = json.loads(metadata)
assert isinstance(metadata, dict)
assert isinstance(user_data[&#34;id&#34;], str)
assert isinstance(user_data[&#34;identifier&#34;], str)
assert isinstance(user_data[&#34;createdAt&#34;], str)
return PersistedUser(
id=user_data[&#34;id&#34;],
identifier=user_data[&#34;identifier&#34;],
createdAt=user_data[&#34;createdAt&#34;],
metadata=metadata,
)
return None
async def _get_user_identifer_by_id(self, user_id: str) -&gt; str:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: _get_user_identifer_by_id, user_id={user_id}&#34;)
query = &#34;SELECT identifier FROM users WHERE id = :user_id&#34;
parameters = {&#34;user_id&#34;: user_id}
result = await self.execute_sql(query=query, parameters=parameters)
assert result
assert isinstance(result, list)
return result[0][&#34;identifier&#34;]
async def _get_user_id_by_thread(self, thread_id: str) -&gt; Optional[str]:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: _get_user_id_by_thread, thread_id={thread_id}&#34;)
query = &#34;SELECT userId FROM threads WHERE id = :thread_id&#34;
parameters = {&#34;thread_id&#34;: thread_id}
result = await self.execute_sql(query=query, parameters=parameters)
if result:
assert isinstance(result, list)
return result[0][&#34;userId&#34;]
return None
async def create_user(self, user: User) -&gt; Optional[PersistedUser]:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: create_user, user_identifier={user.identifier}&#34;)
existing_user: Optional[&#34;PersistedUser&#34;] = await self.get_user(user.identifier)
user_dict: Dict[str, Any] = {
&#34;identifier&#34;: str(user.identifier),
&#34;metadata&#34;: json.dumps(user.metadata) or {},
}
if not existing_user: # create the user
if self.show_logger:
logger.info(&#34;SQLAlchemy: create_user, creating the user&#34;)
user_dict[&#34;id&#34;] = str(uuid.uuid4())
user_dict[&#34;createdAt&#34;] = await self.get_current_timestamp()
query = &#34;&#34;&#34;INSERT INTO users (&#34;id&#34;, &#34;identifier&#34;, &#34;createdAt&#34;, &#34;metadata&#34;) VALUES (:id, :identifier, :createdAt, :metadata)&#34;&#34;&#34;
await self.execute_sql(query=query, parameters=user_dict)
else: # update the user
if self.show_logger:
logger.info(&#34;SQLAlchemy: update user metadata&#34;)
query = &#34;&#34;&#34;UPDATE users SET &#34;metadata&#34; = :metadata WHERE &#34;identifier&#34; = :identifier&#34;&#34;&#34;
await self.execute_sql(
query=query, parameters=user_dict
) # We want to update the metadata
return await self.get_user(user.identifier)
###### Threads ######
async def get_thread_author(self, thread_id: str) -&gt; str:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: get_thread_author, thread_id={thread_id}&#34;)
query = &#34;&#34;&#34;SELECT &#34;userIdentifier&#34; FROM threads WHERE &#34;id&#34; = :id&#34;&#34;&#34;
parameters = {&#34;id&#34;: thread_id}
result = await self.execute_sql(query=query, parameters=parameters)
if isinstance(result, list) and result:
author_identifier = result[0].get(&#34;userIdentifier&#34;)
if author_identifier is not None:
return author_identifier
raise ValueError(f&#34;Author not found for thread_id {thread_id}&#34;)
async def get_thread(self, thread_id: str) -&gt; Optional[ThreadDict]:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: get_thread, thread_id={thread_id}&#34;)
user_threads: Optional[List[ThreadDict]] = await self.get_all_user_threads(
thread_id=thread_id
)
if user_threads:
return user_threads[0]
else:
return None
async def update_thread(
self,
thread_id: str,
name: Optional[str] = None,
user_id: Optional[str] = None,
metadata: Optional[Dict] = None,
tags: Optional[List[str]] = None,
):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: update_thread, thread_id={thread_id}&#34;)
user_identifier = None
if user_id:
user_identifier = await self._get_user_identifer_by_id(user_id)
data = {
&#34;id&#34;: thread_id,
&#34;createdAt&#34;: (
await self.get_current_timestamp() if metadata is None else None
),
&#34;name&#34;: (
name
if name is not None
else (metadata.get(&#34;name&#34;) if metadata and &#34;name&#34; in metadata else None)
),
&#34;userId&#34;: user_id,
&#34;userIdentifier&#34;: user_identifier,
&#34;tags&#34;: tags,
&#34;metadata&#34;: json.dumps(metadata) if metadata else None,
}
parameters = {
key: value for key, value in data.items() if value is not None
} # Remove keys with None values
columns = &#34;, &#34;.join(f&#39;&#34;{key}&#34;&#39; for key in parameters.keys())
values = &#34;, &#34;.join(f&#34;:{key}&#34; for key in parameters.keys())
updates = &#34;, &#34;.join(
f&#39;&#34;{key}&#34; = EXCLUDED.&#34;{key}&#34;&#39; for key in parameters.keys() if key != &#34;id&#34;
)
query = f&#34;&#34;&#34;
INSERT INTO threads ({columns})
VALUES ({values})
ON CONFLICT (&#34;id&#34;) DO UPDATE
SET {updates};
&#34;&#34;&#34;
await self.execute_sql(query=query, parameters=parameters)
async def delete_thread(self, thread_id: str):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: delete_thread, thread_id={thread_id}&#34;)
# Delete feedbacks/elements/steps/thread
feedbacks_query = &#34;&#34;&#34;DELETE FROM feedbacks WHERE &#34;forId&#34; IN (SELECT &#34;id&#34; FROM steps WHERE &#34;threadId&#34; = :id)&#34;&#34;&#34;
elements_query = &#34;&#34;&#34;DELETE FROM elements WHERE &#34;threadId&#34; = :id&#34;&#34;&#34;
steps_query = &#34;&#34;&#34;DELETE FROM steps WHERE &#34;threadId&#34; = :id&#34;&#34;&#34;
thread_query = &#34;&#34;&#34;DELETE FROM threads WHERE &#34;id&#34; = :id&#34;&#34;&#34;
parameters = {&#34;id&#34;: thread_id}
await self.execute_sql(query=feedbacks_query, parameters=parameters)
await self.execute_sql(query=elements_query, parameters=parameters)
await self.execute_sql(query=steps_query, parameters=parameters)
await self.execute_sql(query=thread_query, parameters=parameters)
async def list_threads(
self, pagination: Pagination, filters: ThreadFilter
) -&gt; PaginatedResponse:
if self.show_logger:
logger.info(
f&#34;SQLAlchemy: list_threads, pagination={pagination}, filters={filters}&#34;
)
if not filters.userId:
raise ValueError(&#34;userId is required&#34;)
all_user_threads: List[ThreadDict] = (
await self.get_all_user_threads(user_id=filters.userId) or []
)
search_keyword = filters.search.lower() if filters.search else None
feedback_value = int(filters.feedback) if filters.feedback else None
filtered_threads = []
for thread in all_user_threads:
keyword_match = True
feedback_match = True
if search_keyword or feedback_value is not None:
if search_keyword:
keyword_match = any(
search_keyword in step[&#34;output&#34;].lower()
for step in thread[&#34;steps&#34;]
if &#34;output&#34; in step
)
if feedback_value is not None:
feedback_match = False # Assume no match until found
for step in thread[&#34;steps&#34;]:
feedback = step.get(&#34;feedback&#34;)
if feedback and feedback.get(&#34;value&#34;) == feedback_value:
feedback_match = True
break
if keyword_match and feedback_match:
filtered_threads.append(thread)
start = 0
if pagination.cursor:
for i, thread in enumerate(filtered_threads):
if (
thread[&#34;id&#34;] == pagination.cursor
): # Find the start index using pagination.cursor
start = i + 1
break
end = start + pagination.first
paginated_threads = filtered_threads[start:end] or []
has_next_page = len(filtered_threads) &gt; end
start_cursor = paginated_threads[0][&#34;id&#34;] if paginated_threads else None
end_cursor = paginated_threads[-1][&#34;id&#34;] if paginated_threads else None
return PaginatedResponse(
pageInfo=PageInfo(
hasNextPage=has_next_page,
startCursor=start_cursor,
endCursor=end_cursor,
),
data=paginated_threads,
)
###### Steps ######
@queue_until_user_message()
async def create_step(self, step_dict: &#34;StepDict&#34;):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: create_step, step_id={step_dict.get(&#39;id&#39;)}&#34;)
step_dict[&#34;showInput&#34;] = (
str(step_dict.get(&#34;showInput&#34;, &#34;&#34;)).lower()
if &#34;showInput&#34; in step_dict
else None
)
parameters = {
key: value
for key, value in step_dict.items()
if value is not None and not (isinstance(value, dict) and not value)
}
parameters[&#34;metadata&#34;] = json.dumps(step_dict.get(&#34;metadata&#34;, {}))
parameters[&#34;generation&#34;] = json.dumps(step_dict.get(&#34;generation&#34;, {}))
columns = &#34;, &#34;.join(f&#39;&#34;{key}&#34;&#39; for key in parameters.keys())
values = &#34;, &#34;.join(f&#34;:{key}&#34; for key in parameters.keys())
updates = &#34;, &#34;.join(
f&#39;&#34;{key}&#34; = :{key}&#39; for key in parameters.keys() if key != &#34;id&#34;
)
query = f&#34;&#34;&#34;
INSERT INTO steps ({columns})
VALUES ({values})
ON CONFLICT (id) DO UPDATE
SET {updates};
&#34;&#34;&#34;
await self.execute_sql(query=query, parameters=parameters)
@queue_until_user_message()
async def update_step(self, step_dict: &#34;StepDict&#34;):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: update_step, step_id={step_dict.get(&#39;id&#39;)}&#34;)
await self.create_step(step_dict)
@queue_until_user_message()
async def delete_step(self, step_id: str):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: delete_step, step_id={step_id}&#34;)
# Delete feedbacks/elements/steps
feedbacks_query = &#34;&#34;&#34;DELETE FROM feedbacks WHERE &#34;forId&#34; = :id&#34;&#34;&#34;
elements_query = &#34;&#34;&#34;DELETE FROM elements WHERE &#34;forId&#34; = :id&#34;&#34;&#34;
steps_query = &#34;&#34;&#34;DELETE FROM steps WHERE &#34;id&#34; = :id&#34;&#34;&#34;
parameters = {&#34;id&#34;: step_id}
await self.execute_sql(query=feedbacks_query, parameters=parameters)
await self.execute_sql(query=elements_query, parameters=parameters)
await self.execute_sql(query=steps_query, parameters=parameters)
###### Feedback ######
async def upsert_feedback(self, feedback: Feedback) -&gt; str:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: upsert_feedback, feedback_id={feedback.id}&#34;)
feedback.id = feedback.id or str(uuid.uuid4())
feedback_dict = asdict(feedback)
parameters = {
key: value for key, value in feedback_dict.items() if value is not None
}
columns = &#34;, &#34;.join(f&#39;&#34;{key}&#34;&#39; for key in parameters.keys())
values = &#34;, &#34;.join(f&#34;:{key}&#34; for key in parameters.keys())
updates = &#34;, &#34;.join(
f&#39;&#34;{key}&#34; = :{key}&#39; for key in parameters.keys() if key != &#34;id&#34;
)
query = f&#34;&#34;&#34;
INSERT INTO feedbacks ({columns})
VALUES ({values})
ON CONFLICT (id) DO UPDATE
SET {updates};
&#34;&#34;&#34;
await self.execute_sql(query=query, parameters=parameters)
return feedback.id
async def delete_feedback(self, feedback_id: str) -&gt; bool:
if self.show_logger:
logger.info(f&#34;SQLAlchemy: delete_feedback, feedback_id={feedback_id}&#34;)
query = &#34;&#34;&#34;DELETE FROM feedbacks WHERE &#34;id&#34; = :feedback_id&#34;&#34;&#34;
parameters = {&#34;feedback_id&#34;: feedback_id}
await self.execute_sql(query=query, parameters=parameters)
return True
###### Elements ######
async def get_element(
self, thread_id: str, element_id: str
) -&gt; Optional[&#34;ElementDict&#34;]:
if self.show_logger:
logger.info(
f&#34;SQLAlchemy: get_element, thread_id={thread_id}, element_id={element_id}&#34;
)
query = &#34;&#34;&#34;SELECT * FROM elements WHERE &#34;threadId&#34; = :thread_id AND &#34;id&#34; = :element_id&#34;&#34;&#34;
parameters = {&#34;thread_id&#34;: thread_id, &#34;element_id&#34;: element_id}
element: Union[List[Dict[str, Any]], int, None] = await self.execute_sql(
query=query, parameters=parameters
)
if isinstance(element, list) and element:
element_dict: Dict[str, Any] = element[0]
return ElementDict(
id=element_dict[&#34;id&#34;],
threadId=element_dict.get(&#34;threadId&#34;),
type=element_dict[&#34;type&#34;],
chainlitKey=element_dict.get(&#34;chainlitKey&#34;),
url=element_dict.get(&#34;url&#34;),
objectKey=element_dict.get(&#34;objectKey&#34;),
name=element_dict[&#34;name&#34;],
display=element_dict[&#34;display&#34;],
size=element_dict.get(&#34;size&#34;),
language=element_dict.get(&#34;language&#34;),
page=element_dict.get(&#34;page&#34;),
autoPlay=element_dict.get(&#34;autoPlay&#34;),
playerConfig=element_dict.get(&#34;playerConfig&#34;),
forId=element_dict.get(&#34;forId&#34;),
mime=element_dict.get(&#34;mime&#34;),
)
else:
return None
@queue_until_user_message()
async def create_element(self, element: &#34;Element&#34;):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: create_element, element_id = {element.id}&#34;)
if not self.storage_provider:
logger.warn(
&#34;SQLAlchemy: create_element error. No blob_storage_client is configured!&#34;
)
return
if not element.for_id:
return
content: Optional[Union[bytes, str]] = None
if element.path:
async with aiofiles.open(element.path, &#34;rb&#34;) as f:
content = await f.read()
elif element.url:
async with aiohttp.ClientSession() as session:
async with session.get(element.url) as response:
if response.status == 200:
content = await response.read()
else:
content = None
elif element.content:
content = element.content
else:
raise ValueError(&#34;Element url, path or content must be provided&#34;)
if content is None:
raise ValueError(&#34;Content is None, cannot upload file&#34;)
user_id: str = await self._get_user_id_by_thread(element.thread_id) or &#34;unknown&#34;
file_object_key = f&#34;{user_id}/{element.id}&#34; + (
f&#34;/{element.name}&#34; if element.name else &#34;&#34;
)
if not element.mime:
element.mime = &#34;application/octet-stream&#34;
uploaded_file = await self.storage_provider.upload_file(
object_key=file_object_key, data=content, mime=element.mime, overwrite=True
)
if not uploaded_file:
raise ValueError(
&#34;SQLAlchemy Error: create_element, Failed to persist data in storage_provider&#34;
)
element_dict: ElementDict = element.to_dict()
element_dict[&#34;url&#34;] = uploaded_file.get(&#34;url&#34;)
element_dict[&#34;objectKey&#34;] = uploaded_file.get(&#34;object_key&#34;)
element_dict_cleaned = {k: v for k, v in element_dict.items() if v is not None}
columns = &#34;, &#34;.join(f&#39;&#34;{column}&#34;&#39; for column in element_dict_cleaned.keys())
placeholders = &#34;, &#34;.join(f&#34;:{column}&#34; for column in element_dict_cleaned.keys())
query = f&#34;INSERT INTO elements ({columns}) VALUES ({placeholders})&#34;
await self.execute_sql(query=query, parameters=element_dict_cleaned)
@queue_until_user_message()
async def delete_element(self, element_id: str, thread_id: Optional[str] = None):
if self.show_logger:
logger.info(f&#34;SQLAlchemy: delete_element, element_id={element_id}&#34;)
query = &#34;&#34;&#34;DELETE FROM elements WHERE &#34;id&#34; = :id&#34;&#34;&#34;
parameters = {&#34;id&#34;: element_id}
await self.execute_sql(query=query, parameters=parameters)
async def get_all_user_threads(
self, user_id: Optional[str] = None, thread_id: Optional[str] = None
) -&gt; Optional[List[ThreadDict]]:
&#34;&#34;&#34;Fetch all user threads up to self.user_thread_limit, or one thread by id if thread_id is provided.&#34;&#34;&#34;
if self.show_logger:
logger.info(&#34;SQLAlchemy: get_all_user_threads&#34;)
user_threads_query = &#34;&#34;&#34;
SELECT
&#34;id&#34; AS thread_id,
&#34;createdAt&#34; AS thread_createdat,
&#34;name&#34; AS thread_name,
&#34;userId&#34; AS user_id,
&#34;userIdentifier&#34; AS user_identifier,
&#34;tags&#34; AS thread_tags,
&#34;metadata&#34; AS thread_metadata
FROM threads
WHERE &#34;userId&#34; = :user_id OR &#34;id&#34; = :thread_id
ORDER BY &#34;createdAt&#34; DESC
LIMIT :limit
&#34;&#34;&#34;
user_threads = await self.execute_sql(
query=user_threads_query,
parameters={
&#34;user_id&#34;: user_id,
&#34;limit&#34;: self.user_thread_limit,
&#34;thread_id&#34;: thread_id,
},
)
if not isinstance(user_threads, list):
return None
if not user_threads:
return []
else:
thread_ids = (
&#34;(&#39;&#34;
+ &#34;&#39;,&#39;&#34;.join(map(str, [thread[&#34;thread_id&#34;] for thread in user_threads]))
+ &#34;&#39;)&#34;
)
steps_feedbacks_query = f&#34;&#34;&#34;
SELECT
s.&#34;id&#34; AS step_id,
s.&#34;name&#34; AS step_name,
s.&#34;type&#34; AS step_type,
s.&#34;threadId&#34; AS step_threadid,
s.&#34;parentId&#34; AS step_parentid,
s.&#34;streaming&#34; AS step_streaming,
s.&#34;waitForAnswer&#34; AS step_waitforanswer,
s.&#34;isError&#34; AS step_iserror,
s.&#34;metadata&#34; AS step_metadata,
s.&#34;tags&#34; AS step_tags,
s.&#34;input&#34; AS step_input,
s.&#34;output&#34; AS step_output,
s.&#34;createdAt&#34; AS step_createdat,
s.&#34;start&#34; AS step_start,
s.&#34;end&#34; AS step_end,
s.&#34;generation&#34; AS step_generation,
s.&#34;showInput&#34; AS step_showinput,
s.&#34;language&#34; AS step_language,
s.&#34;indent&#34; AS step_indent,
f.&#34;value&#34; AS feedback_value,
f.&#34;comment&#34; AS feedback_comment,
f.&#34;id&#34; AS feedback_id
FROM steps s LEFT JOIN feedbacks f ON s.&#34;id&#34; = f.&#34;forId&#34;
WHERE s.&#34;threadId&#34; IN {thread_ids}
ORDER BY s.&#34;createdAt&#34; ASC
&#34;&#34;&#34;
steps_feedbacks = await self.execute_sql(
query=steps_feedbacks_query, parameters={}
)
elements_query = f&#34;&#34;&#34;
SELECT
e.&#34;id&#34; AS element_id,
e.&#34;threadId&#34; as element_threadid,
e.&#34;type&#34; AS element_type,
e.&#34;chainlitKey&#34; AS element_chainlitkey,
e.&#34;url&#34; AS element_url,
e.&#34;objectKey&#34; as element_objectkey,
e.&#34;name&#34; AS element_name,
e.&#34;display&#34; AS element_display,
e.&#34;size&#34; AS element_size,
e.&#34;language&#34; AS element_language,
e.&#34;page&#34; AS element_page,
e.&#34;forId&#34; AS element_forid,
e.&#34;mime&#34; AS element_mime
FROM elements e
WHERE e.&#34;threadId&#34; IN {thread_ids}
&#34;&#34;&#34;
elements = await self.execute_sql(query=elements_query, parameters={})
thread_dicts = {}
for thread in user_threads:
thread_id = thread[&#34;thread_id&#34;]
if thread_id is not None:
# Ensure metadata is a dictionary
metadata = thread[&#34;thread_metadata&#34;]
if isinstance(metadata, str):
try:
metadata = json.loads(metadata)
except json.JSONDecodeError:
metadata = {}
elif metadata is None:
metadata = {}
thread_dicts[thread_id] = ThreadDict(
id=thread_id,
createdAt=thread[&#34;thread_createdat&#34;],
name=thread[&#34;thread_name&#34;],
userId=thread[&#34;user_id&#34;],
userIdentifier=thread[&#34;user_identifier&#34;],
tags=thread[&#34;thread_tags&#34;],
metadata=metadata,
steps=[],
elements=[],
)
# Process steps_feedbacks to populate the steps in the corresponding ThreadDict
if isinstance(steps_feedbacks, list):
for step_feedback in steps_feedbacks:
thread_id = step_feedback[&#34;step_threadid&#34;]
if thread_id is not None:
feedback = None
if step_feedback[&#34;feedback_value&#34;] is not None:
feedback = FeedbackDict(
forId=step_feedback[&#34;step_id&#34;],
id=step_feedback.get(&#34;feedback_id&#34;),
value=step_feedback[&#34;feedback_value&#34;],
comment=step_feedback.get(&#34;feedback_comment&#34;),
)
step_dict = StepDict(
id=step_feedback[&#34;step_id&#34;],
name=step_feedback[&#34;step_name&#34;],
type=step_feedback[&#34;step_type&#34;],
threadId=thread_id,
parentId=step_feedback.get(&#34;step_parentid&#34;),
streaming=step_feedback.get(&#34;step_streaming&#34;, False),
waitForAnswer=step_feedback.get(&#34;step_waitforanswer&#34;),
isError=step_feedback.get(&#34;step_iserror&#34;),
metadata=(
step_feedback[&#34;step_metadata&#34;]
if step_feedback.get(&#34;step_metadata&#34;) is not None
else {}
),
tags=step_feedback.get(&#34;step_tags&#34;),
input=(
step_feedback.get(&#34;step_input&#34;, &#34;&#34;)
if step_feedback.get(&#34;step_showinput&#34;)
not in [None, &#34;false&#34;]
else &#34;&#34;
),
output=step_feedback.get(&#34;step_output&#34;, &#34;&#34;),
createdAt=step_feedback.get(&#34;step_createdat&#34;),
start=step_feedback.get(&#34;step_start&#34;),
end=step_feedback.get(&#34;step_end&#34;),
generation=step_feedback.get(&#34;step_generation&#34;),
showInput=step_feedback.get(&#34;step_showinput&#34;),
language=step_feedback.get(&#34;step_language&#34;),
indent=step_feedback.get(&#34;step_indent&#34;),
feedback=feedback,
)
# Append the step to the steps list of the corresponding ThreadDict
thread_dicts[thread_id][&#34;steps&#34;].append(step_dict)
if isinstance(elements, list):
for element in elements:
thread_id = element[&#34;element_threadid&#34;]
if thread_id is not None:
element_dict = ElementDict(
id=element[&#34;element_id&#34;],
threadId=thread_id,
type=element[&#34;element_type&#34;],
chainlitKey=element.get(&#34;element_chainlitkey&#34;),
url=element.get(&#34;element_url&#34;),
objectKey=element.get(&#34;element_objectkey&#34;),
name=element[&#34;element_name&#34;],
display=element[&#34;element_display&#34;],
size=element.get(&#34;element_size&#34;),
language=element.get(&#34;element_language&#34;),
autoPlay=element.get(&#34;element_autoPlay&#34;),
playerConfig=element.get(&#34;element_playerconfig&#34;),
page=element.get(&#34;element_page&#34;),
forId=element.get(&#34;element_forid&#34;),
mime=element.get(&#34;element_mime&#34;),
)
thread_dicts[thread_id][&#34;elements&#34;].append(element_dict) # type: ignore
return list(thread_dicts.values())</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li>chainlit.data.base.BaseDataLayer</li>
<li>abc.ABC</li>
</ul>
<h3>Methods</h3>
<dl>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.build_debug_url"><code class="name flex">
<span>async def <span class="ident">build_debug_url</span></span>(<span>self) ‑> str</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.clean_result"><code class="name flex">
<span>def <span class="ident">clean_result</span></span>(<span>self, obj)</span>
</code></dt>
<dd>
<div class="desc"><p>Recursively change UUID -&gt; str and serialize dictionaries</p></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_element"><code class="name flex">
<span>async def <span class="ident">create_element</span></span>(<span>self, element: Element)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_step"><code class="name flex">
<span>async def <span class="ident">create_step</span></span>(<span>self, step_dict: StepDict)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_user"><code class="name flex">
<span>async def <span class="ident">create_user</span></span>(<span>self, user: chainlit.user.User) ‑> Optional[chainlit.user.PersistedUser]</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_element"><code class="name flex">
<span>async def <span class="ident">delete_element</span></span>(<span>self, element_id: str, thread_id: Optional[str] = None)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_feedback"><code class="name flex">
<span>async def <span class="ident">delete_feedback</span></span>(<span>self, feedback_id: str) ‑> bool</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_step"><code class="name flex">
<span>async def <span class="ident">delete_step</span></span>(<span>self, step_id: str)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_thread"><code class="name flex">
<span>async def <span class="ident">delete_thread</span></span>(<span>self, thread_id: str)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.execute_sql"><code class="name flex">
<span>async def <span class="ident">execute_sql</span></span>(<span>self, query: str, parameters: dict) ‑> Union[List[Dict[str, Any]], int, ForwardRef(None)]</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_all_user_threads"><code class="name flex">
<span>async def <span class="ident">get_all_user_threads</span></span>(<span>self, user_id: Optional[str] = None, thread_id: Optional[str] = None) ‑> Optional[List[chainlit.types.ThreadDict]]</span>
</code></dt>
<dd>
<div class="desc"><p>Fetch all user threads up to self.user_thread_limit, or one thread by id if thread_id is provided.</p></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_current_timestamp"><code class="name flex">
<span>async def <span class="ident">get_current_timestamp</span></span>(<span>self) ‑> str</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_element"><code class="name flex">
<span>async def <span class="ident">get_element</span></span>(<span>self, thread_id: str, element_id: str) ‑> Optional[chainlit.element.ElementDict]</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_thread"><code class="name flex">
<span>async def <span class="ident">get_thread</span></span>(<span>self, thread_id: str) ‑> Optional[chainlit.types.ThreadDict]</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_thread_author"><code class="name flex">
<span>async def <span class="ident">get_thread_author</span></span>(<span>self, thread_id: str) ‑> str</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_user"><code class="name flex">
<span>async def <span class="ident">get_user</span></span>(<span>self, identifier: str) ‑> Optional[chainlit.user.PersistedUser]</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.list_threads"><code class="name flex">
<span>async def <span class="ident">list_threads</span></span>(<span>self, pagination: chainlit.types.Pagination, filters: chainlit.types.ThreadFilter) ‑> chainlit.types.PaginatedResponse</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.update_step"><code class="name flex">
<span>async def <span class="ident">update_step</span></span>(<span>self, step_dict: StepDict)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.update_thread"><code class="name flex">
<span>async def <span class="ident">update_thread</span></span>(<span>self, thread_id: str, name: Optional[str] = None, user_id: Optional[str] = None, metadata: Optional[Dict] = None, tags: Optional[List[str]] = None)</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.upsert_feedback"><code class="name flex">
<span>async def <span class="ident">upsert_feedback</span></span>(<span>self, feedback: chainlit.types.Feedback) ‑> str</span>
</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai.ui" href="index.html">praisonai.ui</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer">SQLAlchemyDataLayer</a></code></h4>
<ul class="">
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.build_debug_url" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.build_debug_url">build_debug_url</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.clean_result" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.clean_result">clean_result</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_element" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_element">create_element</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_step" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_step">create_step</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_user" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.create_user">create_user</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_element" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_element">delete_element</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_feedback" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_feedback">delete_feedback</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_step" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_step">delete_step</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_thread" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.delete_thread">delete_thread</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.execute_sql" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.execute_sql">execute_sql</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_all_user_threads" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_all_user_threads">get_all_user_threads</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_current_timestamp" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_current_timestamp">get_current_timestamp</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_element" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_element">get_element</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_thread" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_thread">get_thread</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_thread_author" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_thread_author">get_thread_author</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_user" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.get_user">get_user</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.list_threads" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.list_threads">list_threads</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.update_step" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.update_step">update_step</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.update_thread" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.update_thread">update_thread</a></code></li>
<li><code><a title="praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.upsert_feedback" href="#praisonai.ui.sql_alchemy.SQLAlchemyDataLayer.upsert_feedback">upsert_feedback</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-55
View File
@@ -1,55 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta name="generator" content="pdoc3 0.11.1">
<title>praisonai.version API documentation</title>
<meta name="description" content="">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => {
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
hljs.highlightAll();
})</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>praisonai.version</code></h1>
</header>
<section id="section-intro">
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</article>
<nav id="sidebar">
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="praisonai" href="index.html">praisonai</a></code></li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
</footer>
</body>
</html>
-79
View File
@@ -1,79 +0,0 @@
---
title: "Agent Module"
description: "Documentation for the praisonaiagents.agent.agent module"
icon: "user"
---
# Module praisonaiagents.agent.agent
## Classes
### Agent
The main class representing an AI agent with specific role, goal, and capabilities.
#### Parameters
- `name: str` - Name of the agent
- `role: str` - Role of the agent
- `goal: str` - Goal the agent aims to achieve
- `backstory: str` - Background story of the agent
- `llm: str | Any | None = 'gpt-4o'` - Language model to use
- `tools: List[Any] | None = None` - List of tools available to the agent
- `function_calling_llm: Any | None = None` - LLM for function calling
- `max_iter: int = 20` - Maximum iterations
- `max_rpm: int | None = None` - Maximum requests per minute
- `max_execution_time: int | None = None` - Maximum execution time
- `memory: bool = True` - Enable memory
- `verbose: bool = True` - Enable verbose output
- `allow_delegation: bool = False` - Allow task delegation
- `step_callback: Any | None = None` - Callback for each step
- `cache: bool = True` - Enable caching
- `system_template: str | None = None` - System prompt template
- `prompt_template: str | None = None` - Prompt template
- `response_template: str | None = None` - Response template
- `allow_code_execution: bool | None = False` - Allow code execution
- `max_retry_limit: int = 2` - Maximum retry attempts
- `respect_context_window: bool = True` - Respect context window size
- `code_execution_mode: Literal['safe', 'unsafe'] = 'safe'` - Code execution mode
- `embedder_config: Dict[str, Any] | None = None` - Embedder configuration
- `knowledge_sources: List[Any] | None = None` - Knowledge sources
- `use_system_prompt: bool | None = True` - Use system prompt
- `markdown: bool = True` - Enable markdown
- `self_reflect: bool = True` - Enable self reflection
- `max_reflect: int = 3` - Maximum reflections
- `min_reflect: int = 1` - Minimum reflections
- `reflect_llm: str | None = None` - LLM for reflection
#### Methods
- `chat(self, prompt, temperature=0.2, tools=None, output_json=None)` - Chat with the agent
- `achat(self, prompt, temperature=0.2, tools=None, output_json=None)` - Async version of chat method
- `clean_json_output(self, output: str) → str` - Clean and extract JSON from response text
- `clear_history(self)` - Clear chat history
- `execute_tool(self, function_name, arguments)` - Execute a tool dynamically based on the function name and arguments
- `_achat_completion(self, response, tools)` - Async version of _chat_completion method
#### Async Support
The Agent class provides async support through the following methods:
- `achat`: Async version of the chat method for non-blocking communication
- `_achat_completion`: Internal async method for handling chat completions
Example usage:
```python
async def main():
agent = Agent(
name="AsyncAgent",
role="Async Specialist",
goal="Handle async operations",
backstory="Expert in async processing"
)
# Use async chat
result = await agent.achat(
prompt="Your prompt here",
tools=your_tools,
output_json=your_schema
)
print(result)
asyncio.run(main())
```
-113
View File
@@ -1,113 +0,0 @@
---
title: "Agents Module"
description: "Documentation for the praisonaiagents.agents.agents module"
icon: "users"
---
# Module praisonaiagents.agents.agents
## Functions
### encode_file_to_base64(file_path: str) → str
Base64-encode a file.
### process_video(video_path: str, seconds_per_frame=2)
Split video into frames (base64-encoded).
## Classes
### LoopItems
A Pydantic model for handling loop items.
#### Class Variables
- `items: List[Any]` - List of items to loop through
- `model_config` - Model configuration
### PraisonAIAgents
The main class for managing agents and tasks execution.
#### Parameters
- `agents: List[Agent]` - List of agents
- `tasks: List[Task]` - List of tasks
- `verbose: int = 0` - Verbosity level
- `completion_checker: Optional[Callable] = None` - Custom completion checker
- `max_retries: int = 5` - Maximum retry attempts
- `process: str = "sequential"` - Process type (sequential, workflow, hierarchical)
- `manager_llm: Optional[str] = None` - Language model for manager agent
#### Methods
- `add_task(self, task)` - Add a task to the crew
- `clean_json_output(self, output: str) → str` - Clean JSON output
- `clear_state(self) → None` - Clear all state values
- `default_completion_checker(self, task, agent_output)` - Default completion checker
- `execute_task(self, task_id)` - Execute a specific task
- `get_agent_details(self, agent_name)` - Get agent details
- `get_all_tasks_status(self)` - Get status of all tasks
- `get_state(self, key: str, default: Any = None) → Any` - Get a state value
- `get_task_details(self, task_id)` - Get task details
- `get_task_result(self, task_id)` - Get task result
- `get_task_status(self, task_id)` - Get task status
- `run_all_tasks(self)` - Execute tasks based on execution mode
- `run_task(self, task_id)` - Run a specific task
- `save_output_to_file(self, task, task_output)` - Save task output to file
- `set_state(self, key: str, value: Any) → None` - Set a state value
- `start(self)` - Start the crew execution
- `update_state(self, updates: Dict) → None` - Update multiple state values
#### Async Methods
- `astart(self)` - Async version of start method
- `aexecute_task(self, task_id)` - Async version of execute_task
- `arun_task(self, task_id)` - Async version of run_task
- `arun_all_tasks(self)` - Async version of run_all_tasks
#### Async Support
The PraisonAIAgents class provides comprehensive async support through the following methods:
```python
class PraisonAIAgents:
async def astart(self):
"""Async version of start method"""
await self.arun_all_tasks()
return {
"task_status": self.get_all_tasks_status(),
"task_results": self.get_task_results()
}
async def aexecute_task(self, task_id):
"""Async version of execute_task method"""
# Async task execution implementation
async def arun_task(self, task_id):
"""Async version of run_task method"""
# Async task running with retries
async def arun_all_tasks(self):
"""Async version of run_all_tasks method"""
# Async execution of all tasks
```
Example usage:
```python
async def main():
# Initialize agents and tasks
agents = PraisonAIAgents(
agents=[async_agent1, async_agent2],
tasks=[async_task1, async_task2],
process="workflow"
)
# Start async execution
result = await agents.astart()
print(result)
# Run the async workflow
asyncio.run(main())
```
#### Async Features
- Full async/await support
- Parallel task execution
- Non-blocking operations
- Efficient resource utilization
- Mixed sync/async task handling
- Async process management
-52
View File
@@ -1,52 +0,0 @@
---
title: "API Reference"
description: "Praison AI Agents - SDK Documentation"
icon: "code"
---
<CardGroup cols={2}>
<Card title="Agent" icon="user" href="/api/praisonaiagents/agent/agent">
Documentation for individual AI agents and their capabilities
</Card>
<Card title="Agents" icon="users" href="/api/praisonaiagents/agents/agents">
Documentation for managing multiple agents and their interactions
</Card>
<Card title="Task" icon="list-check" href="/api/praisonaiagents/task/task">
Documentation for defining and managing tasks
</Card>
<Card title="Process" icon="diagram-project" href="/api/praisonaiagents/process/process">
Documentation for handling task execution flows
</Card>
</CardGroup>
# Module praisonaiagents
## Sub-modules
* praisonaiagents.agent - Agent module for defining individual AI agents
* praisonaiagents.agents - Agents module for managing multiple agents
* praisonaiagents.task - Task module for defining and managing tasks
* praisonaiagents.process - Process module for handling task execution flows
* praisonaiagents.main - Main module containing utility functions
## Functions
### clean_triple_backticks(text: str) → str
Clean triple backticks from text output.
### display_error(message: str, console=None)
Display error messages in the console.
### display_generating(content: str = '', start_time: float | None = None)
Display generation status with optional timing information.
### display_instruction(message: str, console=None)
Display instruction messages in the console.
### display_interaction(message, response, markdown=True, generation_time=None, console=None)
Display interaction between user and agent.
### display_self_reflection(message: str, console=None)
Display agent self-reflection messages.
### display_tool_call(message: str, console=None)
Display tool call messages.
@@ -1,98 +0,0 @@
---
title: "Process Module"
description: "Documentation for the praisonaiagents.process.process module"
icon: "diagram-project"
---
# Module praisonaiagents.process.process
## Classes
### Process
The main class for handling task execution processes in different modes (sequential, hierarchical, workflow).
#### Parameters
- `tasks: Dict[str, Task]` - Dictionary of tasks to be executed
- `agents: List[Agent]` - List of available agents
- `manager_llm: Optional[str] = None` - Language model for manager agent in hierarchical process
- `verbose: bool = False` - Enable verbose logging
#### Methods
- `workflow(self)` - Execute tasks in a workflow pattern with support for loops and conditions
- `sequential(self)` - Execute tasks in sequential order
- `hierarchical(self)` - Execute tasks in hierarchical order with a manager agent
#### Async Methods
- `aworkflow(self) -> AsyncGenerator[str, None]` - Async version of workflow process
- `asequential(self) -> AsyncGenerator[str, None]` - Async version of sequential process
- `ahierarchical(self) -> AsyncGenerator[str, None]` - Async version of hierarchical process
#### Async Process Support
Each process type has an async counterpart that supports non-blocking execution:
```python
class Process:
async def aworkflow(self):
"""Async workflow process execution"""
# Async workflow implementation
async def asequential(self):
"""Async sequential process execution"""
# Async sequential implementation
async def ahierarchical(self):
"""Async hierarchical process execution"""
# Async hierarchical implementation
```
Example usage:
```python
# Create process instance
process = Process(tasks=tasks, agents=agents)
# Use async workflow
async for task_id in process.aworkflow():
# Handle task execution
if tasks[task_id].async_execution:
await handle_async_task(task_id)
else:
handle_sync_task(task_id)
```
#### Async Process Features
- Non-blocking task execution
- Parallel task processing
- Mixed sync/async task support
- Efficient resource utilization
- Async manager coordination (hierarchical)
- Dynamic task scheduling (workflow)
### LoopItems
A Pydantic model for handling loop data in workflow process.
#### Parameters
- `items: List[Any]` - List of items to be processed in a loop
## Process Types
### Sequential Process
- Tasks are executed one after another in a linear fashion
- Each task is completed before moving to the next one
- Simplest form of task execution
### Hierarchical Process
- Uses a manager agent to coordinate task execution
- Manager decides task order and agent assignments
- Provides more complex task orchestration
- Requires manager_llm parameter
- Supports dynamic agent assignment
### Workflow Process
- Supports complex task relationships
- Features:
- Task dependencies
- Conditional execution
- Loops
- Context sharing between tasks
- Maintains task state and relationships
- Handles data flow between tasks
-78
View File
@@ -1,78 +0,0 @@
---
title: "Task Module"
description: "Documentation for the praisonaiagents.task.task module"
icon: "list-check"
---
# Module praisonaiagents.task.task
## Classes
### Task
Represents a task to be executed by an agent.
#### Parameters
- `description: str` - Task description
- `expected_output: str` - Expected output description
- `agent: Agent | None = None` - Agent assigned to the task
- `name: str | None = None` - Task name
- `tools: List[Any] | None = None` - Tools available for the task
- `context: List[Task] | None = None` - Context from other tasks
- `async_execution: bool | None = False` - Enable async execution
- `config: Dict[str, Any] | None = None` - Task configuration
- `output_file: str | None = None` - Output file path
- `output_json: Type[BaseModel] | None = None` - JSON output schema
- `output_pydantic: Type[BaseModel] | None = None` - Pydantic output schema
- `callback: Any | None = None` - Task callback
- `status: str = 'not started'` - Task status
- `result: TaskOutput | None = None` - Task result
- `create_directory: bool | None = False` - Create output directory
- `id: int | None = None` - Task ID
- `images: List[str] | None = None` - Task images
- `next_tasks: List[str] | None = None` - Next tasks
- `task_type: str = 'task'` - Task type
- `condition: Dict[str, List[str]] | None = None` - Task conditions
- `is_start: bool = False` - Is start task
- `loop_state: Dict[str, str | int] | None = None` - Loop state
#### Async Support
The Task class supports asynchronous execution through the following features:
- `async_execution`: Boolean flag to enable async execution
- `callback`: Supports both sync and async callback functions
- `execute_callback`: Internal async method for handling callbacks
Example usage:
```python
from typing import Coroutine
from praisonaiagents import Task, TaskOutput
# Define an async callback
async def async_callback(output: TaskOutput):
await some_async_operation()
print(f"Processed: {output.raw}")
# Create task with async execution
task = Task(
description="Async task example",
expected_output="Async result",
async_execution=True, # Enable async execution
callback=async_callback # Async callback
)
```
#### Callback Types
The Task class supports both synchronous and asynchronous callbacks:
```python
# Type definition
callback: Optional[Union[
Callable[[TaskOutput], Any], # Sync callback
Callable[[TaskOutput], Coroutine[Any, Any, Any]] # Async callback
]]
```
#### Async Task States
- `not started`: Initial state
- `in progress`: Task is being executed
- `completed`: Task finished successfully
- `failed`: Task execution failed
-60
View File
@@ -1,60 +0,0 @@
---
title: "Auto Generation Mode"
description: "Guide to PraisonAI's automatic agent generation feature, supporting both CrewAI and AutoGen frameworks for automated task execution"
icon: "robot"
---
PraisonAI supports automatic agent generation with PraisonAI Agents, CrewAI and AutoGen frameworks.
## Installation
Choose your preferred framework:
```bash
# For PraisonAI Agents
pip install praisonai
# For CrewAI
pip install "praisonai[crewai]"
# For AutoGen
pip install "praisonai[autogen]"
# For both frameworks
pip install "praisonai[crewai,autogen]"
```
## Usage
### With PraisonAI Agents
```bash
praisonai --auto "create a movie script about Dog in Moon"
```
### With CrewAI
```bash
praisonai --framework crewai --auto "create a movie script about Dog in Moon"
```
### With AutoGen
```bash
praisonai --framework autogen --auto "create a movie script about Dog in Moon"
```
## Framework-specific Features
### CrewAI
- Task delegation capabilities
- Sequential and parallel task execution
- Built-in tools integration
- Structured agent-task relationships
### AutoGen
- Multi-agent conversation capabilities
- Code execution environment
- Built-in tools integration
- Flexible agent interactions
```bash
praisonai --auto "create a movie script about Dog in Moon"
```
-126
View File
@@ -1,126 +0,0 @@
---
title: "PraisonAI Call"
description: "Guide to PraisonAI's voice-based interaction feature enabling AI customer service through phone calls, including setup and tool integration"
icon: "phone"
---
<iframe width="560" height="315" src="https://www.youtube.com/embed/m1cwrUG2iAk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## AI Customer Service
PraisonAI Call is a feature that enables voice-based interaction with AI models through phone calls. This functionality allows users to have natural conversations with AI agents over traditional phone lines.
## Installation
### Step 1
```bash
pip install "praisonai[call]"
export OPENAI_API_KEY="enter your openai api key here"
export NGROK_AUTH_TOKEN="enter your ngrok auth token here"
praisonai call --public
```
### Step 2
Buy a number at [PraisonAI Dashboard](https://dashboard.praison.ai/)
### Step 3
Enter the Public URL in the PraisonAI Dashboard phone number field
## Features
- Make and receive phone calls with AI agents
- Natural language processing for voice interactions
- Support for multiple phone carriers and providers
- Call recording and transcription capabilities
- Integration with other PraisonAI features
## Adding Tools
1. Create a file called `tools.py`
2. Add the following code:
```python
import yfinance as yf
# Get Stock Price definition
get_stock_price_def = {
"name": "get_stock_price",
"description": "Get the current stock price for a given ticker symbol",
"parameters": {
"type": "object",
"properties": {
"ticker_symbol": {
"type": "string",
"description": "The ticker symbol of the stock (e.g., AAPL, GOOGL)"
}
},
"required": ["ticker_symbol"]
}
}
# Get Stock Price function / Tool
async def get_stock_price_handler(ticker_symbol):
try:
stock = yf.Ticker(ticker_symbol)
hist = stock.history(period="1d")
if hist.empty:
return {"error": f"No data found for ticker {ticker_symbol}"}
current_price = hist['Close'].iloc[-1] # Using -1 is safer than 0
return {"price": str(current_price)}
except Exception as e:
return {"error": str(e)}
get_stock_price = (get_stock_price_def, get_stock_price_handler)
tools = [
get_stock_price
]
```
3. ```bash
pip install yfinance
```
4. ```bash
export OPENAI_API_KEY="enter your openai api key here"
export NGROK_AUTH_TOKEN="enter your ngrok auth token here"
praisonai call --public
```
## Manage Google Calendar Events
See [Google Calendar Tools](tools/googlecalendar.md)
## Deploy
### Docker Deployment
```dockerfile
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install PraisonAI with the 'call' extra and ensure it's the latest version
RUN pip install --no-cache-dir --upgrade "praisonai[call]"
# Expose the port the app runs on
EXPOSE 8090
# Run the application
CMD ["praisonai", "call"]
```
-69
View File
@@ -1,69 +0,0 @@
---
title: Installation
description: Set up PraisonAI in your development environment
icon: download
---
<Note>
**Requirements**
- Python 3.10 or higher
- pip package manager
- Virtual environment (recommended)
</Note>
# Installing PraisonAI
Follow these steps to set up PraisonAI in your development environment.
<Steps>
<Step title="Create Virtual Environment (Optional)">
First, create and activate a virtual environment:
<CodeGroup>
```bash Mac/Linux
python -m venv praisonai-env
source praisonai-env/bin/activate
```
```bash Windows
python -m venv praisonai-env
.\praisonai-env\Scripts\activate
```
</CodeGroup>
</Step>
<Step title="Install PraisonAI">
Install the core package and tools:
```bash Terminal
pip install praisonaiagents
```
</Step>
<Step title="Configure Environment">
```bash Terminal
export OPENAI_API_KEY=your_openai_key
```
Generate your OpenAI API key from [OpenAI](https://platform.openai.com/api-keys)
You can also use other LLM providers like Anthropic, Google, etc. Please refer to the [Models](/models) for more information.
</Step>
</Steps>
## Next Steps
<CardGroup cols={2}>
<Card
title="Quick Start Guide"
icon="bolt"
href="/code/quickstart"
>
Build your first AI agent
</Card>
<Card
title="API Reference"
icon="code"
href="/api/praisonaiagents/index"
>
Explore the API documentation
</Card>
</CardGroup>
-188
View File
@@ -1,188 +0,0 @@
---
title: "Introduction"
description: "Welcome to PraisonAI - The Next Generation AI Agent Framework"
icon: "book-open"
---
<Note>
PraisonAI is a powerful framework for building and deploying AI agents that can understand, reason, and execute complex tasks autonomously.
</Note>
# What is PraisonAI?
```mermaid
graph LR
%% Define the main flow
Start([▶ Start]) --> Agent1
Agent1 --> Process[⚙ Process]
Process --> Agent2
Agent2 --> Output([✓ Output])
Process -.-> Agent1
%% Styling for main elements
style Start fill:#2D3047,stroke:#7C90A0,color:#fff
style Output fill:#2D3047,stroke:#7C90A0,color:#fff
style Process fill:#5C80BC,stroke:#7C90A0,color:#fff
%% Define subgraphs for agents and their tasks
subgraph Agent1[" "]
Task1[📋 Task]
AgentIcon1[🤖 AI Agent]
Tools1[🔧 Tools]
Task1 --- AgentIcon1
AgentIcon1 --- Tools1
style Task1 fill:#2D3047,stroke:#7C90A0,color:#fff
style AgentIcon1 fill:#5C80BC,stroke:#7C90A0,color:#fff
style Tools1 fill:#2D3047,stroke:#7C90A0,color:#fff
end
subgraph Agent2[" "]
Task2[📋 Task]
AgentIcon2[🤖 AI Agent]
Tools2[🔧 Tools]
Task2 --- AgentIcon2
AgentIcon2 --- Tools2
style Task2 fill:#2D3047,stroke:#7C90A0,color:#fff
style AgentIcon2 fill:#5C80BC,stroke:#7C90A0,color:#fff
style Tools2 fill:#2D3047,stroke:#7C90A0,color:#fff
end
%% Style for agent containers
style Agent1 fill:#1B1F3B,stroke:#7C90A0,color:#fff
style Agent2 fill:#1B1F3B,stroke:#7C90A0,color:#fff
%% Global styles
classDef default fill:#2D3047,stroke:#7C90A0,color:#fff
linkStyle default stroke:#7C90A0,stroke-width:2px
```
## Core Components
<CardGroup cols={2}>
<Card title="Agents" icon="user-robot">
Autonomous AI entities that can understand context and execute tasks
</Card>
<Card title="Tasks" icon="list-check">
Units of work that agents can execute independently or collaboratively
</Card>
<Card title="Process" icon="diagram-project">
Workflow management for coordinating agent activities
</Card>
<Card title="Tools" icon="toolbox">
Extensible capabilities that agents can leverage
</Card>
</CardGroup>
## Key Features
<Steps>
<Step title="Autonomous Agents">
Create intelligent agents that can:
- Understand natural language instructions
- Make decisions based on context
- Execute complex tasks autonomously
</Step>
<Step title="Flexible Architecture">
Build with:
- Modular components
- Extensible tools
- Customizable workflows
</Step>
<Step title="Advanced Capabilities">
Leverage:
- Multi-agent collaboration
- Memory and context management
- Tool integration
</Step>
</Steps>
## Use Cases
<CardGroup cols={2}>
<Card title="Customer Service" icon="headset">
Build intelligent support agents that can handle customer inquiries and resolve issues autonomously.
</Card>
<Card title="Data Analysis" icon="chart-line">
Create agents that can process, analyze, and derive insights from complex datasets.
</Card>
<Card title="Content Creation" icon="pen-nib">
Deploy agents that can generate, edit, and optimize content across various formats.
</Card>
<Card title="Process Automation" icon="gears">
Automate complex workflows with intelligent agents that can coordinate and execute tasks.
</Card>
</CardGroup>
## Getting Started
<Warning>
Before proceeding, ensure you have Python 3.9+ installed on your system.
</Warning>
### Quick Setup
<CodeGroup>
```bash pip
pip install praisonai
```
</CodeGroup>
### Basic Example
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
# Create an agent
researcher = Agent(
name="Researcher",
role="Senior Research Analyst",
goal="Uncover cutting-edge developments in AI",
backstory="You are an expert at a technology research group",
verbose=True,
llm="gpt-4o"
)
# Define a task
task = Task(
name="research_task",
description="Analyze 2024's AI advancements",
expected_output="A detailed report",
agent=researcher
)
# Run the agents
agents = PraisonAIAgents(
agents=[researcher],
tasks=[task],
verbose=False
)
result = agents.start()
```
## Next Steps
<CardGroup cols={2}>
<Card
title="Installation"
icon="download"
href="/code/installation"
>
Complete installation guide and setup instructions
</Card>
<Card
title="Quick Start"
icon="play"
href="/code/quickstart"
>
Build your first AI agent in minutes
</Card>
</CardGroup>
<Tip>
Join our community on [Discord](https://www.youtube.com/redirect?event=channel_description&redir_token=QUFFLUhqbUpiZE00YlF1MjB1LVNIeTFxTnV6MWRRc18wZ3xBQ3Jtc0ttQVZ0aFJ4RXRDanlBQU1Vd3lHU3BBcml3bzhoek1pTmlkZkFkWjlNVDBpRkxZd1dTOWhPc20xbHJOb1NibmNYeTEydklJT0pZOVJFQW93MmJOQXU0WkJNVzNsd29SZ3FBNFVwMTFGNThNSHBWVUhjSQ&q=https%3A%2F%2Fdiscord.gg%2FnNZu5gGT59) to connect with other developers and get help!
</Tip>
Loaded 100 of 3612 files, more files were not shown because too many files have changed in this diff. Show more