mirror of https://github.com/kortix-ai/suna.git
This commit is contained in:
parent
b77243d69d
commit
0fc3c4a573
|
@ -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 ---
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,6 @@ def setup_logger(name: str = 'agentpress') -> logging.Logger:
|
||||||
logging.Logger: Configured logger instance
|
logging.Logger: Configured logger instance
|
||||||
"""
|
"""
|
||||||
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'
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue