Add domain filtering #40
Open
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.
This pull request introduces enhancements to the
perplexity-ask
tool, adding new features like domain filtering and model selection, while also updating dependencies and documentation. The changes focus on improving functionality, flexibility, and developer usability.Tool Enhancements:
search_domain_filter
inperplexity_ask
,perplexity_research
, andperplexity_reason
tools to limit or denylist search domains. This parameter accepts up to 10 domains. [1] [2] [3]model
parameter forperplexity_ask
andperplexity_reason
tools, allowing users to specify models likesonar
,sonar-pro
,sonar-reasoning
, orsonar-reasoning-pro
. Defaults are provided for each tool. [1] [2]Code Updates:
performChatCompletion
function to handlesearch_domain_filter
and validate the number of domains. Added logic to prioritize user input, environment variables, and defaults for domain filtering. [1] [2]Documentation Improvements:
README.md
to include details on domain filtering and model selection, along with environment variable setup instructions forPERPLEXITY_SEARCH_DOMAIN_FILTER
. [1] [2]Dependency Updates:
axios
anddotenv
to enhance API handling and environment variable support. Updated@types/node
and other packages to their latest versions. [1] [2] [3]These changes collectively improve the functionality and usability of the
perplexity-ask
tool for developers and end-users.