Describe the Bug
When attempting a regional search using the python SDK, a interpreter error is returned.
Expected Behavior
The search should go through
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
Steps to Reproduce
- 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
- Execute the function
- Observe the error.
API Request & Response (if applicable)
n/a
Environment
- API Version: n/a
- SDK (if applicable): Python SDK v0.19.0
- Operating System: n/a
Logs or Screenshots (if applicable)
n/a
Additional Context
n/a