Skip to content

Commit

Permalink
feat: added base64 str as embedding representation in the response (#138
Browse files Browse the repository at this point in the history
)
  • Loading branch information
adubovik authored Jul 17, 2024
1 parent 8fbc61a commit e315926
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aidial_sdk/embeddings/response.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import List, Literal
from typing import List, Literal, Union

from aidial_sdk.utils.pydantic import ExtraForbidModel


class Embedding(ExtraForbidModel):
embedding: List[float]
embedding: Union[str, List[float]]
index: int
object: Literal["embedding"] = "embedding"

Expand All @@ -14,11 +14,11 @@ class Usage(ExtraForbidModel):
total_tokens: int


class CreateEmbeddingResponse(ExtraForbidModel):
class EmbeddingResponse(ExtraForbidModel):
data: List[Embedding]
model: str
object: Literal["list"] = "list"
usage: Usage


Response = CreateEmbeddingResponse
Response = EmbeddingResponse

0 comments on commit e315926

Please sign in to comment.