-
Notifications
You must be signed in to change notification settings - Fork 43
Introducing perplexity Sample Agent #18
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9c3a3e7
added perplexity sample agent from other repository
97a5272
moved the perplexity code into the sample-agent directory
c8caee3
Merge remote-tracking branch 'origin/main' into users/aubreyquinn/per…
e15fc16
applying changes from code review
b1747c6
applying changes from code review
e56558c
applying changes from code review
710b47e
applying changes from code review
654fabd
applying changes from code review
5164d9f
applying changes from code review
b5e9e19
applying changes from code review
83dcda3
applying changes from code review
62b8058
updated readme file with features list
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Perplexity API Configuration | ||
| PERPLEXITY_API_KEY=your_perplexity_api_key_here | ||
| PERPLEXITY_MODEL=sonar | ||
|
|
||
| # Agent365 Configuration | ||
| AGENT_ID=perplexity-agent | ||
| PORT=3978 | ||
|
|
||
| # Microsoft Bot Framework Authentication | ||
| # Get these from Azure Bot Service registration | ||
| CLIENT_ID= | ||
| CLIENT_SECRET= | ||
| TENANT_ID= | ||
|
|
||
| # MCP Tools Configuration (optional - for M365 integration) | ||
| MCP_ENVIRONMENT_ID= | ||
| AGENTIC_USER_ID= | ||
| MCP_AUTH_TOKEN= | ||
|
|
||
| # Observability (optional - Azure Application Insights) | ||
| CONNECTION_STRING= | ||
|
|
||
| # Debug Mode | ||
| DEBUG=false |
|
aubreyquinn marked this conversation as resolved.
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # Agent Sample - Perplexity AI | ||
|
|
||
| This directory contains a sample agent implementation using Node.js and Perplexity AI. | ||
|
|
||
| ## Demonstrates | ||
|
|
||
| This sample demonstrates how to build an agent using the Agent 365 framework with Node.js and Perplexity AI. | ||
|
|
||
| ## Features | ||
|
|
||
| - ✅ **Chat with Perplexity** - Natural language conversations using Perplexity's Sonar models. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js 18+ | ||
| - Perplexity AI API Key from <https://perplexity.ai/account/api> | ||
| - Agents SDK | ||
|
aubreyquinn marked this conversation as resolved.
|
||
|
|
||
| ## How to run this sample | ||
|
|
||
| ### 1. Setup environment variables | ||
|
|
||
| Copy the template and fill in your values: | ||
|
|
||
| ```powershell | ||
| # Copy the template environment file | ||
| cp .env.template .env | ||
| ``` | ||
|
|
||
| **Minimum required:** | ||
|
|
||
| ```bash | ||
| PERPLEXITY_API_KEY=your_perplexity_api_key_here | ||
| AGENT_ID=perplexity-agent | ||
| PORT=3978 | ||
| ``` | ||
|
|
||
| **For production/M365 integration, also add:** | ||
|
|
||
| ```bash | ||
| CLIENT_ID=your_bot_app_id | ||
| CLIENT_SECRET=your_bot_secret | ||
| TENANT_ID=your_tenant_id | ||
| ``` | ||
|
|
||
| See `.env.template` for all available options. | ||
|
|
||
| ### 2. Install dependencies | ||
|
|
||
| ```powershell | ||
| npm install | ||
| ``` | ||
|
|
||
| ### 3. Build the sample | ||
|
|
||
| ```powershell | ||
| npm run build | ||
| ``` | ||
|
|
||
| ### 4. Start the agent | ||
|
|
||
| ```powershell | ||
| npm start | ||
| ``` | ||
|
|
||
| You should see: | ||
|
|
||
| ```powershell | ||
| 🚀 Perplexity Agent listening on port 3978 | ||
| App ID: your-app-id | ||
| Debug: false | ||
|
|
||
| ✅ Agent ready to receive messages! | ||
| ``` | ||
|
|
||
| ### 5. To test with M365 Agents Playground | ||
|
|
||
| In a new terminal: | ||
|
|
||
| ```powershell | ||
| npm run test-tool | ||
| ``` | ||
|
|
||
| This opens the M365 Agents Playground where you can chat with your agent. | ||
|
|
||
| ### 5. Optionally, while testing you can run in dev mode (auto-reload) | ||
|
|
||
| ```powershell | ||
| npm run dev | ||
| ``` | ||
|
|
||
| This watches for file changes and auto-restarts the server. | ||
|
|
||
| The agent will start and be ready to receive requests through the configured hosting mechanism. | ||
|
aubreyquinn marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.