Skip to content

Commit 5f59e90

Browse files
Merge pull request #52 from MervinPraison/develop
v0.0.30
2 parents 061e724 + 340b3b4 commit 5f59e90

File tree

10 files changed

+268
-133
lines changed

10 files changed

+268
-133
lines changed

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.29 gunicorn markdown
4+
RUN pip install flask praisonai==0.0.30 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

docs/api/praisonai/agents_generator.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ <h1 class="title">Module <code>praisonai.agents_generator</code></h1>
3737
from crewai.telemetry import Telemetry
3838
load_dotenv()
3939
import autogen
40-
import gradio as gr
4140
import argparse
4241
from .auto import AutoGenerator
4342
from crewai_tools import (

docs/api/praisonai/auto.html

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1 class="title">Module <code>praisonai.auto</code></h1>
2828
</summary>
2929
<pre><code class="python">from openai import OpenAI
3030
from pydantic import BaseModel
31-
from typing import Dict, List
31+
from typing import Dict, List, Optional
3232
import instructor
3333
import os
3434
import json
@@ -51,27 +51,29 @@ <h1 class="title">Module <code>praisonai.auto</code></h1>
5151
roles: Dict[str, RoleDetails]
5252

5353
class AutoGenerator:
54-
def __init__(self, topic=&#34;Movie Story writing about AI&#34;, agent_file=&#34;test.yaml&#34;, framework=&#34;crewai&#34;):
54+
def __init__(self, topic=&#34;Movie Story writing about AI&#34;, agent_file=&#34;test.yaml&#34;, framework=&#34;crewai&#34;, config_list: Optional[List[Dict]] = None):
5555
&#34;&#34;&#34;
5656
Initialize the AutoGenerator class with the specified topic, agent file, and framework.
57-
note: autogen framework is different from this AutoGenerator class.
57+
Note: autogen framework is different from this AutoGenerator class.
5858

5959
Args:
6060
topic (str, optional): The topic for the generated team structure. Defaults to &#34;Movie Story writing about AI&#34;.
6161
agent_file (str, optional): The name of the YAML file to save the generated team structure. Defaults to &#34;test.yaml&#34;.
6262
framework (str, optional): The framework for the generated team structure. Defaults to &#34;crewai&#34;.
63-
63+
config_list (Optional[List[Dict]], optional): A list containing the configuration details for the OpenAI API.
64+
If None, it defaults to using environment variables or hardcoded values.
6465
Attributes:
6566
config_list (list): A list containing the configuration details for the OpenAI API.
6667
topic (str): The specified topic for the generated team structure.
6768
agent_file (str): The specified name of the YAML file to save the generated team structure.
6869
framework (str): The specified framework for the generated team structure.
6970
client (instructor.Client): An instance of the instructor.Client class initialized with the specified OpenAI API configuration.
7071
&#34;&#34;&#34;
71-
self.config_list = [
72+
self.config_list = config_list or [
7273
{
7374
&#39;model&#39;: os.environ.get(&#34;OPENAI_MODEL_NAME&#34;, &#34;gpt-4o&#34;),
7475
&#39;base_url&#39;: os.environ.get(&#34;OPENAI_API_BASE&#34;, &#34;https://api.openai.com/v1&#34;),
76+
&#39;api_key&#39;: os.environ.get(&#34;OPENAI_API_KEY&#34;)
7577
}
7678
]
7779
self.topic = topic
@@ -225,11 +227,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
225227
<dl>
226228
<dt id="praisonai.auto.AutoGenerator"><code class="flex name class">
227229
<span>class <span class="ident">AutoGenerator</span></span>
228-
<span>(</span><span>topic='Movie Story writing about AI', agent_file='test.yaml', framework='crewai')</span>
230+
<span>(</span><span>topic='Movie Story writing about AI', agent_file='test.yaml', framework='crewai', config_list: Optional[List[Dict]] = None)</span>
229231
</code></dt>
230232
<dd>
231233
<div class="desc"><p>Initialize the AutoGenerator class with the specified topic, agent file, and framework.
232-
note: autogen framework is different from this AutoGenerator class.</p>
234+
Note: autogen framework is different from this AutoGenerator class.</p>
233235
<h2 id="args">Args</h2>
234236
<dl>
235237
<dt><strong><code>topic</code></strong> :&ensp;<code>str</code>, optional</dt>
@@ -238,6 +240,9 @@ <h2 id="args">Args</h2>
238240
<dd>The name of the YAML file to save the generated team structure. Defaults to "test.yaml".</dd>
239241
<dt><strong><code>framework</code></strong> :&ensp;<code>str</code>, optional</dt>
240242
<dd>The framework for the generated team structure. Defaults to "crewai".</dd>
243+
<dt><strong><code>config_list</code></strong> :&ensp;<code>Optional[List[Dict]]</code>, optional</dt>
244+
<dd>A list containing the configuration details for the OpenAI API.
245+
If None, it defaults to using environment variables or hardcoded values.</dd>
241246
</dl>
242247
<h2 id="attributes">Attributes</h2>
243248
<dl>
@@ -257,27 +262,29 @@ <h2 id="attributes">Attributes</h2>
257262
<span>Expand source code</span>
258263
</summary>
259264
<pre><code class="python">class AutoGenerator:
260-
def __init__(self, topic=&#34;Movie Story writing about AI&#34;, agent_file=&#34;test.yaml&#34;, framework=&#34;crewai&#34;):
265+
def __init__(self, topic=&#34;Movie Story writing about AI&#34;, agent_file=&#34;test.yaml&#34;, framework=&#34;crewai&#34;, config_list: Optional[List[Dict]] = None):
261266
&#34;&#34;&#34;
262267
Initialize the AutoGenerator class with the specified topic, agent file, and framework.
263-
note: autogen framework is different from this AutoGenerator class.
268+
Note: autogen framework is different from this AutoGenerator class.
264269

265270
Args:
266271
topic (str, optional): The topic for the generated team structure. Defaults to &#34;Movie Story writing about AI&#34;.
267272
agent_file (str, optional): The name of the YAML file to save the generated team structure. Defaults to &#34;test.yaml&#34;.
268273
framework (str, optional): The framework for the generated team structure. Defaults to &#34;crewai&#34;.
269-
274+
config_list (Optional[List[Dict]], optional): A list containing the configuration details for the OpenAI API.
275+
If None, it defaults to using environment variables or hardcoded values.
270276
Attributes:
271277
config_list (list): A list containing the configuration details for the OpenAI API.
272278
topic (str): The specified topic for the generated team structure.
273279
agent_file (str): The specified name of the YAML file to save the generated team structure.
274280
framework (str): The specified framework for the generated team structure.
275281
client (instructor.Client): An instance of the instructor.Client class initialized with the specified OpenAI API configuration.
276282
&#34;&#34;&#34;
277-
self.config_list = [
283+
self.config_list = config_list or [
278284
{
279285
&#39;model&#39;: os.environ.get(&#34;OPENAI_MODEL_NAME&#34;, &#34;gpt-4o&#34;),
280286
&#39;base_url&#39;: os.environ.get(&#34;OPENAI_API_BASE&#34;, &#34;https://api.openai.com/v1&#34;),
287+
&#39;api_key&#39;: os.environ.get(&#34;OPENAI_API_KEY&#34;)
281288
}
282289
]
283290
self.topic = topic

0 commit comments

Comments
 (0)