mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 06:28:05 +08:00
feat: add tenant_id support to Sandbox and VirtualEnvironment initialization
This commit is contained in:
@ -14,11 +14,25 @@ class VirtualEnvironment(ABC):
|
||||
Base class for virtual environment implementations.
|
||||
"""
|
||||
|
||||
def __init__(self, options: Mapping[str, Any], environments: Mapping[str, str] | None = None) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
tenant_id: str,
|
||||
options: Mapping[str, Any],
|
||||
environments: Mapping[str, str] | None = None,
|
||||
user_id: str | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
Initialize the virtual environment with metadata.
|
||||
|
||||
Args:
|
||||
tenant_id: The tenant ID associated with this environment (required).
|
||||
options: Provider-specific configuration options.
|
||||
environments: Environment variables to set in the virtual environment.
|
||||
user_id: The user ID associated with this environment (optional).
|
||||
"""
|
||||
|
||||
self.tenant_id = tenant_id
|
||||
self.user_id = user_id
|
||||
self.options = options
|
||||
self.metadata = self._construct_environment(options, environments or {})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user