praisonAI 2.3.26__tar.gz → 2.3.27__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. {praisonai-2.3.26 → praisonai-2.3.27}/PKG-INFO +114 -3
  2. {praisonai-2.3.26 → praisonai-2.3.27}/PraisonAI.egg-info/PKG-INFO +114 -3
  3. {praisonai-2.3.26 → praisonai-2.3.27}/PraisonAI.egg-info/requires.txt +1 -1
  4. {praisonai-2.3.26 → praisonai-2.3.27}/README.md +112 -1
  5. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/workflow.py +2 -2
  6. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/main.py +75 -0
  7. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/deploy.py +1 -1
  8. praisonai-2.3.27/praisonai/version.py +1 -0
  9. {praisonai-2.3.26 → praisonai-2.3.27}/pyproject.toml +1 -1
  10. praisonai-2.3.26/praisonai/version.py +0 -1
  11. {praisonai-2.3.26 → praisonai-2.3.27}/PraisonAI.egg-info/SOURCES.txt +0 -0
  12. {praisonai-2.3.26 → praisonai-2.3.27}/PraisonAI.egg-info/dependency_links.txt +0 -0
  13. {praisonai-2.3.26 → praisonai-2.3.27}/PraisonAI.egg-info/entry_points.txt +0 -0
  14. {praisonai-2.3.26 → praisonai-2.3.27}/PraisonAI.egg-info/top_level.txt +0 -0
  15. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/__init__.py +0 -0
  16. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/__main__.py +0 -0
  17. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/agents_generator.py +0 -0
  18. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/api/call.py +0 -0
  19. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/auto.py +0 -0
  20. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/chainlit_ui.py +0 -0
  21. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/__init__.py +0 -0
  22. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/__init__.py +0 -0
  23. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/auto_memory.py +0 -0
  24. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/base.py +0 -0
  25. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/fast_context.py +0 -0
  26. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/flow_display.py +0 -0
  27. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/guardrail.py +0 -0
  28. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/handoff.py +0 -0
  29. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/image.py +0 -0
  30. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/knowledge.py +0 -0
  31. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/mcp.py +0 -0
  32. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/metrics.py +0 -0
  33. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/router.py +0 -0
  34. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/session.py +0 -0
  35. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/telemetry.py +0 -0
  36. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/todo.py +0 -0
  37. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/cli/features/tools.py +0 -0
  38. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/inbuilt_tools/__init__.py +0 -0
  39. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
  40. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/inc/__init__.py +0 -0
  41. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/inc/config.py +0 -0
  42. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/inc/models.py +0 -0
  43. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/scheduler.py +0 -0
  44. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/setup/__init__.py +0 -0
  45. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/setup/build.py +0 -0
  46. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/setup/post_install.py +0 -0
  47. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/setup/setup_conda_env.py +0 -0
  48. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/setup.py +0 -0
  49. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/test.py +0 -0
  50. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/train.py +0 -0
  51. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/train_vision.py +0 -0
  52. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/agents.py +0 -0
  53. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/callbacks.py +0 -0
  54. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/chat.py +0 -0
  55. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/code.py +0 -0
  56. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/colab.py +0 -0
  57. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/colab_chainlit.py +0 -0
  58. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/components/aicoder.py +0 -0
  59. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/context.py +0 -0
  60. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/database_config.py +0 -0
  61. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/db.py +0 -0
  62. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/realtime.py +0 -0
  63. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/realtimeclient/__init__.py +0 -0
  64. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/realtimeclient/tools.py +0 -0
  65. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/ui/sql_alchemy.py +0 -0
  66. {praisonai-2.3.26 → praisonai-2.3.27}/praisonai/upload_vision.py +0 -0
  67. {praisonai-2.3.26 → praisonai-2.3.27}/setup.cfg +0 -0
  68. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test.py +0 -0
  69. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_agents_playbook.py +0 -0
  70. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_basic.py +0 -0
  71. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_cli_features.py +0 -0
  72. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_custom_tools_fix.py +0 -0
  73. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_double_api_fix.py +0 -0
  74. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_phase2_refactor.py +0 -0
  75. {praisonai-2.3.26 → praisonai-2.3.27}/tests/test_runner.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PraisonAI
3
- Version: 2.3.26
3
+ Version: 2.3.27
4
4
  Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
5
5
  Author: Mervin Praison
6
6
  License: MIT
@@ -11,7 +11,7 @@ Description-Content-Type: text/markdown
11
11
  Requires-Dist: rich>=13.7
12
12
  Requires-Dist: markdown>=3.5
13
13
  Requires-Dist: pyparsing>=3.0.0
14
- Requires-Dist: praisonaiagents>=0.1.4
14
+ Requires-Dist: praisonaiagents>=0.1.5
15
15
  Requires-Dist: python-dotenv>=0.19.0
16
16
  Requires-Dist: instructor>=1.3.3
17
17
  Requires-Dist: PyYAML>=6.0
@@ -702,6 +702,77 @@ result = manager.execute_yaml(
702
702
  )
703
703
  ```
704
704
 
705
+ ### Complete workflow.yaml Reference
706
+
707
+ ```yaml
708
+ # workflow.yaml - Full feature reference
709
+ name: Complete Workflow
710
+ description: Demonstrates all workflow.yaml features
711
+ framework: praisonai # praisonai, crewai, autogen
712
+ process: workflow # sequential, hierarchical, workflow
713
+
714
+ workflow:
715
+ planning: true
716
+ planning_llm: gpt-4o
717
+ reasoning: true
718
+ verbose: true
719
+ memory_config:
720
+ provider: chroma
721
+ persist: true
722
+
723
+ variables:
724
+ topic: AI trends
725
+ items: [ML, NLP, Vision]
726
+
727
+ agents:
728
+ researcher:
729
+ name: Researcher
730
+ role: Research Analyst
731
+ goal: Research topics thoroughly
732
+ instructions: "Provide detailed research findings"
733
+ backstory: "Expert researcher with 10 years experience" # alias for instructions
734
+ llm: gpt-4o-mini
735
+ function_calling_llm: gpt-4o # For tool calls
736
+ max_rpm: 10 # Rate limiting
737
+ max_execution_time: 300 # Timeout in seconds
738
+ reflect_llm: gpt-4o # For self-reflection
739
+ min_reflect: 1
740
+ max_reflect: 3
741
+ system_template: "You are a helpful assistant"
742
+ tools:
743
+ - tavily_search
744
+
745
+ writer:
746
+ name: Writer
747
+ role: Content Writer
748
+ goal: Write clear content
749
+ instructions: "Write engaging content"
750
+
751
+ steps:
752
+ - name: research_step
753
+ agent: researcher
754
+ action: "Research {{topic}}"
755
+ expected_output: "Comprehensive research report"
756
+ output_file: "output/research.md"
757
+ create_directory: true
758
+
759
+ - name: writing_step
760
+ agent: writer
761
+ action: "Write article based on research"
762
+ context: # Task dependencies
763
+ - research_step
764
+ output_json: # Structured output
765
+ type: object
766
+ properties:
767
+ title: { type: string }
768
+ content: { type: string }
769
+
770
+ callbacks:
771
+ on_workflow_start: log_start
772
+ on_step_complete: log_step
773
+ on_workflow_complete: log_complete
774
+ ```
775
+
705
776
  ### 9. Hooks
706
777
 
707
778
  Configure in `.praison/hooks.json`:
@@ -720,7 +791,14 @@ result = hooks.execute("pre_write_code", {"file": "main.py"})
720
791
 
721
792
  ### 10. Extended agents.yaml with Workflow Patterns
722
793
 
723
- You can now use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
794
+ **Feature Parity:** Both `agents.yaml` and `workflow.yaml` now support the same features:
795
+ - All workflow patterns (route, parallel, loop, repeat)
796
+ - All agent fields (function_calling_llm, max_rpm, max_execution_time, reflect_llm, templates)
797
+ - All step fields (expected_output, context, output_json, create_directory, callback)
798
+ - Framework support (praisonai, crewai, autogen)
799
+ - Process types (sequential, hierarchical, workflow)
800
+
801
+ You can use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
724
802
 
725
803
  ```yaml
726
804
  # agents.yaml with workflow patterns
@@ -936,10 +1014,43 @@ praisonai "GPT-5" --workflow "Research:Search for info,Write:Write blog" --tools
936
1014
  praisonai workflow help
937
1015
  ```
938
1016
 
1017
+ #### YAML Workflow Files:
1018
+ ```bash
1019
+ # Run a YAML workflow file
1020
+ praisonai workflow run research.yaml
1021
+
1022
+ # Run with variables
1023
+ praisonai workflow run research.yaml --var topic="AI trends"
1024
+
1025
+ # Validate a YAML workflow
1026
+ praisonai workflow validate research.yaml
1027
+
1028
+ # Create from template (simple, routing, parallel, loop, evaluator-optimizer)
1029
+ praisonai workflow template routing --output my_workflow.yaml
1030
+ ```
1031
+
1032
+ #### Auto-Generate Workflows:
1033
+ ```bash
1034
+ # Auto-generate a sequential workflow from topic
1035
+ praisonai workflow auto "Research AI trends"
1036
+
1037
+ # Generate parallel workflow (multiple agents work concurrently)
1038
+ praisonai workflow auto "Research AI trends" --pattern parallel
1039
+
1040
+ # Generate routing workflow (classifier routes to specialists)
1041
+ praisonai workflow auto "Build a chatbot" --pattern routing
1042
+
1043
+ # Specify output file
1044
+ praisonai workflow auto "Research AI" --pattern sequential --output my_workflow.yaml
1045
+ ```
1046
+
939
1047
  **Workflow CLI Options:**
940
1048
  | Flag | Description |
941
1049
  |------|-------------|
942
1050
  | `--workflow-var key=value` | Set workflow variable (can be repeated) |
1051
+ | `--var key=value` | Set variable for YAML workflows |
1052
+ | `--pattern <pattern>` | Pattern for auto-generation (sequential, parallel, routing, loop) |
1053
+ | `--output <file>` | Output file for auto-generation |
943
1054
  | `--llm <model>` | LLM model (e.g., openai/gpt-4o-mini) |
944
1055
  | `--tools <tools>` | Tools (comma-separated, e.g., tavily) |
945
1056
  | `--planning` | Enable planning mode |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PraisonAI
3
- Version: 2.3.26
3
+ Version: 2.3.27
4
4
  Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
5
5
  Author: Mervin Praison
6
6
  License: MIT
@@ -11,7 +11,7 @@ Description-Content-Type: text/markdown
11
11
  Requires-Dist: rich>=13.7
12
12
  Requires-Dist: markdown>=3.5
13
13
  Requires-Dist: pyparsing>=3.0.0
14
- Requires-Dist: praisonaiagents>=0.1.4
14
+ Requires-Dist: praisonaiagents>=0.1.5
15
15
  Requires-Dist: python-dotenv>=0.19.0
16
16
  Requires-Dist: instructor>=1.3.3
17
17
  Requires-Dist: PyYAML>=6.0
@@ -702,6 +702,77 @@ result = manager.execute_yaml(
702
702
  )
703
703
  ```
704
704
 
705
+ ### Complete workflow.yaml Reference
706
+
707
+ ```yaml
708
+ # workflow.yaml - Full feature reference
709
+ name: Complete Workflow
710
+ description: Demonstrates all workflow.yaml features
711
+ framework: praisonai # praisonai, crewai, autogen
712
+ process: workflow # sequential, hierarchical, workflow
713
+
714
+ workflow:
715
+ planning: true
716
+ planning_llm: gpt-4o
717
+ reasoning: true
718
+ verbose: true
719
+ memory_config:
720
+ provider: chroma
721
+ persist: true
722
+
723
+ variables:
724
+ topic: AI trends
725
+ items: [ML, NLP, Vision]
726
+
727
+ agents:
728
+ researcher:
729
+ name: Researcher
730
+ role: Research Analyst
731
+ goal: Research topics thoroughly
732
+ instructions: "Provide detailed research findings"
733
+ backstory: "Expert researcher with 10 years experience" # alias for instructions
734
+ llm: gpt-4o-mini
735
+ function_calling_llm: gpt-4o # For tool calls
736
+ max_rpm: 10 # Rate limiting
737
+ max_execution_time: 300 # Timeout in seconds
738
+ reflect_llm: gpt-4o # For self-reflection
739
+ min_reflect: 1
740
+ max_reflect: 3
741
+ system_template: "You are a helpful assistant"
742
+ tools:
743
+ - tavily_search
744
+
745
+ writer:
746
+ name: Writer
747
+ role: Content Writer
748
+ goal: Write clear content
749
+ instructions: "Write engaging content"
750
+
751
+ steps:
752
+ - name: research_step
753
+ agent: researcher
754
+ action: "Research {{topic}}"
755
+ expected_output: "Comprehensive research report"
756
+ output_file: "output/research.md"
757
+ create_directory: true
758
+
759
+ - name: writing_step
760
+ agent: writer
761
+ action: "Write article based on research"
762
+ context: # Task dependencies
763
+ - research_step
764
+ output_json: # Structured output
765
+ type: object
766
+ properties:
767
+ title: { type: string }
768
+ content: { type: string }
769
+
770
+ callbacks:
771
+ on_workflow_start: log_start
772
+ on_step_complete: log_step
773
+ on_workflow_complete: log_complete
774
+ ```
775
+
705
776
  ### 9. Hooks
706
777
 
707
778
  Configure in `.praison/hooks.json`:
@@ -720,7 +791,14 @@ result = hooks.execute("pre_write_code", {"file": "main.py"})
720
791
 
721
792
  ### 10. Extended agents.yaml with Workflow Patterns
722
793
 
723
- You can now use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
794
+ **Feature Parity:** Both `agents.yaml` and `workflow.yaml` now support the same features:
795
+ - All workflow patterns (route, parallel, loop, repeat)
796
+ - All agent fields (function_calling_llm, max_rpm, max_execution_time, reflect_llm, templates)
797
+ - All step fields (expected_output, context, output_json, create_directory, callback)
798
+ - Framework support (praisonai, crewai, autogen)
799
+ - Process types (sequential, hierarchical, workflow)
800
+
801
+ You can use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
724
802
 
725
803
  ```yaml
726
804
  # agents.yaml with workflow patterns
@@ -936,10 +1014,43 @@ praisonai "GPT-5" --workflow "Research:Search for info,Write:Write blog" --tools
936
1014
  praisonai workflow help
937
1015
  ```
938
1016
 
1017
+ #### YAML Workflow Files:
1018
+ ```bash
1019
+ # Run a YAML workflow file
1020
+ praisonai workflow run research.yaml
1021
+
1022
+ # Run with variables
1023
+ praisonai workflow run research.yaml --var topic="AI trends"
1024
+
1025
+ # Validate a YAML workflow
1026
+ praisonai workflow validate research.yaml
1027
+
1028
+ # Create from template (simple, routing, parallel, loop, evaluator-optimizer)
1029
+ praisonai workflow template routing --output my_workflow.yaml
1030
+ ```
1031
+
1032
+ #### Auto-Generate Workflows:
1033
+ ```bash
1034
+ # Auto-generate a sequential workflow from topic
1035
+ praisonai workflow auto "Research AI trends"
1036
+
1037
+ # Generate parallel workflow (multiple agents work concurrently)
1038
+ praisonai workflow auto "Research AI trends" --pattern parallel
1039
+
1040
+ # Generate routing workflow (classifier routes to specialists)
1041
+ praisonai workflow auto "Build a chatbot" --pattern routing
1042
+
1043
+ # Specify output file
1044
+ praisonai workflow auto "Research AI" --pattern sequential --output my_workflow.yaml
1045
+ ```
1046
+
939
1047
  **Workflow CLI Options:**
940
1048
  | Flag | Description |
941
1049
  |------|-------------|
942
1050
  | `--workflow-var key=value` | Set workflow variable (can be repeated) |
1051
+ | `--var key=value` | Set variable for YAML workflows |
1052
+ | `--pattern <pattern>` | Pattern for auto-generation (sequential, parallel, routing, loop) |
1053
+ | `--output <file>` | Output file for auto-generation |
943
1054
  | `--llm <model>` | LLM model (e.g., openai/gpt-4o-mini) |
944
1055
  | `--tools <tools>` | Tools (comma-separated, e.g., tavily) |
945
1056
  | `--planning` | Enable planning mode |
@@ -1,7 +1,7 @@
1
1
  rich>=13.7
2
2
  markdown>=3.5
3
3
  pyparsing>=3.0.0
4
- praisonaiagents>=0.1.4
4
+ praisonaiagents>=0.1.5
5
5
  python-dotenv>=0.19.0
6
6
  instructor>=1.3.3
7
7
  PyYAML>=6.0
@@ -605,6 +605,77 @@ result = manager.execute_yaml(
605
605
  )
606
606
  ```
607
607
 
608
+ ### Complete workflow.yaml Reference
609
+
610
+ ```yaml
611
+ # workflow.yaml - Full feature reference
612
+ name: Complete Workflow
613
+ description: Demonstrates all workflow.yaml features
614
+ framework: praisonai # praisonai, crewai, autogen
615
+ process: workflow # sequential, hierarchical, workflow
616
+
617
+ workflow:
618
+ planning: true
619
+ planning_llm: gpt-4o
620
+ reasoning: true
621
+ verbose: true
622
+ memory_config:
623
+ provider: chroma
624
+ persist: true
625
+
626
+ variables:
627
+ topic: AI trends
628
+ items: [ML, NLP, Vision]
629
+
630
+ agents:
631
+ researcher:
632
+ name: Researcher
633
+ role: Research Analyst
634
+ goal: Research topics thoroughly
635
+ instructions: "Provide detailed research findings"
636
+ backstory: "Expert researcher with 10 years experience" # alias for instructions
637
+ llm: gpt-4o-mini
638
+ function_calling_llm: gpt-4o # For tool calls
639
+ max_rpm: 10 # Rate limiting
640
+ max_execution_time: 300 # Timeout in seconds
641
+ reflect_llm: gpt-4o # For self-reflection
642
+ min_reflect: 1
643
+ max_reflect: 3
644
+ system_template: "You are a helpful assistant"
645
+ tools:
646
+ - tavily_search
647
+
648
+ writer:
649
+ name: Writer
650
+ role: Content Writer
651
+ goal: Write clear content
652
+ instructions: "Write engaging content"
653
+
654
+ steps:
655
+ - name: research_step
656
+ agent: researcher
657
+ action: "Research {{topic}}"
658
+ expected_output: "Comprehensive research report"
659
+ output_file: "output/research.md"
660
+ create_directory: true
661
+
662
+ - name: writing_step
663
+ agent: writer
664
+ action: "Write article based on research"
665
+ context: # Task dependencies
666
+ - research_step
667
+ output_json: # Structured output
668
+ type: object
669
+ properties:
670
+ title: { type: string }
671
+ content: { type: string }
672
+
673
+ callbacks:
674
+ on_workflow_start: log_start
675
+ on_step_complete: log_step
676
+ on_workflow_complete: log_complete
677
+ ```
678
+
608
679
  ### 9. Hooks
609
680
 
610
681
  Configure in `.praison/hooks.json`:
@@ -623,7 +694,14 @@ result = hooks.execute("pre_write_code", {"file": "main.py"})
623
694
 
624
695
  ### 10. Extended agents.yaml with Workflow Patterns
625
696
 
626
- You can now use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
697
+ **Feature Parity:** Both `agents.yaml` and `workflow.yaml` now support the same features:
698
+ - All workflow patterns (route, parallel, loop, repeat)
699
+ - All agent fields (function_calling_llm, max_rpm, max_execution_time, reflect_llm, templates)
700
+ - All step fields (expected_output, context, output_json, create_directory, callback)
701
+ - Framework support (praisonai, crewai, autogen)
702
+ - Process types (sequential, hierarchical, workflow)
703
+
704
+ You can use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
627
705
 
628
706
  ```yaml
629
707
  # agents.yaml with workflow patterns
@@ -839,10 +917,43 @@ praisonai "GPT-5" --workflow "Research:Search for info,Write:Write blog" --tools
839
917
  praisonai workflow help
840
918
  ```
841
919
 
920
+ #### YAML Workflow Files:
921
+ ```bash
922
+ # Run a YAML workflow file
923
+ praisonai workflow run research.yaml
924
+
925
+ # Run with variables
926
+ praisonai workflow run research.yaml --var topic="AI trends"
927
+
928
+ # Validate a YAML workflow
929
+ praisonai workflow validate research.yaml
930
+
931
+ # Create from template (simple, routing, parallel, loop, evaluator-optimizer)
932
+ praisonai workflow template routing --output my_workflow.yaml
933
+ ```
934
+
935
+ #### Auto-Generate Workflows:
936
+ ```bash
937
+ # Auto-generate a sequential workflow from topic
938
+ praisonai workflow auto "Research AI trends"
939
+
940
+ # Generate parallel workflow (multiple agents work concurrently)
941
+ praisonai workflow auto "Research AI trends" --pattern parallel
942
+
943
+ # Generate routing workflow (classifier routes to specialists)
944
+ praisonai workflow auto "Build a chatbot" --pattern routing
945
+
946
+ # Specify output file
947
+ praisonai workflow auto "Research AI" --pattern sequential --output my_workflow.yaml
948
+ ```
949
+
842
950
  **Workflow CLI Options:**
843
951
  | Flag | Description |
844
952
  |------|-------------|
845
953
  | `--workflow-var key=value` | Set workflow variable (can be repeated) |
954
+ | `--var key=value` | Set variable for YAML workflows |
955
+ | `--pattern <pattern>` | Pattern for auto-generation (sequential, parallel, routing, loop) |
956
+ | `--output <file>` | Output file for auto-generation |
846
957
  | `--llm <model>` | LLM model (e.g., openai/gpt-4o-mini) |
847
958
  | `--tools <tools>` | Tools (comma-separated, e.g., tavily) |
848
959
  | `--planning` | Enable planning mode |
@@ -567,8 +567,8 @@ Example:
567
567
 
568
568
  return result_path
569
569
 
570
- except ImportError as e:
571
- self.print_status(f"Auto-generation requires instructor: pip install instructor", "error")
570
+ except ImportError:
571
+ self.print_status("Auto-generation requires instructor: pip install instructor", "error")
572
572
  return None
573
573
  except Exception as e:
574
574
  self.print_status(f"Generation failed: {e}", "error")
@@ -1632,6 +1632,10 @@ class PraisonAI:
1632
1632
  if arg == '--output' and i + 1 < len(action_args):
1633
1633
  output_file = action_args[i + 1]
1634
1634
  self._create_workflow_from_template(template_name, output_file)
1635
+
1636
+ elif action == 'auto':
1637
+ # Auto-generate workflow from topic
1638
+ self._auto_generate_workflow(action_args)
1635
1639
 
1636
1640
  elif action == 'help' or action == '--help':
1637
1641
  print("[bold]Workflow Commands:[/bold]")
@@ -1642,6 +1646,7 @@ class PraisonAI:
1642
1646
  print(" praisonai workflow create <name> - Create a new workflow")
1643
1647
  print(" praisonai workflow validate <file.yaml> - Validate a YAML workflow")
1644
1648
  print(" praisonai workflow template <name> - Create from template")
1649
+ print(' praisonai workflow auto "topic" - Auto-generate workflow')
1645
1650
  print("\n[bold]Templates:[/bold]")
1646
1651
  print(" simple, routing, parallel, loop, evaluator-optimizer")
1647
1652
  print("\n[bold]Options (uses global flags):[/bold]")
@@ -1839,6 +1844,76 @@ class PraisonAI:
1839
1844
  print(f"[green]✓ Created workflow: {output_file}[/green]")
1840
1845
  print(f"[cyan]Run with: praisonai workflow run {output_file}[/cyan]")
1841
1846
 
1847
+ def _auto_generate_workflow(self, action_args: list):
1848
+ """
1849
+ Auto-generate a workflow from a topic description.
1850
+
1851
+ Args:
1852
+ action_args: ["topic description", --pattern, <pattern>, --output, <file.yaml>]
1853
+ """
1854
+ from rich import print
1855
+
1856
+ # Parse arguments
1857
+ topic = None
1858
+ pattern = "sequential"
1859
+ output_file = None
1860
+
1861
+ i = 0
1862
+ while i < len(action_args):
1863
+ if action_args[i] == "--pattern" and i + 1 < len(action_args):
1864
+ pattern = action_args[i + 1]
1865
+ i += 2
1866
+ elif action_args[i] == "--output" and i + 1 < len(action_args):
1867
+ output_file = action_args[i + 1]
1868
+ i += 2
1869
+ elif not action_args[i].startswith("--") and topic is None:
1870
+ topic = action_args[i]
1871
+ i += 1
1872
+ else:
1873
+ i += 1
1874
+
1875
+ if not topic:
1876
+ print('[red]Usage: praisonai workflow auto "topic" --pattern <pattern>[/red]')
1877
+ print("[cyan]Patterns: sequential, routing, parallel[/cyan]")
1878
+ return
1879
+
1880
+ # Validate pattern
1881
+ valid_patterns = ["sequential", "routing", "parallel", "loop"]
1882
+ if pattern not in valid_patterns:
1883
+ print(f"[red]Unknown pattern: {pattern}[/red]")
1884
+ print(f"[cyan]Valid patterns: {', '.join(valid_patterns)}[/cyan]")
1885
+ return
1886
+
1887
+ # Default output file
1888
+ if not output_file:
1889
+ safe_name = "".join(c if c.isalnum() else "_" for c in topic[:30]).lower()
1890
+ output_file = f"{safe_name}_workflow.yaml"
1891
+
1892
+ # Check if file exists
1893
+ if os.path.exists(output_file):
1894
+ print(f"[red]ERROR: File already exists: {output_file}[/red]")
1895
+ return
1896
+
1897
+ print(f"[cyan]Generating {pattern} workflow for: {topic}[/cyan]")
1898
+
1899
+ try:
1900
+ from praisonai.auto import WorkflowAutoGenerator
1901
+
1902
+ generator = WorkflowAutoGenerator(
1903
+ topic=topic,
1904
+ workflow_file=output_file
1905
+ )
1906
+
1907
+ result_path = generator.generate(pattern=pattern)
1908
+
1909
+ print(f"[green]✓ Created workflow: {result_path}[/green]")
1910
+ print(f"[cyan]Run with: praisonai workflow run {output_file}[/cyan]")
1911
+
1912
+ except ImportError:
1913
+ print("[red]Auto-generation requires instructor: pip install instructor[/red]")
1914
+ except Exception as e:
1915
+ print(f"[red]Generation failed: {e}[/red]")
1916
+
1842
1917
  def handle_hooks_command(self, action: str):
1843
1918
  """
1844
1919
  Handle hooks subcommand actions.
@@ -57,7 +57,7 @@ class CloudDeployer:
57
57
  file.write("FROM python:3.11-slim\n")
58
58
  file.write("WORKDIR /app\n")
59
59
  file.write("COPY . .\n")
60
- file.write("RUN pip install flask praisonai==2.3.26 gunicorn markdown\n")
60
+ file.write("RUN pip install flask praisonai==2.3.27 gunicorn markdown\n")
61
61
  file.write("EXPOSE 8080\n")
62
62
  file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
63
63
 
@@ -0,0 +1 @@
1
+ __version__ = "2.3.27"
@@ -12,7 +12,7 @@ dependencies = [
12
12
  "rich>=13.7",
13
13
  "markdown>=3.5",
14
14
  "pyparsing>=3.0.0",
15
- "praisonaiagents>=0.1.4",
15
+ "praisonaiagents>=0.1.5",
16
16
  "python-dotenv>=0.19.0",
17
17
  "instructor>=1.3.3",
18
18
  "PyYAML>=6.0",
@@ -1 +0,0 @@
1
- __version__ = "2.3.26"
File without changes
File without changes
File without changes
File without changes