Skip to content

Commit

Permalink
feat(api): add embeddings encoding_format (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Oct 19, 2023
1 parent ecabebc commit cf70dea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/resources/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ export interface EmbeddingCreateParams {
*/
model: (string & {}) | 'text-embedding-ada-002';

/**
* The format to return the embeddings in. Can be either `float` or
* [`base64`](https://pypi.org/project/pybase64/).
*/
encoding_format?: 'float' | 'base64';

/**
* A unique identifier representing your end-user, which can help OpenAI to monitor
* and detect abuse.
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/embeddings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('resource embeddings', () => {
const response = await openai.embeddings.create({
input: 'The quick brown fox jumped over the lazy dog',
model: 'text-embedding-ada-002',
encoding_format: 'float',
user: 'user-1234',
});
});
Expand Down

0 comments on commit cf70dea

Please sign in to comment.