-
-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for perplexity sonar #1319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 73a9061 in 51 seconds
More details
- Looked at
415
lines of code in14
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. instructor/__init__.py:102
- Draft comment:
Add a newline at the end of the file for consistency and to follow best practices. - Reason this comment was not posted:
Confidence changes required:10%
The code ininstructor/__init__.py
is missing a newline at the end of the file. This is a minor issue but it's a good practice to have a newline at the end of files.
2. instructor/client_perplexity.py:63
- Draft comment:
Add a newline at the end of the file for consistency and to follow best practices. - Reason this comment was not posted:
Confidence changes required:10%
The code ininstructor/client_perplexity.py
is missing a newline at the end of the file. This is a minor issue but it's a good practice to have a newline at the end of files.
3. instructor/reask.py:374
- Draft comment:
Add a newline at the end of the file for consistency and to follow best practices. - Reason this comment was not posted:
Confidence changes required:10%
The code ininstructor/reask.py
is missing a newline at the end of the file. This is a minor issue but it's a good practice to have a newline at the end of files.
4. README.md:298
- Draft comment:
If a newmd
file is created for Perplexity Sonar Models, ensure it's added tomkdocs.yml
for documentation purposes. - Reason this comment was not posted:
Confidence changes required:50%
The newmd
file for Perplexity Sonar Models should be added tomkdocs.yml
for documentation purposes.
Workflow ID: wflow_GOqpyzQWupTnARBD
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
this resolves #1005 , but the structured outputs problem has been also discussed here #909 Maybe it would be worth to make it more universal? BTW, if you add "name" to the json_schema object, then the same |
Perplexity released their Sonar API with structured outputs which is not compatible with any of the existing function calling methods currently implemented. Rest of the API is similar to OpenAI.
See references:
Implemented it with a new client, but don't have a strong opinion on keeping it vs only keeping the new mode.
Important
Add support for Perplexity Sonar API with new client and mode, including JSON handling and tests.
from_perplexity
inclient_perplexity.py
.PERPLEXITY_JSON
mode inmode.py
for handling structured outputs.process_response.py
andreask.py
to handlePERPLEXITY_JSON
mode.handle_perplexity_json()
inprocess_response.py
for processing JSON responses.reask_perplexity_json()
inreask.py
for reasking logic.test_perplexity
directory withconftest.py
andtest_modes.py
for testing Perplexity integration.util.py
.This description was created by
for 73a9061. It will automatically update as commits are pushed.