From 6265dc20c953b549abd5c9313de26ecc6c0c58fd Mon Sep 17 00:00:00 2001 From: "Shitian.Wen" Date: Mon, 9 Dec 2024 13:51:46 +0800 Subject: [PATCH 1/2] example:code format --- .../com/alibaba/cloud/ai/example/ollama/OllamaController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-ai-alibaba-examples/ollama-example/src/main/java/com/alibaba/cloud/ai/example/ollama/OllamaController.java b/spring-ai-alibaba-examples/ollama-example/src/main/java/com/alibaba/cloud/ai/example/ollama/OllamaController.java index 5e8c4398..039013ab 100644 --- a/spring-ai-alibaba-examples/ollama-example/src/main/java/com/alibaba/cloud/ai/example/ollama/OllamaController.java +++ b/spring-ai-alibaba-examples/ollama-example/src/main/java/com/alibaba/cloud/ai/example/ollama/OllamaController.java @@ -7,14 +7,15 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; - @RestController @RequestMapping("/ai") public class OllamaController { private final ChatModel chatModel; + public OllamaController(ChatModel chatModel) { this.chatModel = chatModel; } + @GetMapping("/chat") public String chat(String input) { ChatResponse response = chatModel.call(new Prompt(input)); From 464fcd8a2f4cd161d13915546a875cbb40bfdd26 Mon Sep 17 00:00:00 2001 From: "Shitian.Wen" Date: Mon, 9 Dec 2024 13:52:26 +0800 Subject: [PATCH 2/2] example:update SpringAI version --- spring-ai-alibaba-examples/ollama-example/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-ai-alibaba-examples/ollama-example/pom.xml b/spring-ai-alibaba-examples/ollama-example/pom.xml index b83de4d0..0c51f622 100644 --- a/spring-ai-alibaba-examples/ollama-example/pom.xml +++ b/spring-ai-alibaba-examples/ollama-example/pom.xml @@ -28,7 +28,7 @@ org.springframework.ai spring-ai-bom - 1.0.0-M2 + 1.0.0-M3 pom import