{"record":{"id":"26686fa85f2eeddb","repo":"spring-projects/spring-ai","slug":"inputtype-property-for-bedrocktitanembeddingmodel","errorCode":null,"errorMessage":"InputType property for BedrockTitanEmbeddingModel is missing.","messagePattern":"InputType property for BedrockTitanEmbeddingModel is missing\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/titan/autoconfigure/BedrockTitanEmbeddingAutoConfiguration.java","lineNumber":80,"sourceCode":"\n\t\t// Validate required properties\n\t\tif (properties.getModel() == null || awsProperties.getTimeout() == null) {\n\t\t\tthrow new IllegalArgumentException(\"Required properties for TitanEmbeddingBedrockApi are missing.\");\n\t\t}\n\n\t\treturn new TitanEmbeddingBedrockApi(properties.getModel(), credentialsProvider, regionProvider.getRegion(),\n\t\t\t\tjsonMapper, awsProperties.getTimeout());\n\t}\n\n\t@Bean\n\t@ConditionalOnMissingBean\n\t@ConditionalOnBean(TitanEmbeddingBedrockApi.class)\n\tpublic BedrockTitanEmbeddingModel titanEmbeddingModel(TitanEmbeddingBedrockApi titanEmbeddingApi,\n\t\t\tBedrockTitanEmbeddingProperties properties, ObjectProvider<ObservationRegistry> observationRegistry) {\n\n\t\t// Validate required properties\n\t\tif (properties.getInputType() == null) {\n\t\t\tthrow new IllegalArgumentException(\"InputType property for BedrockTitanEmbeddingModel is missing.\");\n\t\t}\n\n\t\treturn new BedrockTitanEmbeddingModel(titanEmbeddingApi,\n\t\t\t\tobservationRegistry.getIfUnique(() -> ObservationRegistry.NOOP))\n\t\t\t.withInputType(properties.getInputType());\n\t}\n\n}\n","sourceCodeStart":62,"sourceCodeEnd":89,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/titan/autoconfigure/BedrockTitanEmbeddingAutoConfiguration.java#L62-L89","documentation":"BedrockTitanEmbeddingModel requires an input type (e.g. CLUSTERING, SEARCH_DOCUMENT, SEARCH_IMAGE) that controls how Titan builds embeddings. The auto-configuration throws this IllegalArgumentException when spring.ai.bedrock.titan.embedding.input-type is not set, even though the API bean was created successfully.","triggerScenarios":"titanEmbeddingModel bean method runs with properties.getInputType() == null — the embedding API bean exists but no input-type property was configured.","commonSituations":"Adding the Titan embedding starter and model id but forgetting input-type; renaming/moving properties during migration so the input-type key no longer binds.","solutions":["Set spring.ai.bedrock.titan.embedding.input-type to one of the supported enum values (e.g. SEARCH_DOCUMENT, CLUSTERING).","Use only valid TitanEmbeddingModel.TitanEmbeddingInputType enum names — invalid names would fail binding with a different error.","Confirm the property key spelling and prefix match the current Spring AI version's BedrockTitanEmbeddingProperties."],"exampleFix":"// before\nspring.ai.bedrock.titan.embedding.model=amazon.titan-embed-text-v2:0\n// after\nspring.ai.bedrock.titan.embedding.model=amazon.titan-embed-text-v2:0\nspring.ai.bedrock.titan.embedding.input-type=SEARCH_DOCUMENT","handlingStrategy":"validation","validationCode":"if (env.getProperty(\"spring.ai.bedrock.titan.embedding.input-type\") == null)\n    throw new IllegalStateException(\"Set spring.ai.bedrock.titan.embedding.input-type (e.g. SEARCH_DOCUMENT)\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure input-type alongside the Titan embedding model id.","Use the exact TitanEmbeddingInputType enum names in config.","Validate properties at startup with a config smoke test."],"tags":["bedrock","titan","embedding","missing-config"],"backgroundTag":"missing-required-config-field","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}