Class OllamaChatService

java.lang.Object
org.bsc.spring.OllamaChatService
All Implemented Interfaces:
ChatService

@Service("ollama") public class OllamaChatService extends Object implements ChatService
Service class that uses the ChatClient and the SpringAIToolService to execute an LLM request.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final List<org.springframework.ai.tool.ToolCallback>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    OllamaChatService(List<org.springframework.ai.tool.ToolCallback> agentFunctions)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.ai.chat.model.ChatResponse
    execute(List<org.springframework.ai.chat.messages.Message> messages)
     
    List<org.springframework.ai.tool.ToolCallback>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tools

      public final List<org.springframework.ai.tool.ToolCallback> tools
  • Constructor Details

    • OllamaChatService

      public OllamaChatService(List<org.springframework.ai.tool.ToolCallback> agentFunctions)
  • Method Details

    • tools

      public List<org.springframework.ai.tool.ToolCallback> tools()
      Specified by:
      tools in interface ChatService
    • execute

      public org.springframework.ai.chat.model.ChatResponse execute(List<org.springframework.ai.chat.messages.Message> messages)
      Specified by:
      execute in interface ChatService