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

View File

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