Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update Embedding schema for compatibility(base64) #1581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions src/openai/types/embedding.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List
from typing import Union

from typing_extensions import Literal

from .._models import BaseModel
Expand All @@ -9,10 +11,12 @@


class Embedding(BaseModel):
embedding: List[float]
"""The embedding vector, which is a list of floats.
embedding: Union[List[float], str]
"""The embedding vector, which can be either:
- a list of floats (if encoding_format is "float")
- a base64 encoded string (if encoding_format is "base64").

The length of vector depends on the model as listed in the
The length of the vector depends on the model as listed in the
[embedding guide](https://platform.openai.com/docs/guides/embeddings).
"""

Expand Down