Package ai.picovoice.picollm
Class Phi2Dialog
- java.lang.Object
-
- ai.picovoice.picollm.PicoLLMDialog
-
- ai.picovoice.picollm.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 classPhi2Dialog.BuilderBuilder class for constructing Phi2Dialog instances.
-
Field Summary
-
Fields inherited from class ai.picovoice.picollm.PicoLLMDialog
history, humanRequests, llmResponses, system
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPhi2Dialog(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.StringgetPrompt()Generates a prompt string based on the human requests and LLM responses.-
Methods inherited from class ai.picovoice.picollm.PicoLLMDialog
addHumanRequest, addLLMResponse
-
-
-
-
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 PicoLLMExceptionGenerates a prompt string based on the human requests and LLM responses.- Overrides:
getPromptin classPicoLLMDialog- Returns:
- The formatted prompt string.
- Throws:
PicoLLMException- If there is an issue generating the prompt.
-
-