nat.plugins.a365.telemetry#

A365 telemetry exporter plugin for NeMo Agent Toolkit.

Submodules#

Classes#

TokenExtractor

Callable that extracts a bearer token from NAT's AuthResult.

Functions#

register_token_extractor(→ None)

Register a custom token extractor for A365 telemetry.

Package Contents#

class TokenExtractor#

Bases: Protocol

Callable that extracts a bearer token from NAT’s AuthResult.

Used when the default (BearerTokenCred or HeaderCred(Authorization)) does not match your auth provider’s credential shape. Register a custom extractor with register_token_extractor(name, callable) and set token_extractor=name in config.

register_token_extractor(
name: str,
extractor: collections.abc.Callable[[nat.data_models.authentication.AuthResult], str | None],
) None#

Register a custom token extractor for A365 telemetry.

Use when your auth provider returns credentials in a shape the default extractor does not understand (e.g. a new NAT credential type). Then set token_extractor=”name” in your a365 telemetry exporter config.

Args:

name: Name to use in config (e.g. “my_provider”). extractor: Callable (AuthResult) -> str | None. Return the bearer token or None.