This commit is contained in:
marko-kraemer 2025-04-24 16:54:18 +01:00 committed by Adam Cohen Hillel
parent b77243d69d
commit 0fc3c4a573
2 changed files with 5 additions and 12 deletions

View File

@ -158,16 +158,16 @@ class ResponseProcessor:
# Check for and log Anthropic thinking content
if delta and hasattr(delta, 'reasoning_content') and delta.reasoning_content:
if not has_printed_thinking_prefix:
print("[THINKING]: ", end='', flush=True)
# print("[THINKING]: ", end='', flush=True)
has_printed_thinking_prefix = True
print(delta.reasoning_content, end='', flush=True)
# print(delta.reasoning_content, end='', flush=True)
# Append reasoning to main content to be saved in the final message
accumulated_content += delta.reasoning_content
# Process content chunk
if delta and hasattr(delta, 'content') and delta.content:
chunk_content = delta.content
print(chunk_content, end='', flush=True)
# print(chunk_content, end='', flush=True)
accumulated_content += chunk_content
current_xml_content += chunk_content
@ -286,7 +286,7 @@ class ResponseProcessor:
logger.info("Stopping stream processing after loop due to XML tool call limit")
break
print() # Add a final newline after the streaming loop finishes
# print() # Add a final newline after the streaming loop finishes
# --- After Streaming Loop ---

View File

@ -66,12 +66,6 @@ def setup_logger(name: str = 'agentpress') -> logging.Logger:
logging.Logger: Configured logger instance
"""
logger = logging.getLogger(name)
# Set console logging level based on environment
if config.ENV_MODE == EnvMode.PRODUCTION:
logger.setLevel(logging.WARNING)
else:
logger.setLevel(logging.INFO)
# Create logs directory if it doesn't exist
log_dir = 'logs'
@ -91,9 +85,8 @@ def setup_logger(name: str = 'agentpress') -> logging.Logger:
# Console handler
console_handler = logging.StreamHandler(sys.stdout)
# Set console logging level based on environment
if config.ENV_MODE == EnvMode.PRODUCTION:
console_handler.setLevel(logging.INFO)
console_handler.setLevel(logging.WARNING)
else:
console_handler.setLevel(logging.DEBUG)