Skip to content

Commit 84e9aa6

Browse files
Add encoding format
1 parent 3c3521b commit 84e9aa6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

openapi.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,15 +787,17 @@ paths:
787787
-H "Content-Type: application/json" \
788788
-d '{
789789
"input": "The food was delicious and the waiter...",
790-
"model": "text-embedding-ada-002"
790+
"model": "text-embedding-ada-002",
791+
"encoding_format": "float"
791792
}'
792793
python: |
793794
import os
794795
import openai
795796
openai.api_key = os.getenv("OPENAI_API_KEY")
796797
openai.Embedding.create(
797798
model="text-embedding-ada-002",
798-
input="The food was delicious and the waiter..."
799+
input="The food was delicious and the waiter...",
800+
encoding_format="float"
799801
)
800802
node.js: |-
801803
import OpenAI from "openai";
@@ -806,6 +808,7 @@ paths:
806808
const embedding = await openai.embeddings.create({
807809
model: "text-embedding-ada-002",
808810
input: "The quick brown fox jumped over the lazy dog",
811+
encoding_format: "float",
809812
});
810813
811814
console.log(embedding);
@@ -3841,6 +3844,12 @@ components:
38413844
- type: string
38423845
enum: ["text-embedding-ada-002"]
38433846
x-oaiTypeLabel: string
3847+
encoding_format:
3848+
description: "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/)."
3849+
example: "float"
3850+
default: "float"
3851+
type: string
3852+
enum: ["float", "base64"]
38443853
user: *end_user_param_configuration
38453854
required:
38463855
- model

0 commit comments

Comments
 (0)