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.28.1"
".": "0.29.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: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-3ee0511fa1bf59b2bb44d947f7d884fd8522ef872d33bab141874941b76f1dd7.yml
openapi_spec_hash: 394bbfe74954625b70de9c85d553e3d0
config_hash: c7d506cdee510785b58defa1a626e20b
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.29.0 (2026-02-12)

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

### Features

* **api:** Add Embeddings API ([15dec35](https://github.com/perplexityai/perplexity-py/commit/15dec35d373b2fb76a737cacb02b81335e65bf20))

## 0.28.1 (2026-02-11)

Full Changelog: [v0.28.0...v0.28.1](https://github.com/perplexityai/perplexity-py/compare/v0.28.0...v0.28.1)
Expand Down
27 changes: 27 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ from perplexity.types import (
ChatMessageInput,
ChatMessageOutput,
Choice,
ContextualizedEmbeddingObject,
EmbeddingObject,
EmbeddingsUsage,
JsonSchemaFormat,
ResponseFormat,
SearchResult,
Expand Down Expand Up @@ -65,6 +68,30 @@ Methods:

- <code title="post /v1/responses">client.responses.<a href="./src/perplexity/resources/responses.py">create</a>(\*\*<a href="src/perplexity/types/response_create_params.py">params</a>) -> <a href="./src/perplexity/types/response_create_response.py">ResponseCreateResponse</a></code>

# Embeddings

Types:

```python
from perplexity.types import EmbeddingCreateResponse
```

Methods:

- <code title="post /v1/embeddings">client.embeddings.<a href="./src/perplexity/resources/embeddings.py">create</a>(\*\*<a href="src/perplexity/types/embedding_create_params.py">params</a>) -> <a href="./src/perplexity/types/embedding_create_response.py">EmbeddingCreateResponse</a></code>

# ContextualizedEmbeddings

Types:

```python
from perplexity.types import ContextualizedEmbeddingCreateResponse
```

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>

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

if TYPE_CHECKING:
from .resources import chat, async_, search, responses
from .resources import chat, async_, search, 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.contextualized_embeddings import (
ContextualizedEmbeddingsResource,
AsyncContextualizedEmbeddingsResource,
)

__all__ = [
"Timeout",
Expand Down Expand Up @@ -124,6 +129,18 @@ def responses(self) -> ResponsesResource:

return ResponsesResource(self)

@cached_property
def embeddings(self) -> EmbeddingsResource:
from .resources.embeddings import EmbeddingsResource

return EmbeddingsResource(self)

@cached_property
def contextualized_embeddings(self) -> ContextualizedEmbeddingsResource:
from .resources.contextualized_embeddings import ContextualizedEmbeddingsResource

return ContextualizedEmbeddingsResource(self)

@cached_property
def async_(self) -> AsyncResource:
from .resources.async_ import AsyncResource
Expand Down Expand Up @@ -318,6 +335,18 @@ def responses(self) -> AsyncResponsesResource:

return AsyncResponsesResource(self)

@cached_property
def embeddings(self) -> AsyncEmbeddingsResource:
from .resources.embeddings import AsyncEmbeddingsResource

return AsyncEmbeddingsResource(self)

@cached_property
def contextualized_embeddings(self) -> AsyncContextualizedEmbeddingsResource:
from .resources.contextualized_embeddings import AsyncContextualizedEmbeddingsResource

return AsyncContextualizedEmbeddingsResource(self)

@cached_property
def async_(self) -> AsyncAsyncResource:
from .resources.async_ import AsyncAsyncResource
Expand Down Expand Up @@ -461,6 +490,18 @@ def responses(self) -> responses.ResponsesResourceWithRawResponse:

return ResponsesResourceWithRawResponse(self._client.responses)

@cached_property
def embeddings(self) -> embeddings.EmbeddingsResourceWithRawResponse:
from .resources.embeddings import EmbeddingsResourceWithRawResponse

return EmbeddingsResourceWithRawResponse(self._client.embeddings)

@cached_property
def contextualized_embeddings(self) -> contextualized_embeddings.ContextualizedEmbeddingsResourceWithRawResponse:
from .resources.contextualized_embeddings import ContextualizedEmbeddingsResourceWithRawResponse

return ContextualizedEmbeddingsResourceWithRawResponse(self._client.contextualized_embeddings)

@cached_property
def async_(self) -> async_.AsyncResourceWithRawResponse:
from .resources.async_ import AsyncResourceWithRawResponse
Expand Down Expand Up @@ -492,6 +533,20 @@ def responses(self) -> responses.AsyncResponsesResourceWithRawResponse:

return AsyncResponsesResourceWithRawResponse(self._client.responses)

@cached_property
def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithRawResponse:
from .resources.embeddings import AsyncEmbeddingsResourceWithRawResponse

return AsyncEmbeddingsResourceWithRawResponse(self._client.embeddings)

@cached_property
def contextualized_embeddings(
self,
) -> contextualized_embeddings.AsyncContextualizedEmbeddingsResourceWithRawResponse:
from .resources.contextualized_embeddings import AsyncContextualizedEmbeddingsResourceWithRawResponse

return AsyncContextualizedEmbeddingsResourceWithRawResponse(self._client.contextualized_embeddings)

@cached_property
def async_(self) -> async_.AsyncAsyncResourceWithRawResponse:
from .resources.async_ import AsyncAsyncResourceWithRawResponse
Expand Down Expand Up @@ -523,6 +578,20 @@ def responses(self) -> responses.ResponsesResourceWithStreamingResponse:

return ResponsesResourceWithStreamingResponse(self._client.responses)

@cached_property
def embeddings(self) -> embeddings.EmbeddingsResourceWithStreamingResponse:
from .resources.embeddings import EmbeddingsResourceWithStreamingResponse

return EmbeddingsResourceWithStreamingResponse(self._client.embeddings)

@cached_property
def contextualized_embeddings(
self,
) -> contextualized_embeddings.ContextualizedEmbeddingsResourceWithStreamingResponse:
from .resources.contextualized_embeddings import ContextualizedEmbeddingsResourceWithStreamingResponse

return ContextualizedEmbeddingsResourceWithStreamingResponse(self._client.contextualized_embeddings)

@cached_property
def async_(self) -> async_.AsyncResourceWithStreamingResponse:
from .resources.async_ import AsyncResourceWithStreamingResponse
Expand Down Expand Up @@ -554,6 +623,20 @@ def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse:

return AsyncResponsesResourceWithStreamingResponse(self._client.responses)

@cached_property
def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithStreamingResponse:
from .resources.embeddings import AsyncEmbeddingsResourceWithStreamingResponse

return AsyncEmbeddingsResourceWithStreamingResponse(self._client.embeddings)

@cached_property
def contextualized_embeddings(
self,
) -> contextualized_embeddings.AsyncContextualizedEmbeddingsResourceWithStreamingResponse:
from .resources.contextualized_embeddings import AsyncContextualizedEmbeddingsResourceWithStreamingResponse

return AsyncContextualizedEmbeddingsResourceWithStreamingResponse(self._client.contextualized_embeddings)

@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.28.1" # x-release-please-version
__version__ = "0.29.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 @@ -32,6 +32,22 @@
ResponsesResourceWithStreamingResponse,
AsyncResponsesResourceWithStreamingResponse,
)
from .embeddings import (
EmbeddingsResource,
AsyncEmbeddingsResource,
EmbeddingsResourceWithRawResponse,
AsyncEmbeddingsResourceWithRawResponse,
EmbeddingsResourceWithStreamingResponse,
AsyncEmbeddingsResourceWithStreamingResponse,
)
from .contextualized_embeddings import (
ContextualizedEmbeddingsResource,
AsyncContextualizedEmbeddingsResource,
ContextualizedEmbeddingsResourceWithRawResponse,
AsyncContextualizedEmbeddingsResourceWithRawResponse,
ContextualizedEmbeddingsResourceWithStreamingResponse,
AsyncContextualizedEmbeddingsResourceWithStreamingResponse,
)

__all__ = [
"ChatResource",
Expand All @@ -52,6 +68,18 @@
"AsyncResponsesResourceWithRawResponse",
"ResponsesResourceWithStreamingResponse",
"AsyncResponsesResourceWithStreamingResponse",
"EmbeddingsResource",
"AsyncEmbeddingsResource",
"EmbeddingsResourceWithRawResponse",
"AsyncEmbeddingsResourceWithRawResponse",
"EmbeddingsResourceWithStreamingResponse",
"AsyncEmbeddingsResourceWithStreamingResponse",
"ContextualizedEmbeddingsResource",
"AsyncContextualizedEmbeddingsResource",
"ContextualizedEmbeddingsResourceWithRawResponse",
"AsyncContextualizedEmbeddingsResourceWithRawResponse",
"ContextualizedEmbeddingsResourceWithStreamingResponse",
"AsyncContextualizedEmbeddingsResourceWithStreamingResponse",
"AsyncResource",
"AsyncAsyncResource",
"AsyncResourceWithRawResponse",
Expand Down
Loading