Skip to content

Commit b1d9ef5

Browse files
Merge pull request MervinPraison#534 from MervinPraison/develop
2.2.18
2 parents 312d1a8 + e633ad9 commit b1d9ef5

16 files changed

Lines changed: 246 additions & 107 deletions

File tree

.github/workflows/test-core.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,39 +133,61 @@ jobs:
133133
import sys
134134
sys.path.insert(0, '.')
135135
136+
# Attempt to import SecretStr, otherwise use a dummy class
137+
try:
138+
from pydantic.types import SecretStr
139+
except ImportError:
140+
class SecretStr: # Dummy class if pydantic is not available in this minimal context
141+
def __init__(self, value): self._value = value
142+
def get_secret_value(self): return self._value
143+
144+
def get_key_display_value(key_value):
145+
if isinstance(key_value, SecretStr):
146+
return key_value.get_secret_value()[:10] if key_value.get_secret_value() else 'EMPTY_SECRET'
147+
elif isinstance(key_value, str):
148+
return key_value[:10] if key_value != 'nokey' and key_value != 'NOT_SET' else key_value
149+
return 'INVALID_TYPE'
150+
136151
print('🔧 Direct PraisonAI API Key Check:')
137-
print(f'Environment OPENAI_API_KEY: {os.environ.get(\"OPENAI_API_KEY\", \"NOT_SET\")[:10]}...')
152+
env_api_key = os.environ.get(\\"OPENAI_API_KEY\\", \\"NOT_SET\\")
153+
print(f'Environment OPENAI_API_KEY: {get_key_display_value(env_api_key)}...')
138154
139-
# Test PraisonAI initialization
140155
from praisonai import PraisonAI
141156
praisonai = PraisonAI()
142157
143158
print(f'PraisonAI config_list: {praisonai.config_list}')
144159
api_key_from_config = praisonai.config_list[0].get('api_key', 'NOT_SET')
145-
print(f'API key from PraisonAI config: {api_key_from_config[:10] if api_key_from_config != \"NOT_SET\" else \"NOT_SET\"}...')
160+
print(f'API key from PraisonAI config: {get_key_display_value(api_key_from_config)}...')
146161
147-
# Test PraisonAIModel with explicit API key (the way CrewAI will use it)
148162
from praisonai.inc.models import PraisonAIModel
149163
150-
print('\\n🧪 Testing PraisonAIModel with explicit API key (CrewAI method):')
164+
print('\\\\n🧪 Testing PraisonAIModel with explicit API key (CrewAI method):')
151165
model_with_explicit_key = PraisonAIModel(
152166
model='openai/gpt-4o-mini',
153167
base_url=praisonai.config_list[0].get('base_url'),
154-
api_key=praisonai.config_list[0].get('api_key')
168+
api_key=api_key_from_config # This will be a string from praisonai.config_list
155169
)
156170
print(f' Model: {model_with_explicit_key.model}')
157171
print(f' Model name: {model_with_explicit_key.model_name}')
158172
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\"}...')
173+
# model_with_explicit_key.api_key is now a string, or 'nokey'
174+
print(f' API key (explicitly passed to PraisonAIModel): {get_key_display_value(model_with_explicit_key.api_key)}...')
160175
print(f' Base URL: {model_with_explicit_key.base_url}')
161176
162-
# Test if the model can be created without errors
163177
try:
164178
llm_instance = model_with_explicit_key.get_model()
165179
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\"}...')
180+
181+
# langchain_openai.ChatOpenAI stores the key in openai_api_key as SecretStr
182+
llm_api_key_attr = getattr(llm_instance, 'openai_api_key', 'NOT_FOUND')
183+
if llm_api_key_attr != 'NOT_FOUND':
184+
print(f' LLM instance API key: {get_key_display_value(llm_api_key_attr)}...')
185+
else:
186+
print(f' LLM instance API key attribute not found.')
167187
except Exception as e:
168188
print(f' ❌ Failed to create LLM instance: {e}')
189+
import traceback
190+
traceback.print_exc()
169191
"
170192
continue-on-error: true
171193

@@ -234,6 +256,9 @@ jobs:
234256
echo " OPENAI_API_KEY set: $([ -n "$OPENAI_API_KEY" ] && echo 'YES' || echo 'NO')"
235257
echo " OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
236258
echo " OPENAI_API_KEY starts with sk-: $(echo "$OPENAI_API_KEY" | grep -q '^sk-' && echo 'YES' || echo 'NO')"
259+
export OPENAI_API_KEY="$OPENAI_API_KEY"
260+
export OPENAI_API_BASE="$OPENAI_API_BASE"
261+
export OPENAI_MODEL_NAME="$OPENAI_MODEL_NAME"
237262
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings
238263
239264
- name: Upload Coverage Reports

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.17 gunicorn markdown
4+
RUN pip install flask praisonai==2.2.18 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.17" \
16+
"praisonai==2.2.18" \
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.17" \
18+
"praisonai==2.2.18" \
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.17" \
16+
"praisonai==2.2.18" \
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.17 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==2.2.18 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.17 watchdog
30+
RUN pip install flask praisonai==2.2.18 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.17 watchdog
158+
RUN pip install flask praisonai==2.2.18 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.17 watchdog
211+
RUN pip install flask praisonai==2.2.18 watchdog
212212

213213
EXPOSE 5555
214214

src/praisonai-agents/pyproject.toml

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

55
[project]
66
name = "praisonaiagents"
7-
version = "0.0.90"
7+
version = "0.0.91"
88
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
99
requires-python = ">=3.10"
1010
authors = [
@@ -25,13 +25,13 @@ mcp = [
2525
]
2626

2727
memory = [
28-
"chromadb>=0.5.23"
28+
"chromadb>=1.0.0"
2929
]
3030

3131
knowledge = [
3232
"mem0ai>=0.1.0",
33-
"chromadb==0.5.23",
34-
"markitdown[all]",
33+
"chromadb>=1.0.0",
34+
"markitdown[all]>=0.1.0",
3535
"chonkie>=1.0.2"
3636
]
3737

0 commit comments

Comments
 (0)