✨Feat: 完成 LLM 接入

This commit is contained in:
2025-10-25 14:26:09 +08:00
parent dcf0f5cfdb
commit 27cb78112d
6 changed files with 95 additions and 4 deletions
@@ -0,0 +1,22 @@
package com.wonderland.stardewvalley.controller;
import com.wonderland.stardewvalley.ai.ChatUtil;
import com.wonderland.stardewvalley.entity.AIChatRequest;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("chat")
public class ChatController {
@Resource
private ChatUtil chatUtil;
@PostMapping
public String chat(@RequestBody AIChatRequest aiChatRequest) {
return chatUtil.doChat(aiChatRequest.getBackGround(), aiChatRequest.getContent());
}
}