From 348f3df7293122083e66a4eb27768188a0cf11b1 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Thu, 6 Feb 2025 20:25:38 -0500 Subject: [PATCH] Upgrade notes for vector store delete API breaking change Signed-off-by: Soby Chacko --- .../modules/ROOT/pages/upgrade-notes.adoc | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc index dd6980ad5..54b809a40 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc @@ -64,6 +64,27 @@ Spring AI updates to use Spring Boot 3.4.2 for the dependency management. You ca * If you are upgrading to Spring Boot 3.4.2, please make sure to refer to https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.4-Release-Notes#upgrading-from-spring-boot-33[this] documentation for the changes required to configure the REST Client. Notably, if you don’t have an HTTP client library on the classpath, this will likely result in the use of `JdkClientHttpRequestFactory` where `SimpleClientHttpRequestFactory` would have been used previously. To switch to use `SimpleClientHttpRequestFactory`, you need to set `spring.http.client.factory=simple`. * If you are using a different version of Spring Boot (say Spring Boot 3.3.x) and need a specific version of a dependency, you can override it in your build configuration. +=== Vector Store API changes + +In version 1.0.0-M6, the `delete` method in the `VectorStore` interface has been modified to be a void operation instead of returning an `Optional`. +If your code previously checked the return value of the delete operation, you'll need to remove this check. +The operation now throws an exception if the deletion fails, providing more direct error handling. + +==== Before 1.0.0-M6: +[source,java] +---- +Optional result = vectorStore.delete(ids); +if (result.isPresent() && result.get()) { + // handle successful deletion +} +---- + +==== In 1.0.0-M6 and later: +[source,java] +---- +vectorStore.delete(ids); +// deletion successful if no exception is thrown +---- == Upgrading to 1.0.0.M5