Package ai.picovoice.picollm
Class PicoLLM.DialogBuilder
- java.lang.Object
-
- ai.picovoice.picollm.PicoLLM.DialogBuilder
-
- Enclosing class:
- PicoLLM
public class PicoLLM.DialogBuilder extends java.lang.ObjectBuilder class for creating a `PicoLLMDialog` instance.
-
-
Constructor Summary
Constructors Constructor Description DialogBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PicoLLMDialogbuild()Constructs a PicoLLMDialog instance based on the configured settings.PicoLLM.DialogBuildersetHistory(int history)Sets the history length for the dialog builder.PicoLLM.DialogBuildersetMode(java.lang.String mode)Sets the mode for the dialog builder.PicoLLM.DialogBuildersetSystem(java.lang.String system)Sets the system instruction for the dialog builder.
-
-
-
Method Detail
-
setMode
public PicoLLM.DialogBuilder setMode(java.lang.String mode)
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
public PicoLLM.DialogBuilder setHistory(int history)
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
public PicoLLM.DialogBuilder setSystem(java.lang.String system)
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
public PicoLLMDialog build() throws PicoLLMException
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.
-
-