Describe the Bug
There are significant differences between the Search API docs, the actual implementation shown in the Search API references and the SDKs and their docs:
search_recency_filter
does not exist as option in endpoint or Typescript SDK or Python SDK, the latter being reported herereturn_images
also does not exist in API references or in Typescript SDK. Likewise, does not include it in theSearchCreateResponse.Result
typings either- Same for
return_snippets
,user_location_filter
, and more, basically almost everything listed in the advanced search for the SDK canโt be used: - for many options thereโs a discrepancy in casing between docs and SDKs, e.g all Quick Start examples for Typescript SDK use
maxTokens
but the typings expectmax_tokens
Expected Behavior
I expect the API docs to match the actual implementation and SDKs and their typings
Actual Behavior
Endpoint and/or SDK do not support all options mentioned in API docs
API Request & Response
E.g. Best Practices examples for Typescript say:
const webSearch = await client.search.create({
query: "latest tech news",
searchMode: "web",
searchRecencyFilter: "day"
});
When based on the typings it should be:
const webSearch = await client.search.create({
query: "latest tech news",
search_mode: "web",
search_recency_filter: "day"
});
But even then search_recency_filter
does not exist in the typings.
Environment
- API Version: Search API
- SDK (if applicable): Python, Typescript (@perplexity-ai/perplexity_ai v0.6.0)
- Operating System: all of them
Additional Context
Mismatched documentation also applies to the GitHub repo readme accessible through npm where the documented code examples are not what the underlying library expects. The linked api.md in there leads to 404 on GitHub as I would assume the underlying GitHub repo has not been made public for whatever reason. All in all a pretty frustrating experience trying to use this new API where all developer touchpoints are either wrong or incomplete or not accessible.