Closed
Description
Bug description
Running code that creates embeddings and writes them to a Chroma vector store. Code works, but if I upgrade the app from Spring Boot 3.3.4
to 3.4.1
, the write fails with:
2024-12-29T11:37:29.960-06:00 ERROR 72456 --- [legweb] [ task-1] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void org.knowyourgov.legweb.bill.BillIndexService.embed(java.lang.String)
org.springframework.web.client.HttpClientErrorException$UnprocessableEntity: 422 Unprocessable Entity: "{"detail":[{"type":"missing","loc":["body"],"msg":"Field required","input":null}]}"
at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:133) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.StatusHandler.lambda$defaultHandler$3(StatusHandler.java:86) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.StatusHandler.handle(StatusHandler.java:146) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.applyStatusHandlers(DefaultRestClient.java:826) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.lambda$toBodilessEntity$3(DefaultRestClient.java:789) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchangeInternal(DefaultRestClient.java:574) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchange(DefaultRestClient.java:535) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.RestClient$RequestHeadersSpec.exchange(RestClient.java:677) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.executeAndExtract(DefaultRestClient.java:809) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.toBodilessEntity(DefaultRestClient.java:787) ~[spring-web-6.2.1.jar:6.2.1]
at org.springframework.ai.chroma.vectorstore.ChromaApi.upsertEmbeddings(ChromaApi.java:182) ~[spring-ai-chroma-store-1.0.0-M5.jar:1.0.0-M5]
at org.springframework.ai.chroma.vectorstore.ChromaVectorStore.doAdd(ChromaVectorStore.java:182) ~[spring-ai-chroma-store-1.0.0-M5.jar:1.0.0-M5]
at org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore.lambda$add$1(AbstractObservationVectorStore.java:91) ~[spring-ai-core-1.0.0-M5.jar:1.0.0-M5]
at io.micrometer.observation.Observation.observe(Observation.java:498) ~[micrometer-observation-1.14.2.jar:1.14.2]
at org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore.add(AbstractObservationVectorStore.java:91) ~[spring-ai-core-1.0.0-M5.jar:1.0.0-M5]
at org.springframework.ai.vectorstore.VectorStore.accept(VectorStore.java:53) ~[spring-ai-core-1.0.0-M5.jar:1.0.0-M5]
at org.springframework.ai.vectorstore.VectorStore.accept(VectorStore.java:38) ~[spring-ai-core-1.0.0-M5.jar:1.0.0-M5]
at org.springframework.ai.document.DocumentWriter.write(DocumentWriter.java:30) ~[spring-ai-core-1.0.0-M5.jar:1.0.0-M5]
Environment
Spring AI 1.0.0-M5, ChromaDB 0.5.20
Expected behavior
App should continue to work in Spring Boot 3.4.1
Minimal Complete Reproducible example
Code snippet that triggers issue:
Resource resource = new ByteArrayResource(billText.getFullText().getBytes());
TextReader reader = new TextReader(resource);
List<Document> split = tokenSplitter.split(reader.read());
for (Document document : split) {
document.getMetadata().put(BILL_METADATA, billText.getBillId());
}
vectorStore.write(split);
Metadata
Metadata
Assignees
Labels
No labels