AgenticTokenCache Class
Caches observability tokens per (agentId, tenantId) using the provided UserAuthorization and TurnContext.
Initialize the token cache.
Constructor
AgenticTokenCache()
Methods
| get_observability_token |
Get the observability token for the specified agent and tenant. |
| register_observability |
Register observability for the specified agent and tenant. |
get_observability_token
Get the observability token for the specified agent and tenant.
async get_observability_token(agent_id: str, tenant_id: str) -> str | None
Parameters
| Name | Description |
|---|---|
|
agent_id
Required
|
The agent identifier. |
|
tenant_id
Required
|
The tenant identifier. |
Returns
| Type | Description |
|---|---|
|
The observability token if available; otherwise, None. |
register_observability
Register observability for the specified agent and tenant.
register_observability(agent_id: str, tenant_id: str, token_generator: AgenticTokenStruct, observability_scopes: list[str]) -> None
Parameters
| Name | Description |
|---|---|
|
agent_id
Required
|
The agent identifier. |
|
tenant_id
Required
|
The tenant identifier. |
|
token_generator
Required
|
The token generator structure. |
|
observability_scopes
Required
|
The observability scopes. |
Exceptions
| Type | Description |
|---|---|
|
If agent_id or tenant_id is empty or None. |
|
|
If token_generator is None. |