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