Expanding Perplexity providerOptions to include e.g. search_mode, web_search_options, web_search_options etc.
Description
These options are helpful to refine search results. Or, if I add them to providerOptions.perplexity (despite not being defined in the sdk), will they be passed any way?
AI SDK Version
"@ai-sdk/gateway": "^1.0.11", "@ai-sdk/perplexity": "^2.0.5", "ai": "^5.0.22",
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
yes, all the options gets passed (check https://github.com/vercel/ai/blob/ca67e5a06eb7c4a300cbe3fd7fc995ac2746d3f4/packages/perplexity/src/perplexity-language-model.ts#L109), test if it works
I'm unable to get this to work. Does it work for anyone else? These options would be super helpful to have!
@gr2m While working on #12269, I realized we don't have any *ProviderOptions definition for Perplexity; we just pass everything through as is that's in there.
Would it make sense to add a type here?
Identify issue type
Identified type: Feature
Confidence: High
Rationale: The issue is primarily requesting API/type support and improved provider option ergonomics for Perplexity, not reporting a clearly demonstrated broken behavior.
Evidence:
- The description asks to expand Perplexity
providerOptionsto include options likesearch_modeandweb_search_options, noting they would help refine search results. - The reporter asks whether unspecified options are passed through despite not being defined in the SDK.
- A maintainer/commenter states all options are passed through, and a later comment notes Perplexity lacks a
*ProviderOptionstype and asks whether one should be added.
Hi @gr2m — I'd like to work on adding typed PerplexityProviderOptions (e.g. searchMode / webSearchOptions) for #8241, following other providers' option patterns. Options already pass through; this would mainly be types + docs/tests as needed.
OK if I open a PR, or are you already on this?
resolved via https://github.com/vercel/ai/pull/15006 so marking this as closed