Class PicoLLMDialog

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  PicoLLMDialog.Builder
      Builder class for constructing instances of PicoLLMDialog.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Integer history  
      protected java.util.ArrayList<java.lang.String> humanRequests  
      protected java.util.ArrayList<java.lang.String> llmResponses  
      protected java.lang.String system  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PicoLLMDialog​(java.lang.Integer history, java.lang.String system)
      Constructs a new instance of PicoLLMDialog with the specified history and system settings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHumanRequest​(java.lang.String content)
      Adds a human request to the dialog.
      void addLLMResponse​(java.lang.String content)
      Adds an LLM response to the dialog.
      java.lang.String getPrompt()
      Creates a prompt string given parameters passed the constructor and dialog's content.
      • Methods inherited from class java.lang.Object

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

      • history

        protected final java.lang.Integer history
      • system

        protected final java.lang.String system
      • humanRequests

        protected final java.util.ArrayList<java.lang.String> humanRequests
      • llmResponses

        protected final java.util.ArrayList<java.lang.String> llmResponses
    • Constructor Detail

      • PicoLLMDialog

        protected PicoLLMDialog​(java.lang.Integer history,
                                java.lang.String system)
        Constructs a new instance of PicoLLMDialog with the specified history and system settings.
        Parameters:
        history - The history length for the dialog.
        system - The system instruction for configuring the model's responses.
    • Method Detail

      • addHumanRequest

        public void addHumanRequest​(java.lang.String content)
                             throws PicoLLMInvalidStateException
        Adds a human request to the dialog.
        Parameters:
        content - The human request to add.
        Throws:
        PicoLLMInvalidStateException - if adding a human request without a corresponding LLM response.
      • addLLMResponse

        public void addLLMResponse​(java.lang.String content)
                            throws PicoLLMInvalidStateException
        Adds an LLM response to the dialog.
        Parameters:
        content - The LLM response to add.
        Throws:
        PicoLLMInvalidStateException - if adding an LLM response without a corresponding human request.
      • getPrompt

        public java.lang.String getPrompt()
                                   throws PicoLLMException
        Creates a prompt string given parameters passed the constructor and dialog's content.
        Returns:
        Formatted prompt.
        Throws:
        PicoLLMException - if called from the base PicoLLMDialog class.