Skip to content
Closed
Show file tree
Hide file tree
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 @@ -20,24 +20,24 @@
import org.slf4j.LoggerFactory;

import org.springframework.ai.chat.memory.repository.mongo.Conversation;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.stereotype.Component;

/**
* Class responsible for creating MongoDB proper indices for the ChatMemory. Creates a
* Class responsible for creating proper MongoDB indices for the ChatMemory. Creates a
* main index on the conversationId and timestamp fields, and a TTL index on the timestamp
* field if the TTL is set in properties.
*
* @author Łukasz Jernaś
* @see MongoChatMemoryProperties
* @since 1.1.0
*/
@Component
@AutoConfiguration
@ConditionalOnProperty(value = "spring.ai.chat.memory.repository.mongo.create-indices", havingValue = "true")
public class MongoChatMemoryIndexCreator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# limitations under the License.
#
org.springframework.ai.model.chat.memory.repository.mongo.autoconfigure.MongoChatMemoryAutoConfiguration
org.springframework.ai.model.chat.memory.repository.mongo.autoconfigure.MongoChatMemoryIndexCreator