microsoft.opentelemetry.a365.hosting.token_cache_helpers.agent_token_cache module
Token cache for observability tokens per (agentId, tenantId).
- class microsoft.opentelemetry.a365.hosting.token_cache_helpers.agent_token_cache.AgenticTokenStruct(authorization, turn_context, auth_handler_name='AGENTIC')[source]
Bases:
objectStructure containing the token generation components.
- authorization: Authorization
The user authorization object for token exchange.
- turn_context: TurnContext
The turn context for the current conversation.
- class microsoft.opentelemetry.a365.hosting.token_cache_helpers.agent_token_cache.AgenticTokenCache[source]
Bases:
objectCaches observability tokens per (agentId, tenantId) using the provided UserAuthorization and TurnContext.
- register_observability(agent_id, tenant_id, token_generator, observability_scopes)[source]
Register observability for the specified agent and tenant.
- Parameters:
agent_id (
str) – The agent identifier.tenant_id (
str) – The tenant identifier.token_generator (
AgenticTokenStruct) – The token generator structure.observability_scopes (
list[str]) – The observability scopes.
- Raises:
ValueError – If agent_id or tenant_id is empty or None.
TypeError – If token_generator is None.
- Return type: