- Issue created by @keiserjb
Could not load the embeddings engine to get the dimensions. Please check the configuration.Error executing "InvokeModel" on "https://bedrock-runtime.us-east-1.amazonaws.com/model/amazon.titan-embed..."; AWS HTTP error: Client error: `POST https://bedrock-runtime.us-east-1.amazonaws.com/model/amazon.titan-embed...` resulted in a `400 Bad Request` response: {"message":"Malformed input request: #: only 1 subschema matches out of 2, please reformat your input and try again."} ValidationException (client): Malformed input request: #: only 1 subschema matches out of 2, please reformat your input and try again. - {"message":"Malformed input request: #: only 1 subschema matches out of 2, please reformat your input and try again."}
When I try to create a server using AWS Bedrock and Milvus I get the above error. I'm trying to use the Titan Text Embeddings V2 (amazon.titan-embed-text-v2.0) model.
Is this really happening because the formatInput method in TitanEmbeddings.php lists amazon.titan-embed-text-v1 in it?
If I change it to v2 the error goes away and I can index things into Milvus.
public static function formatInput($input = "", $image = NULL, $config = [], $model_id = '') {
if ($input) {
$payload['inputText'] = $input;
}
elseif ($image && strpos($model_id, 'amazon.titan-embed-image') === 0) {
$payload['inputImage'] = $image->getAsBase64EncodedString('');
}
else {
throw new AiBadRequestException('You need to give an input text or an image or you used as image in a none-image embeddings model.');
}
if (strpos($model_id, 'amazon.titan-embed-image') === 0) {
$payload['embeddingConfig']['outputEmbeddingLength'] = (int) $config['outputEmbeddingLength'];
}
elseif (strpos($model_id, 'amazon.titan-embed-text-v2') !== 0) {
$payload['dimensions'] = (int) $config['dimensions'];
}
return $payload;
}
Active
1.1
Code