diff --git a/nodejs/copilot-studio/sample-agent/package.json b/nodejs/copilot-studio/sample-agent/package.json index fccd235c..93759099 100644 --- a/nodejs/copilot-studio/sample-agent/package.json +++ b/nodejs/copilot-studio/sample-agent/package.json @@ -19,10 +19,10 @@ ], "license": "MIT", "dependencies": { - "@microsoft/agents-a365-notifications": "^0.1.0-preview.30", - "@microsoft/agents-a365-observability": "^0.1.0-preview.30", - "@microsoft/agents-a365-observability-hosting": "^0.1.0-preview.64", - "@microsoft/agents-a365-runtime": "^0.1.0-preview.30", + "@microsoft/agents-a365-notifications": "^0.1.0-preview.125", + "@microsoft/agents-a365-observability": "^0.1.0-preview.125", + "@microsoft/agents-a365-observability-hosting": "^0.1.0-preview.125", + "@microsoft/agents-a365-runtime": "^0.1.0-preview.125", "@microsoft/agents-activity": "^1.2.2", "@microsoft/agents-copilotstudio-client": "^1.2.2", "@microsoft/agents-hosting": "^1.2.2", diff --git a/nodejs/copilot-studio/sample-agent/src/agent.ts b/nodejs/copilot-studio/sample-agent/src/agent.ts index 3c7c046f..aed00bde 100644 --- a/nodejs/copilot-studio/sample-agent/src/agent.ts +++ b/nodejs/copilot-studio/sample-agent/src/agent.ts @@ -88,7 +88,6 @@ export class MyAgent extends AgentApplication { new BaggageBuilder(), turnContext ).sessionDescription('Copilot Studio integration session') - .correlationId(`corr-${Date.now()}`) .build(); // Preload/refresh exporter token diff --git a/nodejs/copilot-studio/sample-agent/src/client.ts b/nodejs/copilot-studio/sample-agent/src/client.ts index 3b1942a7..de9b77f6 100644 --- a/nodejs/copilot-studio/sample-agent/src/client.ts +++ b/nodejs/copilot-studio/sample-agent/src/client.ts @@ -12,8 +12,8 @@ import { Builder, InferenceOperationType, AgentDetails, - TenantDetails, InferenceDetails, + Request, Agent365ExporterOptions, } from '@microsoft/agents-a365-observability'; import { AgenticTokenCacheInstance } from '@microsoft/agents-a365-observability-hosting'; @@ -124,6 +124,10 @@ class McsClient implements Client { * @returns The agent's response text. */ async invokeInferenceScope(prompt: string): Promise { + const request: Request = { + conversationId: this.conversationId || `conv-${Date.now()}`, + }; + const inferenceDetails: InferenceDetails = { operationName: InferenceOperationType.CHAT, model: 'copilot-studio-agent', @@ -132,15 +136,11 @@ class McsClient implements Client { const agentDetails: AgentDetails = { agentId: 'copilot-studio-sample-agent', agentName: 'Copilot Studio Sample Agent', - conversationId: this.conversationId || `conv-${Date.now()}`, - }; - - const tenantDetails: TenantDetails = { tenantId: process.env.tenantId || 'unknown-tenant', }; let response = ''; - const scope = InferenceScope.start(inferenceDetails, agentDetails, tenantDetails); + const scope = InferenceScope.start(request, inferenceDetails, agentDetails); try { await scope.withActiveSpanAsync(async () => { @@ -149,7 +149,6 @@ class McsClient implements Client { // Record the inference telemetry scope.recordInputMessages([prompt]); scope.recordOutputMessages([response]); - scope.recordResponseId(`resp-${Date.now()}`); scope.recordFinishReasons(['stop']); }); } catch (error) { @@ -197,6 +196,5 @@ export async function getClient( // Create the Copilot Studio client with the token const copilotClient = new CopilotStudioClient(settings, tokenResult.token); - return new McsClient(copilotClient); }