Simplify model selection for both embeddings and LLM. Editing capabilities for new tenant columns...
This commit is contained in:
@@ -13,17 +13,19 @@ class TenantForm(FlaskForm):
|
||||
default_language = SelectField('Default Language', choices=[], validators=[DataRequired()])
|
||||
allowed_languages = SelectMultipleField('Allowed Languages', choices=[], validators=[DataRequired()])
|
||||
# LLM fields
|
||||
default_embedding_model = SelectField('Default Embedding Model', choices=[], validators=[DataRequired()])
|
||||
allowed_embedding_models = SelectMultipleField('Allowed Embedding Models', choices=[], validators=[DataRequired()])
|
||||
default_llm_model = SelectField('Default Large Language Model', choices=[], validators=[DataRequired()])
|
||||
allowed_llm_models = SelectMultipleField('Allowed Large Language Models', choices=[], validators=[DataRequired()])
|
||||
embedding_model = SelectField('Embedding Model', choices=[], validators=[DataRequired()])
|
||||
llm_model = SelectField('Large Language Model', choices=[], validators=[DataRequired()])
|
||||
# license fields
|
||||
license_start_date = DateField('License Start Date', id='form-control datepicker', validators=[Optional()])
|
||||
license_end_date = DateField('License End Date', id='form-control datepicker', validators=[Optional()])
|
||||
allowed_monthly_interactions = IntegerField('Allowed Monthly Interactions', validators=[NumberRange(min=0)])
|
||||
# Embedding variables
|
||||
html_tags = StringField('HTML Tags', validators=[DataRequired(), Length(max=255)],
|
||||
html_tags = StringField('HTML Tags', validators=[DataRequired()],
|
||||
default='p, h1, h2, h3, h4, h5, h6, li')
|
||||
html_end_tags = StringField('HTML End Tags', validators=[DataRequired()],
|
||||
default='p, li')
|
||||
html_included_elements = StringField('HTML Included Elements', validators=[Optional()])
|
||||
html_excluded_elements = StringField('HTML Excluded Elements', validators=[Optional()])
|
||||
|
||||
submit = SubmitField('Submit')
|
||||
|
||||
@@ -33,10 +35,8 @@ class TenantForm(FlaskForm):
|
||||
self.default_language.choices = [(lang, lang.lower()) for lang in current_app.config['SUPPORTED_LANGUAGES']]
|
||||
self.allowed_languages.choices = [(lang, lang.lower()) for lang in current_app.config['SUPPORTED_LANGUAGES']]
|
||||
# initialise LLM fields
|
||||
self.default_embedding_model.choices = [(model, model) for model in current_app.config['SUPPORTED_EMBEDDINGS']]
|
||||
self.allowed_embedding_models.choices = [(model, model) for model in current_app.config['SUPPORTED_EMBEDDINGS']]
|
||||
self.default_llm_model.choices = [(model, model) for model in current_app.config['SUPPORTED_LLMS']]
|
||||
self.allowed_llm_models.choices = [(model, model) for model in current_app.config['SUPPORTED_LLMS']]
|
||||
self.embedding_model.choices = [(model, model) for model in current_app.config['SUPPORTED_EMBEDDINGS']]
|
||||
self.llm_model.choices = [(model, model) for model in current_app.config['SUPPORTED_LLMS']]
|
||||
|
||||
|
||||
class BaseUserForm(FlaskForm):
|
||||
|
||||
Reference in New Issue
Block a user