Skip to content
Merged
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.26.0"
".": "0.27.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-6ce12aa99a5f333ab79b62256b6e78ffeaf103c08f199c90e8122b9496bb0e85.yml
openapi_spec_hash: 22caa3446c4d9eaadbf185d5a70e8810
config_hash: 2a2b777ab44d79bde60bf3d1b5a2ed7b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-3ee0511fa1bf59b2bb44d947f7d884fd8522ef872d33bab141874941b76f1dd7.yml
openapi_spec_hash: 394bbfe74954625b70de9c85d553e3d0
config_hash: c7d506cdee510785b58defa1a626e20b
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.27.0 (2026-01-27)

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

### Features

* **api:** manual updates ([93a74f7](https://github.com/perplexityai/perplexity-py/commit/93a74f706faa240308546e28efbaffd71b280d3e))

## 0.26.0 (2026-01-24)

Full Changelog: [v0.25.0...v0.26.0](https://github.com/perplexityai/perplexity-py/compare/v0.25.0...v0.26.0)
Expand Down
3 changes: 3 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ from perplexity.types import (
Annotation,
ContentPart,
ErrorInfo,
FunctionCallOutputItem,
FunctionTool,
InputItem,
OutputItem,
ResponseStreamChunk,
ResponsesCreateParams,
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.26.0"
version = "0.27.0"
description = "The official Python library for the perplexity API"
dynamic = ["readme"]
license = "Apache-2.0"
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.26.0" # x-release-please-version
__version__ = "0.27.0" # x-release-please-version
29 changes: 15 additions & 14 deletions src/perplexity/resources/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
from .._streaming import Stream, AsyncStream
from .._base_client import make_request_options
from ..types.input_item_param import InputItemParam
from ..types.response_stream_chunk import ResponseStreamChunk
from ..types.response_create_response import ResponseCreateResponse
from ..types.shared_params.response_format import ResponseFormat
Expand Down Expand Up @@ -51,7 +52,7 @@ def with_streaming_response(self) -> ResponsesResourceWithStreamingResponse:
def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
max_output_tokens: int | Omit = omit,
Expand All @@ -75,7 +76,7 @@ def create(
reasoning.

Args:
input: Input content - either a string or array of input messages
input: Input content - either a string or array of input items

instructions: System instructions for the model

Expand Down Expand Up @@ -119,7 +120,7 @@ def create(
def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
stream: Literal[True],
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
Expand All @@ -143,7 +144,7 @@ def create(
reasoning.

Args:
input: Input content - either a string or array of input messages
input: Input content - either a string or array of input items

stream: If true, returns SSE stream instead of JSON

Expand Down Expand Up @@ -187,7 +188,7 @@ def create(
def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
stream: bool,
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
Expand All @@ -211,7 +212,7 @@ def create(
reasoning.

Args:
input: Input content - either a string or array of input messages
input: Input content - either a string or array of input items

stream: If true, returns SSE stream instead of JSON

Expand Down Expand Up @@ -255,7 +256,7 @@ def create(
def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
max_output_tokens: int | Omit = omit,
Expand Down Expand Up @@ -328,7 +329,7 @@ def with_streaming_response(self) -> AsyncResponsesResourceWithStreamingResponse
async def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
max_output_tokens: int | Omit = omit,
Expand All @@ -352,7 +353,7 @@ async def create(
reasoning.

Args:
input: Input content - either a string or array of input messages
input: Input content - either a string or array of input items

instructions: System instructions for the model

Expand Down Expand Up @@ -396,7 +397,7 @@ async def create(
async def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
stream: Literal[True],
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
Expand All @@ -420,7 +421,7 @@ async def create(
reasoning.

Args:
input: Input content - either a string or array of input messages
input: Input content - either a string or array of input items

stream: If true, returns SSE stream instead of JSON

Expand Down Expand Up @@ -464,7 +465,7 @@ async def create(
async def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
stream: bool,
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
Expand All @@ -488,7 +489,7 @@ async def create(
reasoning.

Args:
input: Input content - either a string or array of input messages
input: Input content - either a string or array of input items

stream: If true, returns SSE stream instead of JSON

Expand Down Expand Up @@ -532,7 +533,7 @@ async def create(
async def create(
self,
*,
input: Union[str, Iterable[response_create_params.InputInputMessageArray]],
input: Union[str, Iterable[InputItemParam]],
instructions: str | Omit = omit,
language_preference: str | Omit = omit,
max_output_tokens: int | Omit = omit,
Expand Down
3 changes: 3 additions & 0 deletions src/perplexity/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
from .content_part import ContentPart as ContentPart
from .stream_chunk import StreamChunk as StreamChunk
from .responses_usage import ResponsesUsage as ResponsesUsage
from .input_item_param import InputItemParam as InputItemParam
from .function_tool_param import FunctionToolParam as FunctionToolParam
from .search_create_params import SearchCreateParams as SearchCreateParams
from .response_stream_chunk import ResponseStreamChunk as ResponseStreamChunk
from .response_create_params import ResponseCreateParams as ResponseCreateParams
from .search_create_response import SearchCreateResponse as SearchCreateResponse
from .response_create_response import ResponseCreateResponse as ResponseCreateResponse
from .function_call_output_item import FunctionCallOutputItem as FunctionCallOutputItem
28 changes: 28 additions & 0 deletions src/perplexity/types/function_call_output_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from .._models import BaseModel

__all__ = ["FunctionCallOutputItem"]


class FunctionCallOutputItem(BaseModel):
id: str

arguments: str
"""JSON string of arguments"""

call_id: str
"""Correlates with function_call_output input"""

name: str

status: Literal["completed", "failed", "in_progress", "requires_action"]
"""Status of a response or output item"""

type: Literal["function_call"]

thought_signature: Optional[str] = None
"""Base64-encoded opaque signature for thinking models"""
24 changes: 24 additions & 0 deletions src/perplexity/types/function_tool_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Dict
from typing_extensions import Literal, Required, TypedDict

__all__ = ["FunctionToolParam"]


class FunctionToolParam(TypedDict, total=False):
name: Required[str]
"""The name of the function"""

type: Required[Literal["function"]]

description: str
"""A description of what the function does"""

parameters: Dict[str, object]
"""JSON Schema defining the function's parameters"""

strict: bool
"""Whether to enable strict schema validation"""
66 changes: 66 additions & 0 deletions src/perplexity/types/input_item_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Literal, Required, TypeAlias, TypedDict

__all__ = [
"InputItemParam",
"InputMessage",
"InputMessageContentContentPartArray",
"FunctionCallOutputInput",
"FunctionCallInput",
]


class InputMessageContentContentPartArray(TypedDict, total=False):
type: Required[Literal["input_text", "input_image"]]

image_url: str

text: str


class InputMessage(TypedDict, total=False):
content: Required[Union[str, Iterable[InputMessageContentContentPartArray]]]
"""Message content - either a string or array of content parts"""

role: Required[Literal["user", "assistant", "system", "developer"]]

type: Required[Literal["message"]]


class FunctionCallOutputInput(TypedDict, total=False):
call_id: Required[str]
"""The call_id from function_call output"""

output: Required[str]
"""Function result (JSON string)"""

type: Required[Literal["function_call_output"]]

name: str
"""Function name (required by some providers)"""

thought_signature: str
"""Base64-encoded signature from function_call"""


class FunctionCallInput(TypedDict, total=False):
arguments: Required[str]
"""Function arguments (JSON string)"""

call_id: Required[str]
"""The call_id that correlates with function_call_output"""

name: Required[str]
"""The function name"""

type: Required[Literal["function_call"]]

thought_signature: str
"""Base64-encoded signature for thinking models"""


InputItemParam: TypeAlias = Union[InputMessage, FunctionCallOutputInput, FunctionCallInput]
6 changes: 4 additions & 2 deletions src/perplexity/types/output_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .._models import BaseModel
from .content_part import ContentPart
from .shared.search_result import SearchResult
from .function_call_output_item import FunctionCallOutputItem

__all__ = [
"OutputItem",
Expand All @@ -25,7 +26,7 @@ class MessageOutputItem(BaseModel):
role: Literal["assistant"]
"""Role in a message"""

status: Literal["completed", "failed", "in_progress"]
status: Literal["completed", "failed", "in_progress", "requires_action"]
"""Status of a response or output item"""

type: Literal["message"]
Expand Down Expand Up @@ -59,5 +60,6 @@ class FetchURLResultsOutputItem(BaseModel):


OutputItem: TypeAlias = Annotated[
Union[MessageOutputItem, SearchResultsOutputItem, FetchURLResultsOutputItem], PropertyInfo(discriminator="type")
Union[MessageOutputItem, SearchResultsOutputItem, FetchURLResultsOutputItem, FunctionCallOutputItem],
PropertyInfo(discriminator="type"),
]
Loading
Loading