Package com.vaadin.flow.ai.formfiller
Class FormFiller
java.lang.Object
com.vaadin.flow.ai.formfiller.FormFiller
FormFiller component that using AI ChatGPT fills automatically
from a natural language input text a component or group of
components (layout).
Components supported:
The text field will be filled with "John".
Components supported:
- TextField
- EmailField
- PasswordField
- NumberField
- IntegerField
- BigDecimalField
- DatePicker
- TimePicker
- DateTimePicker
- TextArea
- Checkbox
- CheckboxGroup
- RadioButtonGroup
- ComboBox
- MultiSelectComboBox
- Grid
TextField textField = new TextField();
textField.setId("name");
FormLayout fl = new FormLayout();
fl.add(textField);
FormFiller formFiller = new FormFiller(fl);
formFiller.fill("My name is John");
The text field will be filled with "John".
- Author:
- Vaadin Ltd.
-
Constructor Summary
ConstructorsConstructorDescriptionFormFiller(com.vaadin.flow.component.Component target) Creates a FormFiller with default llmService, empty field instructions and empty context instructions.FormFiller(com.vaadin.flow.component.Component target, LLMService llmService) Creates a FormFiller with empty context instructions and empty context instructions with the given llmService.FormFiller(com.vaadin.flow.component.Component target, List<String> contextInstructions) Creates a FormFiller with default llmService and empty field instructions.FormFiller(com.vaadin.flow.component.Component target, Map<com.vaadin.flow.component.Component, String> componentInstructions) Creates a FormFiller with default llmService and empty context instructions.FormFiller(com.vaadin.flow.component.Component target, Map<com.vaadin.flow.component.Component, String> componentInstructions, List<String> contextInstructions) Creates a FormFiller with default llmService.FormFiller(com.vaadin.flow.component.Component target, Map<com.vaadin.flow.component.Component, String> componentInstructions, List<String> contextInstructions, LLMService llmService) Creates a FormFiller to fill the target component or group of components (layout) and includes additional instructions for the AI module (i.e.: field format, field context, etc...) -
Method Summary
Modifier and TypeMethodDescriptionFills automatically the target component analyzing the input source
-
Constructor Details
-
FormFiller
public FormFiller(com.vaadin.flow.component.Component target, Map<com.vaadin.flow.component.Component, String> componentInstructions, List<String> contextInstructions, LLMService llmService) Creates a FormFiller to fill the target component or group of components (layout) and includes additional instructions for the AI module (i.e.: field format, field context, etc...)- Parameters:
target- the target component or group of components (layout) to fillcomponentInstructions- additional instructions for the AI module (i.e.: field format, field explanation, etc...). Use these instructions to provide additional information to the AI module about a specific field when the response of the form filler is not accurate enough.contextInstructions- additional instructions for the AI module (i.e.: target language, vocabulary explanation, etc..). Use these instructions to provide additional information to the AI module about the context of the input source in general.llmService- the AI module service to use. By default, this service would use OpenAI ChatGPT.- Throws:
ExperimentalFeatureException- when theFeatureFlags.FORM_FILLER_ADDONfeature is not enabled
-
FormFiller
public FormFiller(com.vaadin.flow.component.Component target, Map<com.vaadin.flow.component.Component, String> componentInstructions, List<String> contextInstructions) Creates a FormFiller with default llmService. CheckFormFillerfor more information. -
FormFiller
public FormFiller(com.vaadin.flow.component.Component target, Map<com.vaadin.flow.component.Component, String> componentInstructions) Creates a FormFiller with default llmService and empty context instructions. CheckFormFillerfor more information. -
FormFiller
Creates a FormFiller with default llmService and empty field instructions. CheckFormFillerfor more information. -
FormFiller
public FormFiller(com.vaadin.flow.component.Component target) Creates a FormFiller with default llmService, empty field instructions and empty context instructions. CheckFormFillerfor more information. -
FormFiller
Creates a FormFiller with empty context instructions and empty context instructions with the given llmService. CheckFormFillerfor more information.
-
-
Method Details
-
fill
Fills automatically the target component analyzing the input source- Parameters:
input- Text input to send to the AI module- Returns:
- result of the query including request and response
-
getComponentInstructions
-
getContextInstructions
-
getMapping
-