ScopeUtils class

Unified utilities to populate scope tags from a TurnContext.

Methods

buildInvokeAgentDetails(AgentDetails, TurnContextLike, string)

Build agent details by merging provided details with TurnContext.

deriveAgentDetails(TurnContextLike, string)

Derive target agent details from the activity recipient.

deriveCallerAgent(TurnContextLike)

Derive caller agent details from the activity from.

deriveCallerDetails(TurnContextLike)

Derive caller identity details (id, email, name, tenant) from the activity from.

deriveChannelObject(TurnContextLike)

Derive channel (name and description) from the TurnContext.

deriveConversationId(TurnContextLike)

Derive conversation id from the TurnContext.

populateExecuteToolScopeFromTurnContext(ToolCallDetails, TurnContextLike, string, TimeInput, TimeInput, SpanKind)

Create an ExecuteToolScope enriched with values from the TurnContext.

populateInferenceScopeFromTurnContext(InferenceDetails, TurnContextLike, string, TimeInput, TimeInput)

Create an InferenceScope enriched with values from the TurnContext.

populateInvokeAgentScopeFromTurnContext(AgentDetails, InvokeAgentScopeDetails, TurnContextLike, string, TimeInput, TimeInput, SpanKind)

Create an InvokeAgentScope enriched with values from the TurnContext.

Method Details

buildInvokeAgentDetails(AgentDetails, TurnContextLike, string)

Build agent details by merging provided details with TurnContext.

static function buildInvokeAgentDetails(details: AgentDetails, turnContext: TurnContextLike, authToken: string): AgentDetails

Parameters

details
AgentDetails
turnContext
TurnContextLike
authToken

string

Returns

deriveAgentDetails(TurnContextLike, string)

Derive target agent details from the activity recipient.

static function deriveAgentDetails(turnContext: TurnContextLike, authToken: string): undefined | AgentDetails

Parameters

turnContext
TurnContextLike
authToken

string

Returns

undefined | AgentDetails

deriveCallerAgent(TurnContextLike)

Derive caller agent details from the activity from.

static function deriveCallerAgent(turnContext: TurnContextLike): undefined | AgentDetails

Parameters

turnContext
TurnContextLike

Returns

undefined | AgentDetails

deriveCallerDetails(TurnContextLike)

Derive caller identity details (id, email, name, tenant) from the activity from.

static function deriveCallerDetails(turnContext: TurnContextLike): undefined | UserDetails

Parameters

turnContext
TurnContextLike

Returns

undefined | UserDetails

deriveChannelObject(TurnContextLike)

Derive channel (name and description) from the TurnContext.

static function deriveChannelObject(turnContext: TurnContextLike): { description?: string, name?: string }

Parameters

turnContext
TurnContextLike

Returns

{ description?: string, name?: string }

deriveConversationId(TurnContextLike)

Derive conversation id from the TurnContext.

static function deriveConversationId(turnContext: TurnContextLike): undefined | string

Parameters

turnContext
TurnContextLike

Returns

undefined | string

populateExecuteToolScopeFromTurnContext(ToolCallDetails, TurnContextLike, string, TimeInput, TimeInput, SpanKind)

Create an ExecuteToolScope enriched with values from the TurnContext.

static function populateExecuteToolScopeFromTurnContext(details: ToolCallDetails, turnContext: TurnContextLike, authToken: string, startTime?: TimeInput, endTime?: TimeInput, spanKind?: SpanKind): ExecuteToolScope

Parameters

details
ToolCallDetails
turnContext
TurnContextLike
authToken

string

startTime

TimeInput

endTime

TimeInput

spanKind

SpanKind

Returns

populateInferenceScopeFromTurnContext(InferenceDetails, TurnContextLike, string, TimeInput, TimeInput)

Create an InferenceScope enriched with values from the TurnContext.

static function populateInferenceScopeFromTurnContext(details: InferenceDetails, turnContext: TurnContextLike, authToken: string, startTime?: TimeInput, endTime?: TimeInput): InferenceScope

Parameters

turnContext
TurnContextLike
authToken

string

startTime

TimeInput

endTime

TimeInput

Returns

populateInvokeAgentScopeFromTurnContext(AgentDetails, InvokeAgentScopeDetails, TurnContextLike, string, TimeInput, TimeInput, SpanKind)

Create an InvokeAgentScope enriched with values from the TurnContext.

static function populateInvokeAgentScopeFromTurnContext(details: AgentDetails, scopeDetails: InvokeAgentScopeDetails, turnContext: TurnContextLike, authToken: string, startTime?: TimeInput, endTime?: TimeInput, spanKind?: SpanKind): InvokeAgentScope

Parameters

details
AgentDetails
turnContext
TurnContextLike
authToken

string

startTime

TimeInput

endTime

TimeInput

spanKind

SpanKind

Returns