package com.iwe3.langchain4j.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MemoryChatAssistantConfig {



   //@Bean -> 向IOC容器中注入 chatMemory 的实例
   @Bean
   ChatMemory windowChatMemory() {
      // 设置聊天记忆记录的message数量
      return MessageWindowChatMemory.withMaxMessages(10);
   }
}
