Class OllamaBot


@Node public class OllamaBot extends Bot
LLM Chatbot powered by Ollama. They can chat, move, and perform gestures.
Author:
joe
  • Constructor Details

    • OllamaBot

      public OllamaBot()
  • Method Details

    • selfTest

      public void selfTest() throws Exception
      Description copied from class: Bot
      Self test runs on server startup. Exceptions are logged but otherwise ignored.
      Specified by:
      selfTest in class Bot
      Throws:
      Exception
    • getResponseAsync

      public reactor.core.publisher.Mono<String> getResponseAsync(Client c, String query)
      Description copied from class: Bot
      Response generation method that subclasses need to override.
      Specified by:
      getResponseAsync in class Bot
      Parameters:
      c - Client sending the query, typically User instance, may be Bot if respondToBots is true.
      query - Whatever user wrote.
      Returns:
      Mono that evaluates to the answer.
    • gesture

      @Tool(description="Perform a gesture") public void gesture(String gestureName)
    • move

      @Tool(description="Move to position") public void move(Double x, Double y, Double z)
    • setRotation

      @Tool(description="Set rotation around y axis to given angle") public void setRotation(@ToolParam(description="Destination angle in radians") Double angle)
    • rotate

      @Tool(description="Rotate around y axis for an angle") public void rotate(@ToolParam(description="Additional angle in radians") Double angle)
    • lookAt

      @Tool(description="Set your rotation to make your avatar look at given point") public void lookAt(Double x, Double y, Double z)
    • responding

      @Tool(description="Stop or start responding to user queries") public void responding(boolean responding)
    • getModelName

      public String getModelName()
    • getChatModel

      public org.springframework.ai.ollama.OllamaChatModel getChatModel()
    • getContextWindowSize

      public int getContextWindowSize()
    • getKeepAlive

      public String getKeepAlive()
    • getMemorySize

      public int getMemorySize()
    • getSystemMessage

      public org.springframework.ai.chat.messages.SystemMessage getSystemMessage()
    • getPromptTemplate

      public org.springframework.ai.chat.prompt.PromptTemplate getPromptTemplate()
    • getMemory

      public org.springframework.ai.chat.memory.ChatMemory getMemory()
    • getConversationId

      public String getConversationId()
    • getContextHelper

      public ContextHelper getContextHelper()
    • getToolNames

      public Set<String> getToolNames()
    • setModelName

      public void setModelName(String modelName)
    • setChatModel

      public void setChatModel(org.springframework.ai.ollama.OllamaChatModel chatModel)
    • setContextWindowSize

      public void setContextWindowSize(int contextWindowSize)
    • setKeepAlive

      public void setKeepAlive(String keepAlive)
    • setMemorySize

      public void setMemorySize(int memorySize)
    • setSystemMessage

      public void setSystemMessage(org.springframework.ai.chat.messages.SystemMessage systemMessage)
    • setPromptTemplate

      public void setPromptTemplate(org.springframework.ai.chat.prompt.PromptTemplate promptTemplate)
    • setMemory

      public void setMemory(org.springframework.ai.chat.memory.ChatMemory memory)
    • setConversationId

      public void setConversationId(String conversationId)
    • setContextHelper

      public void setContextHelper(ContextHelper contextHelper)
    • setToolNames

      public void setToolNames(Set<String> toolNames)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Bot
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Bot
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Bot
    • toString

      public String toString()
      Overrides:
      toString in class Bot