ai icon indicating copy to clipboard operation
ai copied to clipboard

Expanding Perplexity providerOptions to include e.g. search_mode, web_search_options, web_search_options etc.

Open yihuanlin opened this issue 1 year ago • 6 comments

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

yihuanlin avatar Aug 23 '25 17:08 yihuanlin

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

imranbarbhuiya avatar Aug 24 '25 03:08 imranbarbhuiya

I'm unable to get this to work. Does it work for anyone else? These options would be super helpful to have!

gijsverheijke avatar Sep 21 '25 07:09 gijsverheijke

@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?

felixarntz avatar Feb 11 '26 16:02 felixarntz

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 providerOptions to include options like search_mode and web_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 *ProviderOptions type and asks whether one should be added.

lgrammel avatar Jul 02 '26 09:07 lgrammel

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?

maxiaochaos avatar Oct 10 '26 08:10 maxiaochaos

resolved via https://github.com/vercel/ai/pull/15006 so marking this as closed

aayush-kapoor avatar Oct 16 '26 16:10 aayush-kapoor