-
Notifications
You must be signed in to change notification settings - Fork 3
Perplexity: introducing the deployed sample version #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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:
- sample-agent: A production-ready, deployed version with agentic authentication and observability using newer alpha packages (1.1.0-alpha.85)
- 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 |
|
@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. |
|
@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]>
* 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]>
|
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. |
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.