litellm/tests/test_litellm/llms/perplexity/embedding
Cursor Agent 2d1f1696c8 fix: decode Perplexity base64_int8 embeddings to OpenAI-format float arrays
Perplexity returns embeddings as base64-encoded signed int8 values by default,
not float arrays like OpenAI. This commit adds decoding in
transform_embedding_response so the proxy returns standard OpenAI-compatible
float arrays (normalized to [-1, 1]).

- Added _decode_base64_embedding() static method
- Handles both base64 strings (decoded) and float lists (passthrough)
- Added 3 new tests for base64 decoding + passthrough

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-03-02 18:30:21 +00:00
..
__init__.py feat: add Perplexity embedding support (pplx-embed-v1) 2026-03-02 17:00:45 +00:00
test_perplexity_embedding_transformation.py fix: decode Perplexity base64_int8 embeddings to OpenAI-format float arrays 2026-03-02 18:30:21 +00:00