-
-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f438de
commit 3cda162
Showing
8 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from praisonai import PraisonAI | ||
|
||
def advanced(): | ||
praison_ai = PraisonAI( | ||
agent_file="agents.yaml", | ||
framework="autogen", | ||
) | ||
praison_ai.main() | ||
|
||
if __name__ == "__main__": | ||
advanced() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
framework: "crewai" | ||
topic: "Artificial Intelligence" | ||
|
||
roles: | ||
narrative_designer: | ||
role: "Narrative Designer" | ||
goal: "Craft engaging storylines and narratives for {topic}" | ||
backstory: > | ||
You're a creative visionary skilled in weaving complex narratives and | ||
developing engaging story worlds within {topic}. Your expertise lies in | ||
conceptualizing the overarching story and ensuring it resonates with the audience. | ||
tasks: | ||
story_concept_development: | ||
description: > | ||
Develop a compelling story concept for {topic}, focusing on originality, | ||
thematic depth, and audience engagement. Outline the main narrative arcs, | ||
characters, and settings. | ||
expected_output: > | ||
A comprehensive document outlining the story concept, including key narrative | ||
arcs, character bios, and settings descriptions. | ||
scriptwriter: | ||
role: "Scriptwriter" | ||
goal: "Transform story concepts into detailed scripts for {topic}" | ||
backstory: > | ||
With a flair for dialogue and a deep understanding of pacing and structure, | ||
you excel at bringing narratives to life through scriptwriting. Your work | ||
turns story concepts into blueprints for compelling {topic} experiences. | ||
tasks: | ||
scriptwriting_task: | ||
description: > | ||
Based on the narrative concept, write a detailed script for {topic}. | ||
Include dialogue, stage directions, and scene descriptions that bring | ||
the story to life. | ||
expected_output: > | ||
A detailed script ready for production, including dialogue, stage | ||
directions, and scene descriptions. | ||
dependencies: | ||
- task: scriptwriting_task | ||
depends_on: story_concept_development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from praisonai import PraisonAI | ||
|
||
def auto(): | ||
praison_ai = PraisonAI( | ||
auto="Create a movie script about car in mars", | ||
framework="autogen" | ||
) | ||
print(praison_ai.framework) | ||
praison_ai.main() | ||
|
||
if __name__ == "__main__": | ||
auto() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from praisonai import PraisonAI | ||
|
||
def main(): | ||
praison_ai = PraisonAI(agent_file="agents.yaml") | ||
praison_ai.main() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,41 @@ | ||
# tests/test.py | ||
import unittest | ||
from praisonai.cli import generate_crew_and_kickoff | ||
# from .debug import * # Uncomment this line to import the debug.py file for debugging | ||
import unittest | ||
import os | ||
from praisonai.cli import PraisonAI | ||
from .advanced_example import advanced | ||
from .basic_example import main | ||
from .auto_example import auto | ||
|
||
class TestGenerateCrewAndKickoff(unittest.TestCase): | ||
def test_generate_crew_and_kickoff_with_autogen_framework(self): | ||
result = generate_crew_and_kickoff('tests/autogen-agents.yaml') | ||
praison_ai = PraisonAI(agent_file='tests/autogen-agents.yaml') | ||
result = praison_ai.generate_crew_and_kickoff() | ||
# Assert the result | ||
self.assertIn('### Output ###', result) | ||
|
||
def test_generate_crew_and_kickoff_with_custom_framework(self): | ||
result = generate_crew_and_kickoff('tests/crewai-agents.yaml') | ||
praison_ai = PraisonAI(agent_file='tests/crewai-agents.yaml') | ||
result = praison_ai.generate_crew_and_kickoff() | ||
# Assert the result | ||
self.assertIn('### Output ###', result) | ||
class TestPraisonAICommand(unittest.TestCase): | ||
def test_praisonai_command(self): | ||
command = "praisonai --framework autogen --auto create movie script about cat in mars" | ||
result = os.popen(command).read() | ||
self.assertIn('Task output', result) | ||
|
||
class TestBasicExample(unittest.TestCase): | ||
def test_basic_example(self): | ||
main() | ||
|
||
class TestAdvancedExample(unittest.TestCase): | ||
def test_advanced_example(self): | ||
advanced() | ||
|
||
class TestAutoExample(unittest.TestCase): | ||
def test_auto_example(self): | ||
auto() | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |