Docs have non working code: Completions.create() got an unexpected keyword argument 'search_mode'

:bug: Describe the Bug

Example code doesn’t take search_mode, OpenAI rejects it
Error: Completions.create() got an unexpected keyword argument ‘search_mode’

:white_check_mark: Expected Behavior

docs.perplexity.ai/guides/chat-completions-guide

Docs should have working code!

:cross_mark: Actual Behavior

Error: Completions.create() got an unexpected keyword argument ‘search_mode’

Working code

I cannot give you working code as you stop me posting >2 links, which includes ANY urls in the code!!! I’m only here because you shut down the api_discussion github

The answer is to use extra_body

 extra_body={
        "search_mode": "web",
        "search_domain_filter": ["government.gov", "nature.com", "science.org"],
        "search_recency_filter": "month",
        "return_citations": True
    }

Thank you for bringing this up! We just pushed a fix to the docs.