microsoft.opentelemetry.a365.hosting.token_cache_helpers package
Token cache helpers for observability.
- class microsoft.opentelemetry.a365.hosting.token_cache_helpers.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:
- class microsoft.opentelemetry.a365.hosting.token_cache_helpers.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.