Skip to content

Commit

Permalink
feat: allow new embeddings params like dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
VisargD committed Feb 2, 2024
1 parent 3d68195 commit 69a9719
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions portkey_ai/api_resources/apis/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,25 @@ class Embeddings(APIResource):
def __init__(self, client: APIClient) -> None:
super().__init__(client)

def create(self, *, input: str, model: Optional[str] = None) -> GenericResponse:
body = {"input": input, "model": model}
def create(
self,
*,
input: str,
model: Optional[str] = None,
dimensions: Optional[int] = None,
encoding_format: Optional[str] = None,
user: Optional[str] = None,
**kwargs
) -> GenericResponse:
body = dict(
input=input,
model=model,
dimensions=dimensions,
encoding_format=encoding_format,
user=user,
**kwargs,
)

return self._post(
PortkeyApiPaths.EMBEDDING_API,
body=body,
Expand Down

0 comments on commit 69a9719

Please sign in to comment.