Skip to content

Commit

Permalink
Assistant: Add missing CreationOptional id/createdAt/updatedAt in con…
Browse files Browse the repository at this point in the history
…fig models
  • Loading branch information
PopDaph committed Sep 6, 2023
1 parent 689034e commit f3335cc
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
29 changes: 27 additions & 2 deletions front/lib/models/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
CreationOptional,
DataTypes,
ForeignKey,
InferAttributes,
Expand All @@ -18,7 +19,9 @@ export class AgentRetrievalConfiguration extends Model<
InferAttributes<AgentRetrievalConfiguration>,
InferCreationAttributes<AgentRetrievalConfiguration>
> {
declare id: number;
declare id: CreationOptional<number>;
declare createdAt: CreationOptional<Date>;
declare updatedAt: CreationOptional<Date>;

declare query: "auto" | "none" | "templated";
declare queryTemplate: string | null;
Expand All @@ -36,6 +39,16 @@ AgentRetrievalConfiguration.init(
autoIncrement: true,
primaryKey: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
query: {
type: DataTypes.STRING,
allowNull: false,
Expand Down Expand Up @@ -100,7 +113,9 @@ export class AgentDataSourceConfiguration extends Model<
InferAttributes<AgentDataSourceConfiguration>,
InferCreationAttributes<AgentDataSourceConfiguration>
> {
declare id: number;
declare id: CreationOptional<number>;
declare createdAt: CreationOptional<Date>;
declare updatedAt: CreationOptional<Date>;

declare minTimestamp: number | null;
declare maxTimestamp: number | null;
Expand All @@ -124,6 +139,16 @@ AgentDataSourceConfiguration.init(
autoIncrement: true,
primaryKey: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
minTimestamp: {
type: DataTypes.INTEGER,
allowNull: true,
Expand Down
29 changes: 27 additions & 2 deletions front/lib/models/assistant/agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
CreationOptional,
DataTypes,
ForeignKey,
InferAttributes,
Expand All @@ -21,7 +22,9 @@ export class AgentConfiguration extends Model<
InferAttributes<AgentConfiguration>,
InferCreationAttributes<AgentConfiguration>
> {
declare id: number;
declare id: CreationOptional<number>;
declare createdAt: CreationOptional<Date>;
declare updatedAt: CreationOptional<Date>;

declare sId: string;
declare status: AgentConfigurationStatus;
Expand All @@ -40,6 +43,16 @@ AgentConfiguration.init(
autoIncrement: true,
primaryKey: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
sId: {
type: DataTypes.STRING,
allowNull: false,
Expand Down Expand Up @@ -95,7 +108,9 @@ export class AgentGenerationConfiguration extends Model<
InferAttributes<AgentGenerationConfiguration>,
InferCreationAttributes<AgentGenerationConfiguration>
> {
declare id: number;
declare id: CreationOptional<number>;
declare createdAt: CreationOptional<Date>;
declare updatedAt: CreationOptional<Date>;

declare prompt: string;
declare modelProvider: string;
Expand All @@ -110,6 +125,16 @@ AgentGenerationConfiguration.init(
autoIncrement: true,
primaryKey: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
prompt: {
type: DataTypes.TEXT,
allowNull: false,
Expand Down

0 comments on commit f3335cc

Please sign in to comment.