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