mirror of
https://github.com/langgenius/dify.git
synced 2026-02-11 19:00:44 -05:00
- Add AppAssetsInitializer to load published app assets into sandbox - Refactor VMFactory.create() to VMBuilder with builder pattern - Extract SandboxInitializer base class and DifyCliInitializer - Simplify SandboxLayer constructor (remove options/environments params) - Fix circular import in sandbox module by removing eager SandboxBashTool export - Update SandboxProviderService to return VMBuilder instead of VirtualEnvironment
23 lines
621 B
Python
23 lines
621 B
Python
"""Sandbox debug utilities. TODO: Remove this module when sandbox debugging is complete."""
|
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
if TYPE_CHECKING:
|
|
pass
|
|
|
|
SANDBOX_DEBUG_ENABLED = True
|
|
|
|
|
|
def sandbox_debug(tag: str, message: str, data: Any = None) -> None:
|
|
if not SANDBOX_DEBUG_ENABLED:
|
|
return
|
|
|
|
# Lazy import to avoid circular dependency
|
|
from core.callback_handler.agent_tool_callback_handler import print_text
|
|
|
|
print_text(f"\n[{tag}]\n", color="blue")
|
|
if data is not None:
|
|
print_text(f"{message}: {data}\n", color="blue")
|
|
else:
|
|
print_text(f"{message}\n", color="blue")
|