| | |
| | | package com.ruoyi.ai.config; |
| | | |
| | | import com.ruoyi.ai.store.MongoChatMemoryStore; |
| | | import dev.langchain4j.community.model.dashscope.QwenStreamingChatModel; |
| | | import dev.langchain4j.memory.chat.ChatMemoryProvider; |
| | | import dev.langchain4j.memory.chat.MessageWindowChatMemory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | |
| | | .chatMemoryStore(mongoChatMemoryStore) |
| | | .build(); |
| | | } |
| | | |
| | | @Bean("purchaseVisionStreamingChatModel") |
| | | QwenStreamingChatModel purchaseVisionStreamingChatModel( |
| | | @Value("${langchain4j.community.dashscope.streaming-chat-model.api-key}") String apiKey) { |
| | | return QwenStreamingChatModel.builder() |
| | | .apiKey(apiKey) |
| | | .modelName("qwen-vl-max") |
| | | .isMultimodalModel(true) |
| | | .build(); |
| | | } |
| | | } |