Skip to content

Conversation

@aubreyquinn
Copy link
Contributor

@aubreyquinn aubreyquinn commented Dec 3, 2025

In the sample-agent folder, this version of the agent has been tested and deployed in Azure, so if branched, it's a workable sample.

In the quickstart-playground folder, we have a sample which works with the playground test tool.

The benefit of the folder structure is that playground does not yet support agentic authentication, so it's best to separate the code until it does. Additionally, the 1.1.0-alpha.85 version of the agents-hosting package, is incompatible with the playground, but is needed for agentic authentication in telemetry in Azure.

@aubreyquinn aubreyquinn marked this pull request as ready for review December 3, 2025 11:19
@aubreyquinn aubreyquinn requested a review from a team as a code owner December 3, 2025 11:19
Copilot AI review requested due to automatic review settings December 3, 2025 11:19
Copilot finished reviewing on behalf of aubreyquinn December 3, 2025 11:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces two versions of a Perplexity-powered agent sample for the Agent 365 SDK:

  1. sample-agent: A production-ready, deployed version with agentic authentication and observability using newer alpha packages (1.1.0-alpha.85)
  2. quickstart-playground: A playground-compatible version using stable packages (1.0.15) without agentic authentication, since the playground doesn't yet support it

The separation allows developers to test in the playground while providing a deployment-ready reference implementation with full observability and authentication.

Key changes:

  • Refactored PerplexityClient to support source citations with formatted Markdown links
  • Implemented comprehensive observability with token caching for agentic authentication
  • Added separate configurations and dependencies for playground vs. deployment scenarios

Reviewed changes

Copilot reviewed 13 out of 28 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
nodejs/perplexity/sample-agent/src/token-cache.js New in-memory token cache for agentic authentication tokens (missing copyright header)
nodejs/perplexity/sample-agent/src/perplexityClient.ts Refactored client with source citation formatting and removed observability wrapper (missing copyright header, import issue)
nodejs/perplexity/sample-agent/src/index.js Server startup with graceful observability shutdown (missing copyright header)
nodejs/perplexity/sample-agent/src/agent.js Main agent with agentic auth, observability scopes, and token exchange (missing copyright header)
nodejs/perplexity/sample-agent/package.json Updated dependencies to alpha versions, unused Anthropic SDK dependency
nodejs/perplexity/sample-agent/manifest/manifest.json Updated manifest with real GUIDs and improved descriptions
nodejs/perplexity/sample-agent/manifest/agenticUserTemplateManifest.json Updated template with real blueprint ID
nodejs/perplexity/sample-agent/.env.example Configuration template with observability and auth settings
nodejs/perplexity/quickstart-playground/tsconfig.json TypeScript configuration for playground version
nodejs/perplexity/quickstart-playground/src/toolRunner.ts Demo tool execution with telemetry tracking
nodejs/perplexity/quickstart-playground/src/telemetryHelpers.ts Helper functions for extracting telemetry context
nodejs/perplexity/quickstart-playground/src/telemetry.ts Observability configuration initialization
nodejs/perplexity/quickstart-playground/src/playgroundService.ts Handlers for playground-specific activities (Word mentions, emails, Teams messages)
nodejs/perplexity/quickstart-playground/src/playgroundActivityTypes.ts Type definitions for playground activity payloads
nodejs/perplexity/quickstart-playground/src/perplexityClient.ts Client with embedded system prompt and observability wrapper
nodejs/perplexity/quickstart-playground/src/perplexityAgent.ts Main agent class delegating to specialized service handlers
nodejs/perplexity/quickstart-playground/src/notificationService.ts Real M365 notification handlers (Word, email) with potential prompt injection risks
nodejs/perplexity/quickstart-playground/src/index.ts Express server setup with JWT authorization and observability
nodejs/perplexity/quickstart-playground/src/guardService.ts Guards for installation and terms acceptance checks
nodejs/perplexity/quickstart-playground/src/chatFlowService.ts Chat flow management with streaming support
nodejs/perplexity/quickstart-playground/src/agent.ts Activity routing with telemetry wrapper for all event types
nodejs/perplexity/quickstart-playground/package.json Stable dependencies for playground compatibility
nodejs/perplexity/quickstart-playground/manifest/outline.png Agent outline icon
nodejs/perplexity/quickstart-playground/manifest/manifest.json Placeholder manifest for playground testing
nodejs/perplexity/quickstart-playground/manifest/color.png Agent color icon
nodejs/perplexity/quickstart-playground/manifest/agenticUserTemplateManifest.json Placeholder template manifest
nodejs/perplexity/quickstart-playground/README.md Sample documentation missing required sections per Agent 365 standards
nodejs/perplexity/quickstart-playground/.env.template Configuration template with placeholder values

nikhilNava
nikhilNava previously approved these changes Dec 3, 2025
Copy link
Contributor

Copilot AI commented Dec 3, 2025

@aubreyquinn I've opened a new pull request, #98, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Dec 3, 2025

@aubreyquinn I've opened a new pull request, #99, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Add Microsoft copyright header to token-cache.js

Co-authored-by: aubreyquinn <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: aubreyquinn <[email protected]>
Copilot AI and others added 2 commits December 3, 2025 11:37
* Initial plan

* Add Microsoft copyright header to perplexityClient.ts

Co-authored-by: aubreyquinn <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: aubreyquinn <[email protected]>
@aubreyquinn aubreyquinn enabled auto-merge (squash) December 4, 2025 09:55
@aubreyquinn aubreyquinn linked an issue Dec 4, 2025 that may be closed by this pull request
@pontemonti
Copy link
Contributor

I'm not following the description of the PR. If the only reason for adding a separate implementation is because the sample is not working within agents playground, that is not the correct solution - we should instead fix the sample so that it can, with as few config changes as possible, work for all scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate working Perplexity sample into folder

5 participants