AgentConfig Class

Resolved configuration for an agent server host.

All values are populated from environment variables at creation time. Access via app.config:


   app = InvocationAgentServerHost()
   print(app.config.agent_name)
   print(app.config.project_endpoint)

Constructor

AgentConfig(*, agent_name: str, agent_version: str, agent_id: str, is_hosted: bool, project_endpoint: str, project_id: str, session_id: str, port: int, appinsights_connection_string: str, otlp_endpoint: str, sse_keepalive_interval: int)

Parameters

Name Description
agent_name
Required

Agent name from FOUNDRY_AGENT_NAME.

agent_version
Required

Agent version from FOUNDRY_AGENT_VERSION.

agent_id
Required

Combined identifier ("name:version" or "name" or "").

is_hosted
Required

Whether the agent is running in a Foundry-hosted container environment, derived from FOUNDRY_HOSTING_ENVIRONMENT.

project_endpoint
Required

Foundry project endpoint from FOUNDRY_PROJECT_ENDPOINT.

project_id
Required

Foundry project ARM resource ID from FOUNDRY_PROJECT_ARM_ID.

session_id
Required

Default session ID from FOUNDRY_AGENT_SESSION_ID.

port
Required

Server port from PORT (default 8088).

appinsights_connection_string
Required

Application Insights connection string.

otlp_endpoint
Required

OTLP exporter endpoint.

sse_keepalive_interval
Required

SSE keep-alive interval in seconds (0 = disabled).

Keyword-Only Parameters

Name Description
agent_name
Required
agent_version
Required
agent_id
Required
is_hosted
Required
project_endpoint
Required
project_id
Required
session_id
Required
port
Required
appinsights_connection_string
Required
otlp_endpoint
Required
sse_keepalive_interval
Required

Methods

from_env

Create an AgentConfig by reading all platform environment variables.

from_env

Create an AgentConfig by reading all platform environment variables.

from_env() -> Self

Returns

Type Description

A frozen config with resolved values.