Generate vector embeddings for text using language models
| Field | Type | Required | Description |
|---|---|---|---|
| input | array[string] | Yes | List of text strings to embed (can be a single string or multiple strings) |
| model | string | Yes | Embedding model name |
| dimensionality | integer | No | Output embedding dimension size (e.g., 256, 512, 768). Model-dependent. |
gemini-embedding-001 - Google’s Gemini text embedding model| Parameter | Type | Description |
|---|---|---|
| code | string | Response code indicating the result status (200 indicates success) |
| msg | string | Response message describing the operation result |
| data | object | Response data object containing the embedding |
| data.embedding | array[number] | Vector embedding array for the input text |
| success | boolean | Indicates whether the operation was successful |
| failed | boolean | Indicates whether the operation failed |
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code indicating the result status (200 indicates success) |
| msg | string | Response message describing the operation result |
| data | object | Response data object containing the embeddings |
| data.embeddings | array[array[number]] | Array of embedding vectors, one for each input text |
| success | boolean | Indicates whether the operation was successful |
| failed | boolean | Indicates whether the operation failed |
input array, the response contains data.embedding (singular). When providing multiple texts, the response contains data.embeddings (plural) as an array of vectors. Make sure your code handles both response keys.dimensionality parameter allows you to control the output vector sizeEmbeddings generated successfully
Response for single input
Response code indicating the result status
200
Response message describing the operation result
"success"
Response data object containing the embedding
Indicates whether the operation was successful
true
Indicates whether the operation failed
false