Class Ollama4jChatController
java.lang.Object
com.bytedesk.ai.provider.vendors.ollama.Ollama4jChatController
@RestController
@RequestMapping("/ollama4j/chat")
public class Ollama4jChatController
extends Object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?>
getAsyncAnswer
(String message) org.springframework.http.ResponseEntity<?>
getChatWithContext
(String message) org.springframework.web.servlet.mvc.method.annotation.SseEmitter
getStreamAnswerSse
(String message) org.springframework.http.ResponseEntity<?>
getSyncAnswer
(String message) org.springframework.http.ResponseEntity<?>
getSyncAnswerStream
(String message)
-
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(@RequestParam(value="message",defaultValue="Tell me a joke") String message) -
getSyncAnswerStream
@RequestMapping("/stream") public org.springframework.http.ResponseEntity<?> getSyncAnswerStream(@RequestParam(value="message",defaultValue="Tell me a joke") String message) -
getStreamAnswerSse
@RequestMapping("/stream-sse") public org.springframework.web.servlet.mvc.method.annotation.SseEmitter getStreamAnswerSse(@RequestParam(value="message",defaultValue="Tell me a joke") String message) -
getAsyncAnswer
@GetMapping("/async") public org.springframework.http.ResponseEntity<?> getAsyncAnswer(@RequestParam(value="message",defaultValue="Tell me a joke") String message) throws InterruptedException - Throws:
InterruptedException
-
getChatWithContext
@GetMapping("/context") public org.springframework.http.ResponseEntity<?> getChatWithContext(@RequestParam(value="message",defaultValue="Tell me a joke") String message) throws io.github.ollama4j.exceptions.OllamaBaseException, IOException, InterruptedException - Throws:
io.github.ollama4j.exceptions.OllamaBaseException
IOException
InterruptedException
-