Class Phi2Dialog

  • Direct Known Subclasses:
    Phi2ChatDialog, Phi2QADialog

    public class Phi2Dialog
    extends PicoLLMDialog
    Represents a dialog helper for the 'phi-2' model within PicoLLM. This is a base class that provides functionalities common to both 'chat' and 'qa' modes
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  Phi2Dialog.Builder
      Builder class for constructing Phi2Dialog instances.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Phi2Dialog​(java.lang.String humanTag, java.lang.String llmTag, java.lang.Integer history, java.lang.String system)
      Constructs a Phi2Dialog instance with the specified history, system, human tag, and LLM tag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPrompt()
      Generates a prompt string based on the human requests and LLM responses.
      • Methods inherited from class java.lang.Object

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

      • Phi2Dialog

        protected Phi2Dialog​(java.lang.String humanTag,
                             java.lang.String llmTag,
                             java.lang.Integer history,
                             java.lang.String system)
        Constructs a Phi2Dialog instance with the specified history, system, human tag, and LLM tag.
        Parameters:
        humanTag - The tag representing human input.
        llmTag - The tag representing LLM output.
        history - The history length for the dialog.
        system - The system instruction for configuring the model's responses.
    • Method Detail

      • getPrompt

        public java.lang.String getPrompt()
                                   throws PicoLLMException
        Generates a prompt string based on the human requests and LLM responses.
        Overrides:
        getPrompt in class PicoLLMDialog
        Returns:
        The formatted prompt string.
        Throws:
        PicoLLMException - If there is an issue generating the prompt.