Python SDK - search API - country filter

:bug: Describe the Bug

When attempting a regional search using the python SDK, a interpreter error is returned.

:white_check_mark: Expected Behavior

The search should go through

:cross_mark: Actual Behavior

Python Interpreter Error:

Traceback (most recent call last): File “_udf_code.py”, line 16, in main search = client.search.create( ^^^^^^^^^^^^^^^^^^^^^ TypeError: SearchResource.create() got an unexpected keyword argument ‘country’ in function F_PROMPT_TO_PERPLEXITY_SEARCH with handler main

:counterclockwise_arrows_button: Steps to Reproduce

  1. Create a function using perplexityai-0.19.0-py3-none-any.whl
from perplexity import Perplexity

def main(prompt: str) → dict:
    client = Perplexity(api_key=[API KEY HERE])

    # Make the API call
    search = client.search.create(
        query=prompt,
        country="CH",
        max_results=5,
        max_tokens_per_page=1024
    )

    # Extract search result text and URLs
    search_results = []
    for result in search.results:
        search_result = {
            'doc_title': result.title,
            'doc_id': result.url,
            'text': result.snippet
        }
        search_results.append(search_result)

    return search_results
  1. Execute the function
  2. Observe the error.

:pushpin: API Request & Response (if applicable)

n/a

:globe_showing_europe_africa: Environment

  • API Version: n/a
  • SDK (if applicable): Python SDK v0.19.0
  • Operating System: n/a

:paperclip: Logs or Screenshots (if applicable)

n/a

:memo: Additional Context

n/a