feat(tools): added perplexity search endpoint, updated models list for perplexity block#1812
Merged
waleedlatif1 merged 1 commit intostagingfrom Nov 5, 2025
Merged
feat(tools): added perplexity search endpoint, updated models list for perplexity block#1812waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1 merged 1 commit intostagingfrom
Conversation
…r perplexity block
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds Perplexity search endpoint support, extending the existing Perplexity integration beyond chat to include web search functionality.
Key Changes
- Added new
perplexity_searchtool with support for advanced filtering (domain, country, recency, date ranges) - Updated Perplexity block with operation dropdown to switch between Chat and Search modes
- Refreshed model list to include current Perplexity models (Sonar, Sonar Pro, Sonar Deep Research, Sonar Reasoning variants)
- Added conditional field rendering based on selected operation
- Implemented domain filter parsing from comma-separated string to array
- Updated documentation to reflect new search capabilities
Implementation
The implementation follows established patterns in the codebase, with proper TypeScript typing and consistent structure matching other search tools like Tavily and Exa. The block config properly handles conditional field display and parameter transformation for both operations.
Confidence Score: 4/5
- This PR is safe to merge with minor considerations
- The implementation is well-structured and follows existing patterns. No critical bugs found. Score reduced from 5 due to lack of error handling for malformed API responses and no validation for numeric constraints (max_results 1-20, max 20 domains)
- Pay attention to
apps/sim/tools/perplexity/search.tsfor potential runtime errors with malformed API responses
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/tools/perplexity/search.ts | 4/5 | New search tool implementation following established patterns, proper TypeScript typing and API integration |
| apps/sim/tools/perplexity/types.ts | 5/5 | Added TypeScript interfaces for search params and response, clean type definitions |
| apps/sim/blocks/blocks/perplexity.ts | 4/5 | Updated block config with operation dropdown and conditional fields, models list updated, proper parameter transformation |
Sequence Diagram
sequenceDiagram
participant User
participant PerplexityBlock
participant ToolConfig
participant PerplexityAPI
User->>PerplexityBlock: Select operation (Chat/Search)
alt Search Operation
User->>PerplexityBlock: Enter search query & filters
PerplexityBlock->>PerplexityBlock: Parse domain filter (comma-separated to array)
PerplexityBlock->>ToolConfig: Route to perplexity_search tool
ToolConfig->>PerplexityAPI: POST /search with query & filters
PerplexityAPI-->>ToolConfig: Return search results
ToolConfig->>ToolConfig: Transform response (map results)
ToolConfig-->>User: Return formatted search results
else Chat Operation
User->>PerplexityBlock: Enter prompt & model selection
PerplexityBlock->>ToolConfig: Route to perplexity_chat tool
ToolConfig->>PerplexityAPI: POST /chat/completions
PerplexityAPI-->>ToolConfig: Return chat completion
ToolConfig->>ToolConfig: Transform response
ToolConfig-->>User: Return chat response
end
6 files reviewed, 1 comment
10 tasks
waleedlatif1
added a commit
that referenced
this pull request
Nov 12, 2025
…r perplexity block (#1812)
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.
Summary
added perplexity search endpoint, updated models list for perplexity block
Fixes #1795
Type of Change
Testing
Tested manually
Checklist