12 lines
536 B
Python
12 lines
536 B
Python
|
|
from flask_wtf import FlaskForm
|
||
|
|
from wtforms import TextAreaField, SubmitField, IntegerField
|
||
|
|
from wtforms.validators import DataRequired, Length, NumberRange
|
||
|
|
|
||
|
|
class PromptForm(FlaskForm):
|
||
|
|
input_text = TextAreaField('输入文本', validators=[DataRequired(), Length(min=1, max=1000)])
|
||
|
|
submit = SubmitField('生成提示词')
|
||
|
|
|
||
|
|
class FeedbackForm(FlaskForm):
|
||
|
|
rating = IntegerField('评分', validators=[DataRequired(), NumberRange(min=1, max=5)])
|
||
|
|
comment = TextAreaField('评论')
|
||
|
|
submit = SubmitField('提交反馈')
|