topo_dev
liu 11 months ago
parent 17065eb9c9
commit c54c2fc3e0

@ -30,6 +30,7 @@ import org.springframework.ai.chat.ChatResponse;
import org.springframework.ai.chat.Generation; import org.springframework.ai.chat.Generation;
import org.springframework.ai.chat.messages.Message; import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.SystemMessage; import org.springframework.ai.chat.messages.SystemMessage;
import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.chat.prompt.Prompt; import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.ai.ollama.OllamaChatClient; import org.springframework.ai.ollama.OllamaChatClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -144,8 +145,7 @@ public class RecordServiceImpl extends ServiceImpl<NoteRecordMapper, NoteRecord>
3. 3.
{question} {answer} {question} {answer}
"""; """;
List<Message> messages = new ArrayList<>(List.of(new SystemMessage(StrUtil.format(template, paramMap)))); Prompt prompt = new Prompt(new UserMessage(StrUtil.format(template, paramMap)));
Prompt prompt = new Prompt(messages);
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
log.info("开始分析:"); log.info("开始分析:");

Loading…
Cancel
Save