Class Ollama4jChatController

java.lang.Object
com.bytedesk.ai.provider.vendors.ollama.Ollama4jChatController

@RestController @RequestMapping("/ollama4j/chat") public class Ollama4jChatController extends Object
  • Field Details

    • ollama4jApi

      @Autowired @Qualifier("ollama4jApi") private io.github.ollama4j.OllamaAPI ollama4jApi
    • ollamaDefaultModel

      @Value("${spring.ai.ollama.chat.options.model}") private String 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