Build Spring AI SearchRequests with SearchRequest.builder()

Proprietary

Spring AI 1.0.0-M6 removed SearchRequest.defaults(), SearchRequest.query(String) and the withX(..) methods of SearchRequest. This replaces SearchRequest.query(q).withTopK(5) with SearchRequest.builder().query(q).topK(5).build(), request.withTopK(5) with SearchRequest.from(request).topK(5).build(), and the SearchRequest.defaults() that already returned a builder in 1.0.0-M5 with SearchRequest.builder().

io.moderne.java.spring.ai1.MigrateSearchRequest
mod run . --recipe=io.moderne.java.spring.ai1.MigrateSearchRequest

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.