Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

_ENV_FOUNDRY_AGENT_NAME = "FOUNDRY_AGENT_NAME"
_ENV_FOUNDRY_AGENT_VERSION = "FOUNDRY_AGENT_VERSION"
_ENV_FOUNDRY_HOSTING_ENVIRONMENT = "FOUNDRY_HOSTING_ENVIRONMENT"
_ENV_FOUNDRY_PROJECT_ENDPOINT = "FOUNDRY_PROJECT_ENDPOINT"
_ENV_FOUNDRY_PROJECT_ARM_ID = "FOUNDRY_PROJECT_ARM_ID"
_ENV_FOUNDRY_AGENT_SESSION_ID = "FOUNDRY_AGENT_SESSION_ID"
Expand Down Expand Up @@ -88,18 +87,6 @@ def __init__(
self.otlp_endpoint = otlp_endpoint
self.sse_keepalive_interval = sse_keepalive_interval

@property
def is_hosted(self) -> bool:
"""Whether the agent is running in a Foundry-hosted container environment.

Returns ``True`` when the platform-injected ``FOUNDRY_HOSTING_ENVIRONMENT``
environment variable exists and is non-empty. This variable is set
exclusively by the Foundry platform at container startup.

:rtype: bool
"""
return bool(os.environ.get(_ENV_FOUNDRY_HOSTING_ENVIRONMENT))

@classmethod
def from_env(cls) -> Self:
"""Create an ``AgentConfig`` by reading all platform environment variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(
}

if provider is None:
if config.is_hosted:
if config.project_endpoint:
from ..store._foundry_provider import FoundryStorageProvider
from ..store._foundry_settings import FoundryStorageSettings

Expand Down