Bug description I'm experimenting with embeddings and encountered this error when using Bedrock / Titan embedding models: software.amazon.awssdk.services.bedrockruntime.model.ValidationException: Malformed input request: 2 schema violations found, please reformat your input and try again. (Service: BedrockRuntime, Status Code: 400, Request ID: 062cc802-99ce-4d2f-99e2-ea9102c091f3)"
I don't get this error when using embeddings with OpenAI or anything else, so it seems to be Bedrock / Titan specific. Sorry I don't have more information - I'm just experimenting and wanted to pass this info on.
Environment Spring AI version 1.0.0-M1, Java 1.21, no vector store. AWS account with the Titan models enabled.
Steps to reproduce I followed the steps in the documentation here (https://docs.spring.io/spring-ai/reference/api/embeddings/bedrock-titan-embedding.html), though I switched models to amazon.titan-embed-text-v1 and amazon.titan-embed-text-v2:0.
Expected behavior I was expecting a normal API call to Bedrock
Minimal Complete Reproducible example See: https://docs.spring.io/spring-ai/reference/api/embeddings/bedrock-titan-embedding.html, but try models amazon.titan-embed-text-v1 and amazon.titan-embed-text-v2:0.
Comment From: maxjiang153
Hi @kennyk65 could you provide a demo to reproduce this issue?
Comment From: csterwa
Underlying API has been changed for Bedrock SDK and will verify separately.
Comment From: rafaelgutierrez-clearcover
Excuse me, what was the fix for this? Im getting a similar error using
Comment From: eugeniace
Excuse me, what was the fix for this? Im getting a similar error using
1.0.0-M8
The problem was caused because the text was sent to the embedding model in the body field "inputImage".
The configuration property spring.ai.bedrock.titan.embedding.input-type
should be set to value text
I think that it should be put in documentation too.
Comment From: wilhg
Excuse me, what was the fix for this? Im getting a similar error using
1.0.0-M8 The problem was caused because the text was sent to the embedding model in the body field "inputImage".
The configuration property
spring.ai.bedrock.titan.embedding.input-type
should be set to valuetext
I think that it should be put in documentation too.
👍 Strongly agree, it's very hard to fix the issue.