Fix AttributeError in perplexity_async and update supported models (gpt 5.2 and grok 4.1) #79

Merged
luizslvr merged 2 commits from fix-async-and-new-models into main 2025-12-13 02:02:07 -05:00
luizslvr commented 2025-12-12 21:23:19 -05:00 (Migrated from github.com)

Description

This PR addresses an AttributeError in the perplexity_async module and updates the list of supported models for Perplexity AI.

Changes Made

  1. Added __init__.py to perplexity_async module:

    • Enables proper importing of Client, Emailnator, and LabsClient classes.
    • Mirrors the structure of the synchronous perplexity module.
    • Fixes AttributeError: module 'perplexity_async' has no attribute 'Client'.
  2. Updated supported models:

    • Expanded the model lists in the search method assertions to include newly supported models like grok-4.1, gpt-5.2, etc., for various modes (pro, reasoning, etc.).

Why These Changes

  • The missing __init__.py prevented users from importing the async client as shown in the documentation/examples.
  • Model updates ensure compatibility with the latest Perplexity AI offerings.

Testing

  • Verified that import perplexity_async; client = await perplexity_async.Client() now works without errors.
  • Confirmed model assertions pass with the new lists.
## Description This PR addresses an `AttributeError` in the `perplexity_async` module and updates the list of supported models for Perplexity AI. ### Changes Made 1. **Added `__init__.py` to `perplexity_async` module**: - Enables proper importing of `Client`, `Emailnator`, and `LabsClient` classes. - Mirrors the structure of the synchronous `perplexity` module. - Fixes `AttributeError: module 'perplexity_async' has no attribute 'Client'`. 2. **Updated supported models**: - Expanded the model lists in the `search` method assertions to include newly supported models like `grok-4.1`, `gpt-5.2`, etc., for various modes (pro, reasoning, etc.). ### Why These Changes - The missing `__init__.py` prevented users from importing the async client as shown in the documentation/examples. - Model updates ensure compatibility with the latest Perplexity AI offerings. ### Testing - Verified that `import perplexity_async; client = await perplexity_async.Client()` now works without errors. - Confirmed model assertions pass with the new lists.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
helallao/perplexity-ai!79
No description provided.