first commit

This commit is contained in:
2025-11-06 11:08:59 +01:00
commit 3c5117c2c3
85 changed files with 13275 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
module.exports = (sequelize, DataTypes) => {
const TrainingData = sequelize.define('TrainingData', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
model_version_id: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'model_versions',
key: 'id'
}
},
data_type: {
type: DataTypes.ENUM('qa_pair', 'plan_pair', 'feedback', 'preference'),
allowNull: false
},
input_text: {
type: DataTypes.TEXT,
allowNull: false
},
output_text: {
type: DataTypes.TEXT,
allowNull: false
},
context: {
type: DataTypes.JSONB,
defaultValue: {}
},
quality_score: {
type: DataTypes.FLOAT,
allowNull: true
},
is_validated: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
validation_notes: {
type: DataTypes.TEXT,
allowNull: true
},
source: {
type: DataTypes.ENUM('expert', 'user', 'generated', 'feedback'),
allowNull: false
},
metadata: {
type: DataTypes.JSONB,
defaultValue: {}
}
}, {
tableName: 'training_data',
indexes: [
{ fields: ['model_version_id'] },
{ fields: ['data_type'] },
{ fields: ['is_validated'] },
{ fields: ['source'] },
{ fields: ['quality_score'] }
]
});
return TrainingData;
};