Skip to content

Commit b0fadb5

Browse files
Merge pull request #72 from MervinPraison/develop
v0.0.41 Adding Additional Params on CrewAI Task
2 parents 3d0057f + c0bb48c commit b0fadb5

File tree

9 files changed

+56
-5
lines changed

9 files changed

+56
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ praisonai_prompt.txt
1818
watch.sh
1919
docs.sh
2020
other
21+
output
2122

2223
.chainlit
2324
.files

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-slim
22
WORKDIR /app
33
COPY . .
4-
RUN pip install flask praisonai==0.0.40 gunicorn markdown
4+
RUN pip install flask praisonai==0.0.41 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

agents-advanced.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ roles:
2323
description: Gather and analyze data on the causes and risk factors of lung
2424
diseases.
2525
expected_output: Report detailing key findings on lung disease causes.
26+
config:
27+
max_iter: 5
28+
output_file: "output/data_analysis.txt"
2629
tools:
2730
- 'InternetSearchTool'
2831
medical_writer:
@@ -40,6 +43,9 @@ roles:
4043
lung disease causes.
4144
expected_output: Document outlining various causes and risk factors of lung
4245
diseases.
46+
async_execution: True
47+
output_file: "output/medical_writer.txt"
48+
create_directory:
4349
tools:
4450
- ''
4551
editor:
@@ -53,6 +59,7 @@ roles:
5359
description: Edit and refine the compiled content on lung disease causes for
5460
accuracy and coherence.
5561
expected_output: Finalized document on lung disease causes ready for dissemination.
62+
output_file: "output/editor.txt"
5663
tools:
5764
- ''
5865
dependencies: []

docs/api/praisonai/deploy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
110110
file.write(&#34;FROM python:3.11-slim\n&#34;)
111111
file.write(&#34;WORKDIR /app\n&#34;)
112112
file.write(&#34;COPY . .\n&#34;)
113-
file.write(&#34;RUN pip install flask praisonai==0.0.40 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==0.0.41 gunicorn markdown\n&#34;)
114114
file.write(&#34;EXPOSE 8080\n&#34;)
115115
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
116116

docs/models/openrouter.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Add OpenRouter to Praison AI
2+
3+
```bash
4+
export OPENROUTER_API_KEY=xxxxxxxxxx
5+
```
6+
7+
### agents.yaml file
8+
9+
```yaml
10+
framework: crewai
11+
topic: create movie script about cat in mars
12+
roles:
13+
researcher:
14+
backstory: Skilled in finding and organizing information, with a focus on research
15+
efficiency.
16+
goal: Gather information about Mars and cats
17+
role: Researcher
18+
llm:
19+
model: "openrouter/anthropic/claude-3.5-sonnet"
20+
tasks:
21+
gather_research:
22+
description: Research and gather information about Mars, its environment,
23+
and cats, including their behavior and characteristics.
24+
expected_output: Document with research findings, including interesting facts
25+
and information.
26+
tools:
27+
- ''
28+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ nav:
2727
- Anthropic Claude: models/anthropic.md
2828
- Cohere: models/cohere.md
2929
- Mistral: models/mistral.md
30+
- OpenRouter: models/openrouter.md
3031
- Ollama: models/ollama.md
3132
- Other Models: models/other.md
3233

praisonai/agents_generator.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,21 @@ def generate_crew_and_kickoff(self):
331331
description_filled = task_details['description'].format(topic=topic)
332332
expected_output_filled = task_details['expected_output'].format(topic=topic)
333333

334-
task = Task(description=description_filled, expected_output=expected_output_filled, agent=agent)
334+
task = Task(
335+
description=description_filled, # Clear, concise statement of what the task entails
336+
expected_output=expected_output_filled, # Detailed description of what task's completion looks like
337+
agent=agent, # The agent responsible for the task
338+
tools=task_details.get('tools', []), # Functions or capabilities the agent can utilize
339+
async_execution=task_details.get('async_execution') if task_details.get('async_execution') is not None else False, # Execute asynchronously if set
340+
context=[], ## TODO:
341+
config=task_details.get('config') if task_details.get('config') is not None else {}, # Additional configuration details
342+
output_json=task_details.get('output_json') if task_details.get('output_json') is not None else None, # Outputs a JSON object
343+
output_pydantic=task_details.get('output_pydantic') if task_details.get('output_pydantic') is not None else None, # Outputs a Pydantic model object
344+
output_file=task_details.get('output_file') if task_details.get('output_file') is not None else "", # Saves the task output to a file
345+
callback=task_details.get('callback') if task_details.get('callback') is not None else None, # Python callable executed with the task's output
346+
human_input=task_details.get('human_input') if task_details.get('human_input') is not None else False, # Indicates if the task requires human feedback
347+
create_directory=task_details.get('create_directory') if task_details.get('create_directory') is not None else False # Indicates if a directory needs to be created
348+
)
335349

336350
# Set tool callback if provided
337351
if self.task_callback:

praisonai/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create_dockerfile(self):
5656
file.write("FROM python:3.11-slim\n")
5757
file.write("WORKDIR /app\n")
5858
file.write("COPY . .\n")
59-
file.write("RUN pip install flask praisonai==0.0.40 gunicorn markdown\n")
59+
file.write("RUN pip install flask praisonai==0.0.41 gunicorn markdown\n")
6060
file.write("EXPOSE 8080\n")
6161
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
6262

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "PraisonAI"
3-
version = "0.0.40"
3+
version = "0.0.41"
44
description = "PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration."
55
authors = ["Mervin Praison"]
66
license = ""

0 commit comments

Comments
 (0)