Share via


ExecuteToolScope class

Provides OpenTelemetry tracing scope for AI tool execution operations.

Extends

Methods

recordResponse(string)

Records response information for telemetry tracking.

start(ToolCallDetails, AgentDetails, TenantDetails)

Creates and starts a new scope for tool execution tracing.

Inherited Methods

dispose()

Legacy dispose method for compatibility

recordError(Error)

Records an error that occurred during the operation

withActiveSpanAsync<T>(() => Promise<T>)

Makes this span active for the duration of the async callback execution

Method Details

recordResponse(string)

Records response information for telemetry tracking.

function recordResponse(response: string)

Parameters

response

string

The tool execution response

start(ToolCallDetails, AgentDetails, TenantDetails)

Creates and starts a new scope for tool execution tracing.

static function start(details: ToolCallDetails, agentDetails: AgentDetails, tenantDetails: TenantDetails): ExecuteToolScope

Parameters

details
ToolCallDetails

The tool call details

agentDetails
AgentDetails

The agent details

tenantDetails
TenantDetails

The tenant details

Returns

A new ExecuteToolScope instance.

Inherited Method Details

dispose()

Legacy dispose method for compatibility

function dispose()

Inherited From OpenTelemetryScope.dispose

recordError(Error)

Records an error that occurred during the operation

function recordError(error: Error)

Parameters

error

Error

The error that occurred

Inherited From OpenTelemetryScope.recordError

withActiveSpanAsync<T>(() => Promise<T>)

Makes this span active for the duration of the async callback execution

function withActiveSpanAsync<T>(callback: () => Promise<T>): Promise<T>

Parameters

callback

() => Promise<T>

Returns

Promise<T>

Inherited From OpenTelemetryScope.withActiveSpanAsync