Parameters
Parameter | Type | Description |
---|---|---|
ctx | context.Context | Context for cancellation and timeouts |
ids | []string | Slice of vector IDs to retrieve |
include | []string | Fields to include in response: “vector”, “metadata”, “contents” |
Returns
*GetResponse
: Retrieved vectors with requested fieldserror
: Any error encountered, including IDs not found
Error Handling
API Errors
API Errors
- Returns error if the API request fails due to network connectivity issues
- Returns error if authentication fails (invalid API key)
- Returns error if the encryption key is invalid for the specified index
- Returns error if there are internal server errors during retrieval
Validation Errors
Validation Errors
- Returns error if the IDs slice is empty
- Returns error if any ID is not found in the index
- Returns error if the include parameter contains invalid field names
Example Usage
Response Item Fields
Field | Type | Description |
---|---|---|
Id | string | Vector identifier (always included) |
Vector | []float32 | Vector data (if included) |
Contents | string | Vector contents (if included) |
Metadata | map[string]interface{} | Vector metadata (if included) |