From pipeline > config > UI. Provide example project for promptui - Pipeline to config: `kotaemon.contribs.promptui.config.export_pipeline_to_config`. The config follows schema specified in this document: https://cinnamon-ai.atlassian.net/wiki/spaces/ATM/pages/2748711193/Technical+Detail. Note: this implementation exclude the logs, which will be handled in AUR-408. - Config to UI: `kotaemon.contribs.promptui.build_from_yaml` - Example project is located at `examples/promptui/`
21 lines
532 B
Python
21 lines
532 B
Python
import gradio as gr
|
|
|
|
COMPONENTS_CLASS = {
|
|
"text": gr.components.Textbox,
|
|
"checkbox": gr.components.CheckboxGroup,
|
|
"dropdown": gr.components.Dropdown,
|
|
"file": gr.components.File,
|
|
"image": gr.components.Image,
|
|
"number": gr.components.Number,
|
|
"radio": gr.components.Radio,
|
|
"slider": gr.components.Slider,
|
|
}
|
|
SUPPORTED_COMPONENTS = set(COMPONENTS_CLASS.keys())
|
|
DEFAULT_COMPONENT_BY_TYPES = {
|
|
"str": "text",
|
|
"bool": "checkbox",
|
|
"int": "number",
|
|
"float": "number",
|
|
"list": "dropdown",
|
|
}
|