Skip to content

Commit a1fea0b

Browse files
author
ogbozoyan
committed
feat: added missed builder methods; deprecated all constructors except one with all fields
feat: added missed builder methods; deprecated all constructors except one with all fields
1 parent 979de19 commit a1fea0b

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/VectorStoreChatMemoryAdvisor.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
*
4545
* @author Christian Tzolov
4646
* @author Thomas Vitale
47+
* @author Oganes Bozoyan
4748
* @since 1.0.0
4849
*/
4950
public class VectorStoreChatMemoryAdvisor extends AbstractChatMemoryAdvisor<VectorStore> {
@@ -64,20 +65,29 @@ public class VectorStoreChatMemoryAdvisor extends AbstractChatMemoryAdvisor<Vect
6465

6566
private final String systemTextAdvise;
6667

68+
@Deprecated
6769
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore) {
6870
this(vectorStore, DEFAULT_SYSTEM_TEXT_ADVISE);
6971
}
7072

73+
@Deprecated
7174
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String systemTextAdvise) {
7275
super(vectorStore);
7376
this.systemTextAdvise = systemTextAdvise;
7477
}
7578

79+
@Deprecated
7680
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId,
7781
int chatHistoryWindowSize) {
7882
this(vectorStore, defaultConversationId, chatHistoryWindowSize, DEFAULT_SYSTEM_TEXT_ADVISE);
7983
}
8084

85+
@Deprecated
86+
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId,
87+
int chatHistoryWindowSize, int order) {
88+
this(vectorStore, defaultConversationId, chatHistoryWindowSize, DEFAULT_SYSTEM_TEXT_ADVISE, order);
89+
}
90+
8191
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId,
8292
int chatHistoryWindowSize, String systemTextAdvise) {
8393
this(vectorStore, defaultConversationId, chatHistoryWindowSize, systemTextAdvise,
@@ -209,10 +219,25 @@ public Builder withSystemTextAdvise(String systemTextAdvise) {
209219
return this;
210220
}
211221

222+
public Builder withConversationId(String conversationId) {
223+
this.conversationId = conversationId;
224+
return this;
225+
}
226+
227+
public Builder withChatMemoryRetrieveSize(Integer chatMemoryRetrieveSize) {
228+
this.chatMemoryRetrieveSize = chatMemoryRetrieveSize;
229+
return this;
230+
}
231+
232+
public Builder withOrder(Integer order) {
233+
this.order = order;
234+
return this;
235+
}
236+
212237
@Override
213238
public VectorStoreChatMemoryAdvisor build() {
214239
return new VectorStoreChatMemoryAdvisor(this.chatMemory, this.conversationId, this.chatMemoryRetrieveSize,
215-
this.systemTextAdvise);
240+
this.systemTextAdvise, this.order);
216241
}
217242

218243
}

0 commit comments

Comments
 (0)