microsoft.opentelemetry.a365.core.invoke_agent_scope module
- class microsoft.opentelemetry.a365.core.invoke_agent_scope.InvokeAgentScope(request, scope_details, agent_details, caller_details=None, span_details=None)[source]
Bases:
OpenTelemetryScopeProvides OpenTelemetry tracing scope for AI agent invocation operations.
- static start(request, scope_details, agent_details, caller_details=None, span_details=None)[source]
Create and start a new scope for agent invocation tracing.
- Parameters:
request (
Request) – Request details for the invocationscope_details (
InvokeAgentScopeDetails) – Scope-level configuration (endpoint)agent_details (
AgentDetails) – The details of the agent being invokedcaller_details (
CallerDetails|None) – Optional composite caller details (human user and/or calling agent for A2A scenarios)span_details (
SpanDetails|None) – Optional span configuration (parent context, timing, kind)
- Return type:
- Returns:
A new InvokeAgentScope instance
- record_input_messages(messages)[source]
Record the input messages for telemetry tracking.
Accepts plain strings (auto-wrapped as OTEL ChatMessage with role
user) or a versionedInputMessageswrapper.- Parameters:
messages (
Union[str,list[str],InputMessages]) – List of input message strings or an InputMessages wrapper- Return type:
- record_output_messages(messages)[source]
Record the output messages for telemetry tracking.
Accepts plain strings (auto-wrapped as OTEL OutputMessage with role
assistant) or a versionedOutputMessageswrapper.- Parameters:
messages (
Union[str,list[str],OutputMessages]) – List of output message strings or an OutputMessages wrapper- Return type: