Skip to content

feat: added missed builder methods for VectorStoreChatMemoryAdvisor; #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*
* @author Christian Tzolov
* @author Thomas Vitale
* @author Oganes Bozoyan
* @since 1.0.0
*/
public class VectorStoreChatMemoryAdvisor extends AbstractChatMemoryAdvisor<VectorStore> {
Expand All @@ -64,20 +65,29 @@ public class VectorStoreChatMemoryAdvisor extends AbstractChatMemoryAdvisor<Vect

private final String systemTextAdvise;

@Deprecated
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore) {
this(vectorStore, DEFAULT_SYSTEM_TEXT_ADVISE);
}

@Deprecated
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String systemTextAdvise) {
super(vectorStore);
this.systemTextAdvise = systemTextAdvise;
}

@Deprecated
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId,
int chatHistoryWindowSize) {
this(vectorStore, defaultConversationId, chatHistoryWindowSize, DEFAULT_SYSTEM_TEXT_ADVISE);
}

@Deprecated
public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId,
int chatHistoryWindowSize, int order) {
this(vectorStore, defaultConversationId, chatHistoryWindowSize, DEFAULT_SYSTEM_TEXT_ADVISE, order);
}

public VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId,
int chatHistoryWindowSize, String systemTextAdvise) {
this(vectorStore, defaultConversationId, chatHistoryWindowSize, systemTextAdvise,
Expand Down Expand Up @@ -209,10 +219,25 @@ public Builder withSystemTextAdvise(String systemTextAdvise) {
return this;
}

public Builder withConversationId(String conversationId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ogbozoyan Thanks for your PR. These methods are already part of the AbstractChatMemoryAdvisor.AbstractBuilder and hence they don't need to be added here. I will remove these but merge your PR with the deprecated constructors.

this.conversationId = conversationId;
return this;
}

public Builder withChatMemoryRetrieveSize(Integer chatMemoryRetrieveSize) {
this.chatMemoryRetrieveSize = chatMemoryRetrieveSize;
return this;
}

public Builder withOrder(Integer order) {
this.order = order;
return this;
}

@Override
public VectorStoreChatMemoryAdvisor build() {
return new VectorStoreChatMemoryAdvisor(this.chatMemory, this.conversationId, this.chatMemoryRetrieveSize,
this.systemTextAdvise);
this.systemTextAdvise, this.order);
}

}
Expand Down