- When no explicit path is given in the browser, we automatically get redirected to the admin interface (eveai_app)

- Tuning moved to Retriever iso in the configuration, as this is an attribute that should be available for all types of Retrievers
This commit is contained in:
Josako
2024-10-31 08:32:02 +01:00
parent 532073d38e
commit 5841525b4c
6 changed files with 36 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ class EveAIRetriever(BaseModel):
_configuration: Dict[str, Any] = PrivateAttr()
_tenant_info: Dict[str, Any] = PrivateAttr()
_model_variables: ModelVariables = PrivateAttr()
_tuning: bool = PrivateAttr()
def __init__(self, catalog_id: int, user_metadata: Dict[str, Any], system_metadata: Dict[str, Any],
configuration: Dict[str, Any]):

View File

@@ -47,6 +47,7 @@ class Retriever(db.Model):
description = db.Column(db.Text, nullable=True)
catalog_id = db.Column(db.Integer, db.ForeignKey('catalog.id'), nullable=True)
type = db.Column(db.String(50), nullable=False, default="DEFAULT_RAG")
tuning = db.Column(db.Boolean, nullable=True, default=False)
# Meta Data
user_metadata = db.Column(JSONB, nullable=True)

View File

@@ -18,13 +18,6 @@ RETRIEVER_TYPES = {
"required": True,
"default": 0.3,
},
"rag_tuning": {
"name": "rag_tuning",
"type": "boolean",
"description": "Whether to do tuning logging or not.",
"required": False,
"default": False,
}
}
}
}

View File

@@ -113,6 +113,7 @@ class RetrieverForm(FlaskForm):
)
# Select Field for Retriever Type (Uses the RETRIEVER_TYPES defined in config)
type = SelectField('Retriever Type', validators=[DataRequired()])
tuning = BooleanField('Enable Tuning', default=False)
# Metadata fields
user_metadata = TextAreaField('User Metadata', validators=[Optional(), validate_json])
@@ -137,6 +138,7 @@ class EditRetrieverForm(DynamicFormBase):
)
# Select Field for Retriever Type (Uses the RETRIEVER_TYPES defined in config)
type = SelectField('Retriever Type', validators=[DataRequired()], render_kw={'readonly': True})
tuning = BooleanField('Enable Tuning', default=False)
# Metadata fields
user_metadata = TextAreaField('User Metadata', validators=[Optional(), validate_json])

View File

@@ -0,0 +1,29 @@
"""Add tuning to Retriever
Revision ID: 331f8100eb87
Revises: 6c5ca750e60c
Create Date: 2024-10-31 07:17:22.579376
"""
from alembic import op
import sqlalchemy as sa
import pgvector
# revision identifiers, used by Alembic.
revision = '331f8100eb87'
down_revision = '6c5ca750e60c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('retriever', sa.Column('tuning', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('retriever', 'tuning')
# ### end Alembic commands ###

View File

@@ -48,6 +48,9 @@ http {
#access_log logs/host.access.log main;
location = / {
return 301 /admin/;
}
location / {
root /etc/nginx/public;
index index.html index.htm;