Add Perplexity AI Sample Agent (.NET)#277
Open
Yogeshp-MSFT wants to merge 14 commits intomicrosoft:mainfrom
Open
Add Perplexity AI Sample Agent (.NET)#277Yogeshp-MSFT wants to merge 14 commits intomicrosoft:mainfrom
Yogeshp-MSFT wants to merge 14 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new .NET Perplexity AI sample agent under dotnet/perplexity/sample-agent/, showing Perplexity (Responses API) as the LLM provider, custom MCP-based Mail/Calendar tool invocation, and OpenTelemetry/A365 observability wiring.
Changes:
- Introduces a Perplexity Responses API client (
PerplexityClient) with a multi-turn tool-call loop. - Adds a lightweight MCP JSON-RPC client (
McpSession) plus a tool discovery/execution service (McpToolService). - Adds sample app startup, configuration, Teams app package assets, and documentation (README + design doc).
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 32 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/perplexity/sample-agent/Program.cs | ASP.NET Core startup wiring for agent, telemetry, auth, MCP tools, and message endpoint. |
| dotnet/perplexity/sample-agent/Agent/MyAgent.cs | Main agent implementation: prompt, tool loading, typing/streaming response behavior. |
| dotnet/perplexity/sample-agent/PerplexityClient.cs | Perplexity Responses API integration and tool-call loop logic. |
| dotnet/perplexity/sample-agent/McpSession.cs | Minimal MCP JSON-RPC over HTTP (incl. SSE parsing). |
| dotnet/perplexity/sample-agent/McpToolService.cs | MCP server discovery + tool schema sanitization + tool executor dispatch. |
| dotnet/perplexity/sample-agent/telemetry/AgentOTELExtensions.cs | OpenTelemetry setup (resources, tracing, metrics, exporters, health/resilience defaults). |
| dotnet/perplexity/sample-agent/telemetry/AgentMetrics.cs | Custom ActivitySource + Meter instruments and wrapper helpers. |
| dotnet/perplexity/sample-agent/telemetry/A365OtelWrapper.cs | A365 observability baggage/token-cache wrapper around agent execution. |
| dotnet/perplexity/sample-agent/AspNetExtensions.cs | JWT token validation / auth setup helpers for the sample. |
| dotnet/perplexity/sample-agent/PerplexitySampleAgent.csproj | Sample project dependencies (A365 SDK packages + OTEL + resilience). |
| dotnet/perplexity/sample-agent/appsettings.json | Base configuration template for auth + Perplexity settings. |
| dotnet/perplexity/sample-agent/appsettings.Development.json | Dev overrides (token validation disabled, placeholder secrets). |
| dotnet/perplexity/sample-agent/appsettings.Playground.json | Playground overrides (token validation disabled, placeholder secrets). |
| dotnet/perplexity/sample-agent/ToolingManifest.json | MCP server fallback manifest for Mail + Calendar tools. |
| dotnet/perplexity/sample-agent/README.md | Setup/run documentation and sample overview. |
| dotnet/perplexity/sample-agent/docs/design.md | Architecture/design notes for the sample. |
| dotnet/perplexity/sample-agent/appPackage/manifest.json | Teams app manifest template for the sample agent. |
| dotnet/perplexity/sample-agent/appPackage/color.png | Teams app icon (color). |
| dotnet/perplexity/sample-agent/appPackage/outline.png | Teams app icon (outline). |
| dotnet/perplexity/sample-agent/.gitignore | Sample-local ignores (build outputs + A365 generated config). |
| dotnet/perplexity/PerplexitySampleAgent.sln | Solution file referencing the sample project. |
Author
|
hi @ajmfehr can you review this pr? |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
7ae10e2 to
85eee60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New .NET sample demonstrating Perplexity AI as the LLM provider with the Microsoft Agents SDK. Features live web search via Perplexity's Sonar models and MCP tools for Mail and Calendar.
New directory:
dotnet/perplexity/sample-agent/Key Capabilities
HttpClientintegrationMcpSession.cs)ToolingManifest.jsonfallbackHow It Differs from Existing Samples
HttpClientMcpSessionFiles
Core:
Program.cs,Agent/MyAgent.cs,PerplexityClient.cs,McpSession.cs,McpToolService.cs,AspNetExtensions.csTelemetry:
telemetry/AgentMetrics.cs,AgentOTELExtensions.cs,A365OtelWrapper.csConfig: appsettings.json, appsettings.Development.json, appsettings.Playground.json,
ToolingManifest.jsonDocs:
README.md,docs/design.mdDeployment:
appPackage/manifest.json,PerplexitySampleAgent.sln,.csprojChecklist