Unable to make it work with perplexity pro enterprise account #68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
I've been trying to make it work but got no luck at all. I just downloaded it today (last version). I've seen you added support to the newest models (but system logs still saying gpt4 and grok 2 for example).
{
"query": "test",
"mode": "pro",
"model": "gpt5",
"sources": ["web"]
}
Traceback (most recent call last):
File "/app.py", line 24, in search
resp = client.search(query, mode=mode, model=model, sources=sources, stream=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/perplexity/client.py", line 87, in search
assert model in {
^^^^^^^^^^
AssertionError: Models for modes -> {
'auto': [None],
'pro': [None, 'sonar', 'gpt-4.5', 'gpt-4o', 'claude 3.7 sonnet', 'gemini 2.0 flash', 'grok-2'],
'reasoning': [None, 'r1', 'o3-mini', 'claude 3.7 sonnet'],
'deep research': [None]
}
172.18.0.2 - - [12/Sep/2025 10:28:28] "POST /search HTTP/1.1" 500 -
{
"query": "test",
"mode": "pro",
"model": "sonar",
"sources": ["web"]
}
Traceback (most recent call last):
File "/app.py", line 24, in search
resp = client.search(query, mode=mode, model=model, sources=sources, stream=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/perplexity/client.py", line 206, in search
content_json['text'] = json.loads(content_json['text'])
~~~~~~~~~~~~^^^^^^^^
KeyError: 'text'
172.18.0.2 - - [12/Sep/2025 10:29:23] "POST /search HTTP/1.1" 500 -
is this still active?
Same problem here. I have to manually modify & add the model name in the client.py to solve it, like gpt5 and o3.
This issue occurs because the model endpoints have changed in the latest Perplexity update. The error shows two problems:
Solution
I've created a pull request with fixes for the async implementation and proper error handling:
These PRs include updated async methods with proper error handling for the new response structure. You can use these branches directly while waiting for the merge, or apply the changes manually from the pull requests.
Note: The sync version may still have similar issues with the updated endpoints that need to be addressed separately.