Skip to content

Commit 66d155c

Browse files
ThomasVitalemarkpollack
authored andcommitted
fix: QueryTransformers must accept input ChatOptions
Fixes gh-3175 Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
1 parent d436ee8 commit 66d155c

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

spring-ai-rag/src/main/java/org/springframework/ai/rag/preretrieval/query/transformation/CompressionQueryTransformer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@
2525
import org.springframework.ai.chat.client.ChatClient;
2626
import org.springframework.ai.chat.messages.Message;
2727
import org.springframework.ai.chat.messages.MessageType;
28-
import org.springframework.ai.chat.prompt.ChatOptions;
2928
import org.springframework.ai.chat.prompt.PromptTemplate;
3029
import org.springframework.ai.rag.Query;
3130
import org.springframework.ai.rag.util.PromptAssert;
@@ -84,7 +83,6 @@ public Query transform(Query query) {
8483
.user(user -> user.text(this.promptTemplate.getTemplate())
8584
.param("history", formatConversationHistory(query.history()))
8685
.param("query", query.text()))
87-
.options(ChatOptions.builder().build())
8886
.call()
8987
.content();
9088

spring-ai-rag/src/main/java/org/springframework/ai/rag/preretrieval/query/transformation/RewriteQueryTransformer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import org.slf4j.LoggerFactory;
2121

2222
import org.springframework.ai.chat.client.ChatClient;
23-
import org.springframework.ai.chat.prompt.ChatOptions;
2423
import org.springframework.ai.chat.prompt.PromptTemplate;
2524
import org.springframework.ai.rag.Query;
2625
import org.springframework.ai.rag.util.PromptAssert;
@@ -82,7 +81,6 @@ public Query transform(Query query) {
8281
.user(user -> user.text(this.promptTemplate.getTemplate())
8382
.param("target", this.targetSearchSystem)
8483
.param("query", query.text()))
85-
.options(ChatOptions.builder().build())
8684
.call()
8785
.content();
8886

spring-ai-rag/src/main/java/org/springframework/ai/rag/preretrieval/query/transformation/TranslationQueryTransformer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -91,7 +91,6 @@ public Query transform(Query query) {
9191
.user(user -> user.text(this.promptTemplate.getTemplate())
9292
.param("targetLanguage", this.targetLanguage)
9393
.param("query", query.text()))
94-
.options(ChatOptions.builder().build())
9594
.call()
9695
.content();
9796

0 commit comments

Comments
 (0)