Interface IAssistant

All Superinterfaces:
AutoCloseable, Closeable

public interface IAssistant extends Closeable, AutoCloseable
Interface for an AI assistant
  • Method Details

    • getUsage

      String getUsage()
      Get the assistant usage
      Returns:
      the assistant usage
    • ask

      ILanguageMessage ask(String message)
      Ask a question to the assistant
      Parameters:
      message - the message to ask
      Returns:
      the assistant response
    • ask

      ILanguageMessage ask(String message, IMultimodalContent... contents)
      Ask a question to the assistant with multimodal contents
      Parameters:
      message - the message to ask
      contents - the multimodal contents to provide to the assistant
      Returns:
      the assistant response
    • insertContext

      void insertContext(String context)
      Insert system context to the assistant
      Parameters:
      context - the context to insert
    • isAdditionalContextAdded

      boolean isAdditionalContextAdded()
      Check if additional context has been added to the assistant This is used to avoid adding the same context multiple times
      Returns:
      true if additional context has been added
    • setAdditionalContextAdded

      void setAdditionalContextAdded(boolean additionalContextAdded)
      Set to true if additional context has been added to the assistant This is used to avoid adding the same context multiple times
      Parameters:
      additionalContextAdded - true if additional context has been added
    • getLanguageModelConnection

      ILanguageModelConnection getLanguageModelConnection()
      Get language model connection used by the assistant
      Returns:
      the language model connection
    • getAdditionalSources

      Collection<IChatResponseSource> getAdditionalSources()
      Get additional chat response sources configured in the assistant
      Returns:
      the collection of additional chat response sources
    • checkChatMemory

      boolean checkChatMemory(String newMessage)
      Check if chat memory can accept a new message
      Parameters:
      newMessage - the new message to check
      Returns:
      true if the chat memory can accept the new message
    • getAdditionalParameters

      Map<String,Object> getAdditionalParameters()
      Get additional parameters sent to the assistant
      Returns:
      the map of additional parameters
    • close

      void close() throws IOException
      Close the assistant and release resources
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException