- Finish editing of Specialists with overview, agent - task - tool editor

- Split differrent caching mechanisms (types, version tree, config) into different cachers
- Improve resource usage on starting components, and correct gevent usage
- Refine repopack usage for eveai_app (too large)
- Change nginx dockerfile to allow for specialist overviews being served statically
This commit is contained in:
Josako
2025-01-23 09:43:48 +01:00
parent 7bddeb0ebd
commit d106520d22
39 changed files with 1312 additions and 281 deletions

View File

@@ -21,7 +21,6 @@ def get_tools():
class SpecialistForm(FlaskForm):
name = StringField('Name', validators=[DataRequired(), Length(max=50)])
description = TextAreaField('Description', validators=[DataRequired()])
retrievers = QuerySelectMultipleField(
'Retrievers',
@@ -37,14 +36,14 @@ class SpecialistForm(FlaskForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
types_dict = cache_manager.specialist_config_cache.get_types()
types_dict = cache_manager.specialists_types_cache.get_types()
# Dynamically populate the 'type' field using the constructor
self.type.choices = [(key, value['name']) for key, value in types_dict.items()]
class EditSpecialistForm(DynamicFormBase):
name = StringField('Name', validators=[DataRequired()])
description = TextAreaField('Description', validators=[DataRequired()])
description = TextAreaField('Description', validators=[Optional()])
retrievers = QuerySelectMultipleField(
'Retrievers',
@@ -55,6 +54,7 @@ class EditSpecialistForm(DynamicFormBase):
)
type = StringField('Specialist Type', validators=[DataRequired()], render_kw={'readonly': True})
type_version = StringField('Type Version', validators=[DataRequired()], render_kw={'readonly': True})
tuning = BooleanField('Enable Retrieval Tuning', default=False)
@@ -76,41 +76,21 @@ class BaseEditComponentForm(DynamicFormBase):
name = StringField('Name', validators=[DataRequired()])
description = TextAreaField('Description', validators=[Optional()])
type = StringField('Type', validators=[DataRequired()], render_kw={'readonly': True})
type_version = StringField('Type Version', validators=[DataRequired()], render_kw={'readonly': True})
tuning = BooleanField('Enable Tuning', default=False)
class EveAIAgentForm(BaseComponentForm):
role = TextAreaField('Role', validators=[DataRequired()])
goal = TextAreaField('Goal', validators=[DataRequired()])
backstory = TextAreaField('Backstory', validators=[DataRequired()])
tools = QuerySelectMultipleField(
'Tools',
query_factory=get_tools,
get_label='name',
allow_blank=True,
description='Select one or more tools that can be used this agent'
)
def __init__(self, *args, type_config=None, **kwargs):
super().__init__(*args, **kwargs)
if type_config:
self.type.choices = [(key, value['name']) for key, value in type_config.items()]
class EditEveAIAgentForm(BaseEditComponentForm):
role = StringField('Role', validators=[DataRequired()])
goal = StringField('Goal', validators=[DataRequired()])
backstory = StringField('Backstory', validators=[DataRequired()])
tools = QuerySelectMultipleField(
'Tools',
query_factory=get_tools,
get_label='name',
allow_blank=True,
description='Select one or more tools that can be used this agent'
)
role = TextAreaField('Role', validators=[Optional()])
goal = TextAreaField('Goal', validators=[Optional()])
backstory = TextAreaField('Backstory', validators=[Optional()])
class EveAITaskForm(BaseComponentForm):
expected_output = TextAreaField('Expected Output', validators=[DataRequired()])
class EditEveAITaskForm(BaseEditComponentForm):
task_description = StringField('Task Description', validators=[Optional()])
expected_outcome = StringField('Expected Outcome', validators=[Optional()])
class EditEveAIToolForm(BaseEditComponentForm):
pass