- 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:
@@ -11,6 +11,7 @@ class EveAIRetriever(BaseModel):
|
|||||||
_configuration: Dict[str, Any] = PrivateAttr()
|
_configuration: Dict[str, Any] = PrivateAttr()
|
||||||
_tenant_info: Dict[str, Any] = PrivateAttr()
|
_tenant_info: Dict[str, Any] = PrivateAttr()
|
||||||
_model_variables: ModelVariables = PrivateAttr()
|
_model_variables: ModelVariables = PrivateAttr()
|
||||||
|
_tuning: bool = PrivateAttr()
|
||||||
|
|
||||||
def __init__(self, catalog_id: int, user_metadata: Dict[str, Any], system_metadata: Dict[str, Any],
|
def __init__(self, catalog_id: int, user_metadata: Dict[str, Any], system_metadata: Dict[str, Any],
|
||||||
configuration: Dict[str, Any]):
|
configuration: Dict[str, Any]):
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class Retriever(db.Model):
|
|||||||
description = db.Column(db.Text, nullable=True)
|
description = db.Column(db.Text, nullable=True)
|
||||||
catalog_id = db.Column(db.Integer, db.ForeignKey('catalog.id'), 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")
|
type = db.Column(db.String(50), nullable=False, default="DEFAULT_RAG")
|
||||||
|
tuning = db.Column(db.Boolean, nullable=True, default=False)
|
||||||
|
|
||||||
# Meta Data
|
# Meta Data
|
||||||
user_metadata = db.Column(JSONB, nullable=True)
|
user_metadata = db.Column(JSONB, nullable=True)
|
||||||
|
|||||||
@@ -18,13 +18,6 @@ RETRIEVER_TYPES = {
|
|||||||
"required": True,
|
"required": True,
|
||||||
"default": 0.3,
|
"default": 0.3,
|
||||||
},
|
},
|
||||||
"rag_tuning": {
|
|
||||||
"name": "rag_tuning",
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Whether to do tuning logging or not.",
|
|
||||||
"required": False,
|
|
||||||
"default": False,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ class RetrieverForm(FlaskForm):
|
|||||||
)
|
)
|
||||||
# Select Field for Retriever Type (Uses the RETRIEVER_TYPES defined in config)
|
# Select Field for Retriever Type (Uses the RETRIEVER_TYPES defined in config)
|
||||||
type = SelectField('Retriever Type', validators=[DataRequired()])
|
type = SelectField('Retriever Type', validators=[DataRequired()])
|
||||||
|
tuning = BooleanField('Enable Tuning', default=False)
|
||||||
|
|
||||||
# Metadata fields
|
# Metadata fields
|
||||||
user_metadata = TextAreaField('User Metadata', validators=[Optional(), validate_json])
|
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)
|
# Select Field for Retriever Type (Uses the RETRIEVER_TYPES defined in config)
|
||||||
type = SelectField('Retriever Type', validators=[DataRequired()], render_kw={'readonly': True})
|
type = SelectField('Retriever Type', validators=[DataRequired()], render_kw={'readonly': True})
|
||||||
|
tuning = BooleanField('Enable Tuning', default=False)
|
||||||
|
|
||||||
# Metadata fields
|
# Metadata fields
|
||||||
user_metadata = TextAreaField('User Metadata', validators=[Optional(), validate_json])
|
user_metadata = TextAreaField('User Metadata', validators=[Optional(), validate_json])
|
||||||
|
|||||||
@@ -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 ###
|
||||||
@@ -48,6 +48,9 @@ http {
|
|||||||
|
|
||||||
#access_log logs/host.access.log main;
|
#access_log logs/host.access.log main;
|
||||||
|
|
||||||
|
location = / {
|
||||||
|
return 301 /admin/;
|
||||||
|
}
|
||||||
location / {
|
location / {
|
||||||
root /etc/nginx/public;
|
root /etc/nginx/public;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
|||||||
Reference in New Issue
Block a user