-
Notifications
You must be signed in to change notification settings - Fork 266
Open
Labels
specAn issue related to type inconsistencies with the APIAn issue related to type inconsistencies with the API
Description
Similar to openai/openai-openapi#424
The embedding field of the Embedding object will be a string, if encoding_format is set to base64.
E.g.
curl -v https://api.openai.com/v1/embeddings \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "The food was delicious",
"model": "text-embedding-3-small",
"encoding_format": "base64",
"dimensions":10
}'{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": "nMcovm6gOb7ldwO/AESlvk0Avz2nZIq+3c+EvZvdFT9HsZa9oSy+vg==" <------ THIS
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 4,
"total_tokens": 4
}
}However, the client mandates that the embedding field is an array of floats.
Lines 115 to 124 in 7ad3660
| type Embedding struct { | |
| // The embedding vector, which is a list of floats. The length of vector depends on | |
| // the model as listed in the | |
| // [embedding guide](https://platform.openai.com/docs/guides/embeddings). | |
| Embedding []float64 `json:"embedding,required"` | |
| // The index of the embedding in the list of embeddings. | |
| Index int64 `json:"index,required"` | |
| // The object type, which is always "embedding". | |
| Object EmbeddingObject `json:"object,required"` | |
| JSON embeddingJSON `json:"-"` |
dolmen and csreesan
Metadata
Metadata
Assignees
Labels
specAn issue related to type inconsistencies with the APIAn issue related to type inconsistencies with the API