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 (“0000” 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 (“0000” 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)data.embeddings (plural) as an array of vectorsdimensionality parameter allows you to control the output vector sizeEmbeddings generated successfully
Response for single input
Response code indicating the result status
"0000"
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