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.29.1"
".": "0.30.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-78325ecc9bdc8e9850866fcdd3be3d209b06f151059c774afc7e6005a1775f09.yml
openapi_spec_hash: 19a34c8ddd46f81dd0b0850af5ee42f3
config_hash: c3b93f1bb8fa365d5a83e83b7e13e6c4
configured_endpoints: 23
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-e7ac06ada1aa9e0a37a95c1aa5927efe563fc2683c7a144638fa8bd6f68012ac.yml
openapi_spec_hash: 3ced2367a3f063e4eddce3a3253a4087
config_hash: 12ef310e24ea5bae135eacbbe1a391ca
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.30.0 (2026-02-12)

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

### Features

* **api:** Add browser and sandbox API endpoints ([f5c3e58](https://github.com/perplexityai/perplexity-py/commit/f5c3e58836feb37a6b9ba366a55811513a8cd28c))

## 0.29.1 (2026-02-12)

Full Changelog: [v0.29.0...v0.29.1](https://github.com/perplexityai/perplexity-py/compare/v0.29.0...v0.29.1)
Expand Down
65 changes: 65 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@
```python
from perplexity.types import (
APIPublicSearchResult,
BrowserSessionResponse,
ChatMessageInput,
ChatMessageOutput,
Choice,
ContextualizedEmbeddingObject,
EmbeddingObject,
EmbeddingsUsage,
ExecuteCodeResponse,
FileEntry,
JsonSchemaFormat,
ListFilesResponse,
ListProcessesResponse,
ModifiedFilesResponse,
PauseSandboxResponse,
ProcessInfo,
ReadFileResponse,
ResponseFormat,
SandboxSessionResponse,
SearchResult,
UsageInfo,
UserLocation,
WebSearchOptions,
WriteFileResponse,
)
```

Expand Down Expand Up @@ -92,6 +103,60 @@ Methods:

- <code title="post /v1/contextualizedembeddings">client.contextualized_embeddings.<a href="./src/perplexity/resources/contextualized_embeddings.py">create</a>(\*\*<a href="src/perplexity/types/contextualized_embedding_create_params.py">params</a>) -> <a href="./src/perplexity/types/contextualized_embedding_create_response.py">ContextualizedEmbeddingCreateResponse</a></code>

# Browser

## Sessions

Methods:

- <code title="post /v1/browser/sessions">client.browser.sessions.<a href="./src/perplexity/resources/browser/sessions.py">create</a>() -> <a href="./src/perplexity/types/shared/browser_session_response.py">BrowserSessionResponse</a></code>
- <code title="delete /v1/browser/sessions/{session_id}">client.browser.sessions.<a href="./src/perplexity/resources/browser/sessions.py">delete</a>(session_id) -> None</code>

# Sandbox

## Sessions

Methods:

- <code title="post /v1/sandbox/sessions">client.sandbox.sessions.<a href="./src/perplexity/resources/sandbox/sessions/sessions.py">create</a>(\*\*<a href="src/perplexity/types/sandbox/session_create_params.py">params</a>) -> <a href="./src/perplexity/types/shared/sandbox_session_response.py">SandboxSessionResponse</a></code>
- <code title="delete /v1/sandbox/sessions/{session_id}">client.sandbox.sessions.<a href="./src/perplexity/resources/sandbox/sessions/sessions.py">delete</a>(session_id) -> None</code>
- <code title="get /v1/sandbox/sessions/{session_id}">client.sandbox.sessions.<a href="./src/perplexity/resources/sandbox/sessions/sessions.py">get</a>(session_id) -> <a href="./src/perplexity/types/shared/sandbox_session_response.py">SandboxSessionResponse</a></code>

### Execute

Methods:

- <code title="post /v1/sandbox/sessions/{session_id}/execute">client.sandbox.sessions.execute.<a href="./src/perplexity/resources/sandbox/sessions/execute.py">create</a>(session_id, \*\*<a href="src/perplexity/types/sandbox/sessions/execute_create_params.py">params</a>) -> <a href="./src/perplexity/types/shared/execute_code_response.py">ExecuteCodeResponse</a></code>

### Pause

Methods:

- <code title="post /v1/sandbox/sessions/{session_id}/pause">client.sandbox.sessions.pause.<a href="./src/perplexity/resources/sandbox/sessions/pause.py">create</a>(session_id) -> <a href="./src/perplexity/types/shared/pause_sandbox_response.py">PauseSandboxResponse</a></code>

### Resume

Methods:

- <code title="post /v1/sandbox/sessions/{session_id}/resume">client.sandbox.sessions.resume.<a href="./src/perplexity/resources/sandbox/sessions/resume.py">create</a>(session_id, \*\*<a href="src/perplexity/types/sandbox/sessions/resume_create_params.py">params</a>) -> <a href="./src/perplexity/types/shared/sandbox_session_response.py">SandboxSessionResponse</a></code>

### Files

Methods:

- <code title="get /v1/sandbox/sessions/{session_id}/files/list">client.sandbox.sessions.files.<a href="./src/perplexity/resources/sandbox/sessions/files.py">list</a>(session_id, \*\*<a href="src/perplexity/types/sandbox/sessions/file_list_params.py">params</a>) -> <a href="./src/perplexity/types/shared/list_files_response.py">ListFilesResponse</a></code>
- <code title="get /v1/sandbox/sessions/{session_id}/files/modified">client.sandbox.sessions.files.<a href="./src/perplexity/resources/sandbox/sessions/files.py">modified</a>(session_id) -> <a href="./src/perplexity/types/shared/modified_files_response.py">ModifiedFilesResponse</a></code>
- <code title="get /v1/sandbox/sessions/{session_id}/files">client.sandbox.sessions.files.<a href="./src/perplexity/resources/sandbox/sessions/files.py">read</a>(session_id, \*\*<a href="src/perplexity/types/sandbox/sessions/file_read_params.py">params</a>) -> <a href="./src/perplexity/types/shared/read_file_response.py">ReadFileResponse</a></code>
- <code title="post /v1/sandbox/sessions/{session_id}/files">client.sandbox.sessions.files.<a href="./src/perplexity/resources/sandbox/sessions/files.py">write</a>(session_id, \*\*<a href="src/perplexity/types/sandbox/sessions/file_write_params.py">params</a>) -> <a href="./src/perplexity/types/shared/write_file_response.py">WriteFileResponse</a></code>

### Processes

Methods:

- <code title="get /v1/sandbox/sessions/{session_id}/processes">client.sandbox.sessions.processes.<a href="./src/perplexity/resources/sandbox/sessions/processes.py">list</a>(session_id) -> <a href="./src/perplexity/types/shared/list_processes_response.py">ListProcessesResponse</a></code>
- <code title="delete /v1/sandbox/sessions/{session_id}/processes/{pid}">client.sandbox.sessions.processes.<a href="./src/perplexity/resources/sandbox/sessions/processes.py">delete</a>(pid, \*, session_id) -> None</code>
- <code title="get /v1/sandbox/sessions/{session_id}/processes/{pid}">client.sandbox.sessions.processes.<a href="./src/perplexity/resources/sandbox/sessions/processes.py">get</a>(pid, \*, session_id) -> <a href="./src/perplexity/types/shared/process_info.py">ProcessInfo</a></code>

# Async

## Chat
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.29.1"
version = "0.30.0"
description = "The official Python library for the perplexity API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
76 changes: 75 additions & 1 deletion src/perplexity/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
)

if TYPE_CHECKING:
from .resources import chat, async_, search, responses, embeddings, contextualized_embeddings
from .resources import chat, async_, search, browser, sandbox, responses, embeddings, contextualized_embeddings
from .resources.search import SearchResource, AsyncSearchResource
from .resources.chat.chat import ChatResource, AsyncChatResource
from .resources.responses import ResponsesResource, AsyncResponsesResource
from .resources.embeddings import EmbeddingsResource, AsyncEmbeddingsResource
from .resources.async_.async_ import AsyncResource, AsyncAsyncResource
from .resources.browser.browser import BrowserResource, AsyncBrowserResource
from .resources.sandbox.sandbox import SandboxResource, AsyncSandboxResource
from .resources.contextualized_embeddings import (
ContextualizedEmbeddingsResource,
AsyncContextualizedEmbeddingsResource,
Expand Down Expand Up @@ -141,6 +143,18 @@ def contextualized_embeddings(self) -> ContextualizedEmbeddingsResource:

return ContextualizedEmbeddingsResource(self)

@cached_property
def browser(self) -> BrowserResource:
from .resources.browser import BrowserResource

return BrowserResource(self)

@cached_property
def sandbox(self) -> SandboxResource:
from .resources.sandbox import SandboxResource

return SandboxResource(self)

@cached_property
def async_(self) -> AsyncResource:
from .resources.async_ import AsyncResource
Expand Down Expand Up @@ -347,6 +361,18 @@ def contextualized_embeddings(self) -> AsyncContextualizedEmbeddingsResource:

return AsyncContextualizedEmbeddingsResource(self)

@cached_property
def browser(self) -> AsyncBrowserResource:
from .resources.browser import AsyncBrowserResource

return AsyncBrowserResource(self)

@cached_property
def sandbox(self) -> AsyncSandboxResource:
from .resources.sandbox import AsyncSandboxResource

return AsyncSandboxResource(self)

@cached_property
def async_(self) -> AsyncAsyncResource:
from .resources.async_ import AsyncAsyncResource
Expand Down Expand Up @@ -502,6 +528,18 @@ def contextualized_embeddings(self) -> contextualized_embeddings.ContextualizedE

return ContextualizedEmbeddingsResourceWithRawResponse(self._client.contextualized_embeddings)

@cached_property
def browser(self) -> browser.BrowserResourceWithRawResponse:
from .resources.browser import BrowserResourceWithRawResponse

return BrowserResourceWithRawResponse(self._client.browser)

@cached_property
def sandbox(self) -> sandbox.SandboxResourceWithRawResponse:
from .resources.sandbox import SandboxResourceWithRawResponse

return SandboxResourceWithRawResponse(self._client.sandbox)

@cached_property
def async_(self) -> async_.AsyncResourceWithRawResponse:
from .resources.async_ import AsyncResourceWithRawResponse
Expand Down Expand Up @@ -547,6 +585,18 @@ def contextualized_embeddings(

return AsyncContextualizedEmbeddingsResourceWithRawResponse(self._client.contextualized_embeddings)

@cached_property
def browser(self) -> browser.AsyncBrowserResourceWithRawResponse:
from .resources.browser import AsyncBrowserResourceWithRawResponse

return AsyncBrowserResourceWithRawResponse(self._client.browser)

@cached_property
def sandbox(self) -> sandbox.AsyncSandboxResourceWithRawResponse:
from .resources.sandbox import AsyncSandboxResourceWithRawResponse

return AsyncSandboxResourceWithRawResponse(self._client.sandbox)

@cached_property
def async_(self) -> async_.AsyncAsyncResourceWithRawResponse:
from .resources.async_ import AsyncAsyncResourceWithRawResponse
Expand Down Expand Up @@ -592,6 +642,18 @@ def contextualized_embeddings(

return ContextualizedEmbeddingsResourceWithStreamingResponse(self._client.contextualized_embeddings)

@cached_property
def browser(self) -> browser.BrowserResourceWithStreamingResponse:
from .resources.browser import BrowserResourceWithStreamingResponse

return BrowserResourceWithStreamingResponse(self._client.browser)

@cached_property
def sandbox(self) -> sandbox.SandboxResourceWithStreamingResponse:
from .resources.sandbox import SandboxResourceWithStreamingResponse

return SandboxResourceWithStreamingResponse(self._client.sandbox)

@cached_property
def async_(self) -> async_.AsyncResourceWithStreamingResponse:
from .resources.async_ import AsyncResourceWithStreamingResponse
Expand Down Expand Up @@ -637,6 +699,18 @@ def contextualized_embeddings(

return AsyncContextualizedEmbeddingsResourceWithStreamingResponse(self._client.contextualized_embeddings)

@cached_property
def browser(self) -> browser.AsyncBrowserResourceWithStreamingResponse:
from .resources.browser import AsyncBrowserResourceWithStreamingResponse

return AsyncBrowserResourceWithStreamingResponse(self._client.browser)

@cached_property
def sandbox(self) -> sandbox.AsyncSandboxResourceWithStreamingResponse:
from .resources.sandbox import AsyncSandboxResourceWithStreamingResponse

return AsyncSandboxResourceWithStreamingResponse(self._client.sandbox)

@cached_property
def async_(self) -> async_.AsyncAsyncResourceWithStreamingResponse:
from .resources.async_ import AsyncAsyncResourceWithStreamingResponse
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.29.1" # x-release-please-version
__version__ = "0.30.0" # x-release-please-version
28 changes: 28 additions & 0 deletions src/perplexity/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
SearchResourceWithStreamingResponse,
AsyncSearchResourceWithStreamingResponse,
)
from .browser import (
BrowserResource,
AsyncBrowserResource,
BrowserResourceWithRawResponse,
AsyncBrowserResourceWithRawResponse,
BrowserResourceWithStreamingResponse,
AsyncBrowserResourceWithStreamingResponse,
)
from .sandbox import (
SandboxResource,
AsyncSandboxResource,
SandboxResourceWithRawResponse,
AsyncSandboxResourceWithRawResponse,
SandboxResourceWithStreamingResponse,
AsyncSandboxResourceWithStreamingResponse,
)
from .responses import (
ResponsesResource,
AsyncResponsesResource,
Expand Down Expand Up @@ -80,6 +96,18 @@
"AsyncContextualizedEmbeddingsResourceWithRawResponse",
"ContextualizedEmbeddingsResourceWithStreamingResponse",
"AsyncContextualizedEmbeddingsResourceWithStreamingResponse",
"BrowserResource",
"AsyncBrowserResource",
"BrowserResourceWithRawResponse",
"AsyncBrowserResourceWithRawResponse",
"BrowserResourceWithStreamingResponse",
"AsyncBrowserResourceWithStreamingResponse",
"SandboxResource",
"AsyncSandboxResource",
"SandboxResourceWithRawResponse",
"AsyncSandboxResourceWithRawResponse",
"SandboxResourceWithStreamingResponse",
"AsyncSandboxResourceWithStreamingResponse",
"AsyncResource",
"AsyncAsyncResource",
"AsyncResourceWithRawResponse",
Expand Down
33 changes: 33 additions & 0 deletions src/perplexity/resources/browser/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .browser import (
BrowserResource,
AsyncBrowserResource,
BrowserResourceWithRawResponse,
AsyncBrowserResourceWithRawResponse,
BrowserResourceWithStreamingResponse,
AsyncBrowserResourceWithStreamingResponse,
)
from .sessions import (
SessionsResource,
AsyncSessionsResource,
SessionsResourceWithRawResponse,
AsyncSessionsResourceWithRawResponse,
SessionsResourceWithStreamingResponse,
AsyncSessionsResourceWithStreamingResponse,
)

__all__ = [
"SessionsResource",
"AsyncSessionsResource",
"SessionsResourceWithRawResponse",
"AsyncSessionsResourceWithRawResponse",
"SessionsResourceWithStreamingResponse",
"AsyncSessionsResourceWithStreamingResponse",
"BrowserResource",
"AsyncBrowserResource",
"BrowserResourceWithRawResponse",
"AsyncBrowserResourceWithRawResponse",
"BrowserResourceWithStreamingResponse",
"AsyncBrowserResourceWithStreamingResponse",
]
Loading