Package ai.picovoice.picollm
Class PicoLLM.DialogBuilder
java.lang.Object
ai.picovoice.picollm.PicoLLM.DialogBuilder
- Enclosing class:
- PicoLLM
Builder class for creating a `PicoLLMDialog` instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs a PicoLLMDialog instance based on the configured settings.setHistory(int history) Sets the history length for the dialog builder.Sets the mode for the dialog builder.Sets the system instruction for the dialog builder.
-
Constructor Details
-
DialogBuilder
public DialogBuilder()
-
-
Method Details
-
setMode
Sets the mode for the dialog builder.- Parameters:
mode- The mode to set. Some models (e.g., `phi-2`) define multiple chat template modes. For example, `phi-2` allows both `qa` and `chat` modes.- Returns:
- DialogBuilder instance.
-
setHistory
Sets the history length for the dialog builder.- Parameters:
history- The history length to set. History refers to the number of latest back-and-forths to include in the prompt. Setting history to `null` will embed the entire dialog in the prompt.- Returns:
- DialogBuilder instance.
-
setSystem
Sets the system instruction for the dialog builder.- Parameters:
system- The system instruction to set. System instruction to embed in the prompt for configuring the model's responses.- Returns:
- DialogBuilder instance.
-
build
Constructs a PicoLLMDialog instance based on the configured settings.- Returns:
- A new instance of PicoLLMDialog.
- Throws:
PicoLLMException- If there's an issue constructing the dialog.
-