Class Ollama4jChatController
java.lang.Object
com.bytedesk.ai.springai.providers.ollama.Ollama4jChatController
@RestController
@RequestMapping("/api/v1/ollama4j/chat")
@ConditionalOnProperty(prefix="spring.ai.ollama.chat",
name="enabled",
havingValue="true",
matchIfMissing=false)
public class Ollama4jChatController
extends Object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?>
getAsyncAnswer
(OllamaRequest request) org.springframework.http.ResponseEntity<?>
getChatWithContext
(OllamaRequest request) org.springframework.web.servlet.mvc.method.annotation.SseEmitter
getStreamAnswerSse
(OllamaRequest request) org.springframework.http.ResponseEntity<?>
getSyncAnswer
(OllamaRequest request) org.springframework.http.ResponseEntity<?>
getSyncAnswerStream
(OllamaRequest request)
-
Field Details
-
ollama4jApi
@Autowired @Qualifier("ollama4jApi") private io.github.ollama4j.OllamaAPI ollama4jApi -
ollamaDefaultModel
-
-
Constructor Details
-
Ollama4jChatController
public Ollama4jChatController()
-
-
Method Details
-
getSyncAnswer
@RequestMapping("/sync") public org.springframework.http.ResponseEntity<?> getSyncAnswer(OllamaRequest request) -
getSyncAnswerStream
@RequestMapping("/stream") public org.springframework.http.ResponseEntity<?> getSyncAnswerStream(OllamaRequest request) -
getStreamAnswerSse
@RequestMapping("/stream-sse") public org.springframework.web.servlet.mvc.method.annotation.SseEmitter getStreamAnswerSse(OllamaRequest request) -
getAsyncAnswer
@GetMapping("/async") public org.springframework.http.ResponseEntity<?> getAsyncAnswer(OllamaRequest request) throws InterruptedException - Throws:
InterruptedException
-
getChatWithContext
@GetMapping("/context") public org.springframework.http.ResponseEntity<?> getChatWithContext(OllamaRequest request) throws io.github.ollama4j.exceptions.OllamaBaseException, IOException, InterruptedException - Throws:
io.github.ollama4j.exceptions.OllamaBaseException
IOException
InterruptedException
-