✨Feat: 完成 LLM 接入
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user