Skip to content

Commit 6d22769

Browse files
committed
feat: enable httpx debug logging when LOGLEVEL=debug and remove Ollama handling docs
1 parent c0a98d2 commit 6d22769

File tree

15 files changed

+46
-57
lines changed

15 files changed

+46
-57
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
1616
# Install Python packages (using latest versions)
1717
RUN pip install --no-cache-dir \
1818
flask \
19-
"praisonai>=2.2.74" \
19+
"praisonai>=2.2.75" \
2020
"praisonai[api]" \
2121
gunicorn \
2222
markdown

docker/Dockerfile.chat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
1616
# Install Python packages (using latest versions)
1717
RUN pip install --no-cache-dir \
1818
praisonai_tools \
19-
"praisonai>=2.2.74" \
19+
"praisonai>=2.2.75" \
2020
"praisonai[chat]" \
2121
"embedchain[github,youtube]"
2222

docker/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN mkdir -p /root/.praison
2020
# Install Python packages (using latest versions)
2121
RUN pip install --no-cache-dir \
2222
praisonai_tools \
23-
"praisonai>=2.2.74" \
23+
"praisonai>=2.2.75" \
2424
"praisonai[ui]" \
2525
"praisonai[chat]" \
2626
"praisonai[realtime]" \

docker/Dockerfile.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
1616
# Install Python packages (using latest versions)
1717
RUN pip install --no-cache-dir \
1818
praisonai_tools \
19-
"praisonai>=2.2.74" \
19+
"praisonai>=2.2.75" \
2020
"praisonai[ui]" \
2121
"praisonai[crewai]"
2222

docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ healthcheck:
121121
## 📦 Package Versions
122122
123123
All Docker images use consistent, up-to-date versions:
124-
- PraisonAI: `>=2.2.74`
124+
- PraisonAI: `>=2.2.75`
125125
- PraisonAI Agents: `>=0.0.92`
126126
- Python: `3.11-slim`
127127

@@ -218,7 +218,7 @@ docker-compose up -d
218218
### Version Pinning
219219
To use specific versions, update the Dockerfile:
220220
```dockerfile
221-
RUN pip install "praisonai==2.2.74" "praisonaiagents==0.0.92"
221+
RUN pip install "praisonai==2.2.75" "praisonaiagents==0.0.92"
222222
```
223223

224224
## 🌐 Production Deployment

src/praisonai-agents/praisonaiagents/_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _configure_loggers():
5959

6060
# When DEBUG is set, allow some HTTP logging for API endpoints
6161
if loglevel == 'DEBUG':
62-
allowed_debug_loggers = {"httpx._client", "openai._client"}
62+
allowed_debug_loggers = {"httpx", "httpx._client", "openai._client"}
6363

6464
for logger_name in _get_all_noisy_loggers():
6565
if logger_name not in allowed_debug_loggers:

src/praisonai-agents/praisonaiagents/agent/agent.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,15 @@ def __init__(
331331

332332
# Configure logging to suppress unwanted outputs
333333
logging.getLogger("litellm").setLevel(logging.WARNING)
334-
logging.getLogger("httpx").setLevel(logging.WARNING)
335-
logging.getLogger("httpcore").setLevel(logging.WARNING)
334+
335+
# Allow httpx logging when LOGLEVEL=debug, otherwise suppress it
336+
loglevel = os.environ.get('LOGLEVEL', 'INFO').upper()
337+
if loglevel == 'DEBUG':
338+
logging.getLogger("httpx").setLevel(logging.INFO)
339+
logging.getLogger("httpcore").setLevel(logging.INFO)
340+
else:
341+
logging.getLogger("httpx").setLevel(logging.WARNING)
342+
logging.getLogger("httpcore").setLevel(logging.WARNING)
336343

337344
# If instructions are provided, use them to set role, goal, and backstory
338345
if instructions:
@@ -1229,14 +1236,14 @@ def display_generating(self, content: str, start_time: float):
12291236
border_style="green",
12301237
expand=False
12311238
)
1232-
else:
1233-
# No content yet: show generating message
1234-
return Panel(
1235-
f"[bold cyan]Generating response...[/bold cyan]",
1236-
title=f"[bold]{self.name}[/bold] - {elapsed:.1f}s",
1237-
border_style="cyan",
1238-
expand=False
1239-
)
1239+
# else:
1240+
# # No content yet: show generating message
1241+
# return Panel(
1242+
# f"[bold cyan]Generating response...[/bold cyan]",
1243+
# title=f"[bold]{self.name}[/bold] - {elapsed:.1f}s",
1244+
# border_style="cyan",
1245+
# expand=False
1246+
# )
12401247

12411248
def chat(self, prompt, temperature=0.2, tools=None, output_json=None, output_pydantic=None, reasoning_steps=False, stream=None, task_name=None, task_description=None, task_id=None):
12421249
# Reset the final display flag for each new conversation

src/praisonai-agents/praisonaiagents/llm/OLLAMA_HANDLING.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/praisonai-agents/praisonaiagents/llm/llm.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,14 @@ def __init__(
201201
# These are from external libraries and not useful for debugging user code
202202
logging.getLogger("litellm.utils").setLevel(logging.WARNING)
203203
logging.getLogger("litellm.main").setLevel(logging.WARNING)
204-
logging.getLogger("litellm.llms.custom_httpx.http_handler").setLevel(logging.WARNING)
204+
205+
# Allow httpx logging when LOGLEVEL=debug, otherwise suppress it
206+
loglevel = os.environ.get('LOGLEVEL', 'INFO').upper()
207+
if loglevel == 'DEBUG':
208+
logging.getLogger("litellm.llms.custom_httpx.http_handler").setLevel(logging.INFO)
209+
else:
210+
logging.getLogger("litellm.llms.custom_httpx.http_handler").setLevel(logging.WARNING)
211+
205212
logging.getLogger("litellm.litellm_logging").setLevel(logging.WARNING)
206213
logging.getLogger("litellm.transformation").setLevel(logging.WARNING)
207214
litellm.suppress_debug_messages = True

src/praisonai-agents/pyproject.toml

Lines changed: 1 addition & 1 deletion
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.147"
7+
version = "0.0.148"
88
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
99
requires-python = ">=3.10"
1010
authors = [

0 commit comments

Comments
 (0)