Repository navigation
docs(embeddings): recommend pplx-embed-v2 models and add v2 tests - #155
Merged
gleb-reshetnev merged 3 commits intoNov 19, 2026
Merged
Conversation
Document pplx-embed-v2-context-9b and pplx-embed-v2-context-0.6b as the default choice for new integrations, with input_type and chunked document usage. Update the legacy embedding_create_params TypedDict, which api.md links as the params reference, with the v2 models, input_type, num_chunks, and chunked or image input shapes. Add mock transport tests for v1 and v2 requests and responses, and live tests for v2 queries and chunked documents. The v1 tests also pass against v0.46.1, so v1 request bodies and response fields are unchanged. Co-authored-by: Perplexity <noreply@perplexity.ai>
Recommend pplx-embed-v2-context-0.6b as the starting model and 9b for retrieval quality, note the shared 1024-dimension space and the 2027 v1 phase-out, and document whole-document, chunked, and image input shapes, num_chunks regions, and request limits. Add tests for v2 whole documents and single-region images. Co-authored-by: Perplexity <noreply@perplexity.ai>
bwang-pplx
marked this pull request as ready for review
November 19, 2026 15:58
Embed a generated PNG as one image and as image regions with num_chunks. Co-authored-by: Perplexity <noreply@perplexity.ai>
gleb-reshetnev
approved these changes
Nov 19, 2026
gleb-reshetnev
approved these changes
Nov 19, 2026
Merged
gleb-reshetnev
pushed a commit
that referenced
this pull request
Nov 19, 2026
Automated Release PR --- ## [0.48.1](v0.48.0...v0.48.1) (2026-11-19) ### Documentation * **embeddings:** recommend pplx-embed-v2 models and add v2 tests ([#155](#155)) ([74b5288](74b5288)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client.embeddings.createalready acceptspplx-embed-v2-context-9bandpplx-embed-v2-context-0.6b(synced in v0.47.0), but nothing in the package tells a user or a coding agent to use them. This PR makes v2 the documented default without changing v1 behavior.pplx-embed-v2-context-0.6b, choosepplx-embed-v2-context-9bfor retrieval quality, v1 phases out during 2027. It coversinput_type, an input to response shape table (queries, whole documents, chunked documents, images,num_chunksregions), and int8 decoding.types/embedding_create_params.py: this is the params reference thatapi.mdlinks, but it still listed only v1. It now lists the v2 models first, with docstrings that match the guide: the 0.6b/9b recommendation,input_type,num_chunksregions, the input shapes and their response shapes, v2 dimensions, and request limits. The change only adds fields and literals.tests/test_embeddings.py(new, MockTransport): v1 0.6b/4b request bodies and responses, v2 queries, v2 whole documents, v2 chunked documents, v2 images with and withoutnum_chunks, async v2, client side validation of badmodel/input_type/num_chunks, andcontextualized_embeddingsv1.e2e/live/test_embeddings.py: live v2 query and chunked document tests next to the existing v1 test.Backward compatibility
tests/test_embeddings.pyalso pass when run against v0.46.1, the last release before v2 was added.Docstrings on
embeddings.createThe generated client has no docstrings: the SDK codegen in
ppl-ai/agi(tools/codegen/openapi_sdk) drops OpenAPI descriptions and only emits deprecation notes. Docstrings onclient.embeddings.createitself need a codegen change there, which this PR does not include.Testing
pytest tests(579 passed, 300 skipped) andruff check/ruff format --checkon the changed files. Bazel was not available in my environment, so CI will runbazel test //...and gazelle.PPLX_API_TOKEN).Created with Perplexity