Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.22.0"
".": "0.22.1"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.22.1 (2025-12-08)

Full Changelog: [v0.22.0...v0.22.1](https://github.com/perplexityai/perplexity-py/compare/v0.22.0...v0.22.1)

### Bug Fixes

* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([1dae6e5](https://github.com/perplexityai/perplexity-py/commit/1dae6e56a918d3ac6cbc38accd3058c169199515))


### Chores

* add missing docstrings ([be56ae3](https://github.com/perplexityai/perplexity-py/commit/be56ae34c5342b345e53b706c006f6a873e1db74))

## 0.22.0 (2025-12-05)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/perplexityai/perplexity-py/compare/v0.21.0...v0.22.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "perplexityai"
version = "0.22.0"
version = "0.22.1"
description = "The official Python library for the perplexity API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
5 changes: 3 additions & 2 deletions src/perplexity/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False):
if TYPE_CHECKING:
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
#
# Note: index() and count() methods are intentionally omitted to allow pyright to properly
# infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
Expand All @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
def __contains__(self, value: object, /) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
def count(self, value: Any, /) -> int: ...
def __reversed__(self) -> Iterator[_T_co]: ...
else:
# just point this to a normal `Sequence` at runtime to avoid having to special case
Expand Down
2 changes: 1 addition & 1 deletion src/perplexity/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "perplexity"
__version__ = "0.22.0" # x-release-please-version
__version__ = "0.22.1" # x-release-please-version
8 changes: 8 additions & 0 deletions src/perplexity/types/shared/chat_message_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,30 @@ class ContentStructuredContentChatMessageContentVideoChunk(BaseModel):


class ReasoningStepExecutePython(BaseModel):
"""Code generation step details wrapper class"""

code: str

result: str


class ReasoningStepFetchURLContent(BaseModel):
"""Fetch url content step details wrapper class"""

contents: List[APIPublicSearchResult]


class ReasoningStepWebSearch(BaseModel):
"""Web search step details wrapper class"""

search_keywords: List[str]

search_results: List[APIPublicSearchResult]


class ReasoningStep(BaseModel):
"""Reasoning step wrapper class"""

thought: str

execute_python: Optional[ReasoningStepExecutePython] = None
Expand Down
8 changes: 8 additions & 0 deletions src/perplexity/types/shared/chat_message_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,30 @@ class ContentStructuredContentChatMessageContentVideoChunk(BaseModel):


class ReasoningStepExecutePython(BaseModel):
"""Code generation step details wrapper class"""

code: str

result: str


class ReasoningStepFetchURLContent(BaseModel):
"""Fetch url content step details wrapper class"""

contents: List[APIPublicSearchResult]


class ReasoningStepWebSearch(BaseModel):
"""Web search step details wrapper class"""

search_keywords: List[str]

search_results: List[APIPublicSearchResult]


class ReasoningStep(BaseModel):
"""Reasoning step wrapper class"""

thought: str

execute_python: Optional[ReasoningStepExecutePython] = None
Expand Down
8 changes: 8 additions & 0 deletions src/perplexity/types/shared_params/chat_message_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,30 @@ class ContentStructuredContentChatMessageContentVideoChunk(TypedDict, total=Fals


class ReasoningStepExecutePython(TypedDict, total=False):
"""Code generation step details wrapper class"""

code: Required[str]

result: Required[str]


class ReasoningStepFetchURLContent(TypedDict, total=False):
"""Fetch url content step details wrapper class"""

contents: Required[Iterable[APIPublicSearchResult]]


class ReasoningStepWebSearch(TypedDict, total=False):
"""Web search step details wrapper class"""

search_keywords: Required[SequenceNotStr[str]]

search_results: Required[Iterable[APIPublicSearchResult]]


class ReasoningStep(TypedDict, total=False):
"""Reasoning step wrapper class"""

thought: Required[str]

execute_python: Optional[ReasoningStepExecutePython]
Expand Down