Skip to content

Commit b19a9ea

Browse files
committed
chore: update PraisonAI dependencies and enhance model testing in workflows
- Upgraded PraisonAI version from 2.2.16 to 2.2.17 across multiple Dockerfiles and configuration files for improved functionality. - Enhanced the testing of the PraisonAIModel by explicitly passing the API key and base URL, improving integration with CrewAI. - Added error handling during model instantiation to provide clearer feedback on failures, enhancing debugging capabilities. These changes aim to ensure better performance and reliability in the workflow and model interactions.
1 parent 9191092 commit b19a9ea

17 files changed

Lines changed: 3409 additions & 2159 deletions

File tree

.github/workflows/test-core.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,30 @@ jobs:
144144
api_key_from_config = praisonai.config_list[0].get('api_key', 'NOT_SET')
145145
print(f'API key from PraisonAI config: {api_key_from_config[:10] if api_key_from_config != \"NOT_SET\" else \"NOT_SET\"}...')
146146
147-
# Test PraisonAIModel
147+
# Test PraisonAIModel with explicit API key (the way CrewAI will use it)
148148
from praisonai.inc.models import PraisonAIModel
149-
model = PraisonAIModel(model='openai/gpt-4o-mini')
150-
print(f'PraisonAIModel api_key: {model.api_key[:10] if model.api_key != \"nokey\" else \"DEFAULT_NOKEY\"}...')
151-
print(f'PraisonAIModel api_key_var: {model.api_key_var}')
152-
print(f'PraisonAIModel base_url: {model.base_url}')
149+
150+
print('\\n🧪 Testing PraisonAIModel with explicit API key (CrewAI method):')
151+
model_with_explicit_key = PraisonAIModel(
152+
model='openai/gpt-4o-mini',
153+
base_url=praisonai.config_list[0].get('base_url'),
154+
api_key=praisonai.config_list[0].get('api_key')
155+
)
156+
print(f' Model: {model_with_explicit_key.model}')
157+
print(f' Model name: {model_with_explicit_key.model_name}')
158+
print(f' API key var: {model_with_explicit_key.api_key_var}')
159+
print(f' API key (explicit): {model_with_explicit_key.api_key[:10] if model_with_explicit_key.api_key != \"nokey\" else \"NOT_SET\"}...')
160+
print(f' Base URL: {model_with_explicit_key.base_url}')
161+
162+
# Test if the model can be created without errors
163+
try:
164+
llm_instance = model_with_explicit_key.get_model()
165+
print(f' ✅ LLM instance created successfully: {type(llm_instance).__name__}')
166+
print(f' LLM instance API key: {getattr(llm_instance, \"openai_api_key\", \"NOT_FOUND\")[:10] if hasattr(llm_instance, \"openai_api_key\") else \"NO_API_KEY_ATTR\"}...')
167+
except Exception as e:
168+
print(f' ❌ Failed to create LLM instance: {e}')
153169
"
170+
continue-on-error: true
154171

155172
- name: Run Unit Tests
156173
run: |

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

docker/Dockerfile.chat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
RUN pip install --no-cache-dir \
1414
praisonaiagents>=0.0.4 \
1515
praisonai_tools \
16-
"praisonai==2.2.16" \
16+
"praisonai==2.2.17" \
1717
"praisonai[chat]" \
1818
"embedchain[github,youtube]"
1919

docker/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515
RUN pip install --no-cache-dir \
1616
praisonaiagents>=0.0.4 \
1717
praisonai_tools \
18-
"praisonai==2.2.16" \
18+
"praisonai==2.2.17" \
1919
"praisonai[ui]" \
2020
"praisonai[chat]" \
2121
"praisonai[realtime]" \

docker/Dockerfile.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
RUN pip install --no-cache-dir \
1414
praisonaiagents>=0.0.4 \
1515
praisonai_tools \
16-
"praisonai==2.2.16" \
16+
"praisonai==2.2.17" \
1717
"praisonai[ui]" \
1818
"praisonai[crewai]"
1919

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==2.2.16 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==2.2.17 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/developers/local-development.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ WORKDIR /app
2727

2828
COPY . .
2929

30-
RUN pip install flask praisonai==2.2.16 watchdog
30+
RUN pip install flask praisonai==2.2.17 watchdog
3131

3232
EXPOSE 5555
3333

docs/ui/chat.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ To facilitate local development with live reload, you can use Docker. Follow the
155155

156156
COPY . .
157157

158-
RUN pip install flask praisonai==2.2.16 watchdog
158+
RUN pip install flask praisonai==2.2.17 watchdog
159159

160160
EXPOSE 5555
161161

docs/ui/code.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ To facilitate local development with live reload, you can use Docker. Follow the
208208

209209
COPY . .
210210

211-
RUN pip install flask praisonai==2.2.16 watchdog
211+
RUN pip install flask praisonai==2.2.17 watchdog
212212

213213
EXPOSE 5555
214214

src/praisonai-agents/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "praisonaiagents"
7-
version = "0.0.89"
7+
version = "0.0.90"
88
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
9-
requires-python = ">=3.8"
9+
requires-python = ">=3.10"
1010
authors = [
1111
{ name="Mervin Praison" }
1212
]

0 commit comments

Comments
 (0)