ben-ai-models-registry 1.0.44 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -0
- package/models/ChatMessages.js +4 -0
- package/models/FileStore.js +17 -0
- package/models/Files.js +13 -0
- package/models/ScraperConfig.js +7 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const FileStore = require("./models/FileStore");
|
|
|
13
13
|
const State = require("./models/State");
|
|
14
14
|
const StatePermission = require("./models/StatePermission");
|
|
15
15
|
const UserChatHistory = require("./models/UserChatHistory");
|
|
16
|
+
const ScraperConfig = require("./models/ScraperConfig");
|
|
16
17
|
|
|
17
18
|
module.exports = {
|
|
18
19
|
JobStatus,
|
|
@@ -29,4 +30,5 @@ module.exports = {
|
|
|
29
30
|
EventLog,
|
|
30
31
|
FileStore,
|
|
31
32
|
UserChatHistory,
|
|
33
|
+
ScraperConfig,
|
|
32
34
|
};
|
package/models/ChatMessages.js
CHANGED
package/models/FileStore.js
CHANGED
|
@@ -3,6 +3,22 @@ const ChunkingOptionsSchema = require("./utils/sharedSchemas/ChunkingOptionsSche
|
|
|
3
3
|
|
|
4
4
|
const { Schema, Types } = mongoose;
|
|
5
5
|
|
|
6
|
+
const FileStatusSchema = new Schema(
|
|
7
|
+
{
|
|
8
|
+
fileId: {
|
|
9
|
+
type: Schema.Types.ObjectId,
|
|
10
|
+
ref: "Files",
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
ingestionStatus: {
|
|
14
|
+
type: String,
|
|
15
|
+
enum: ["not ingested", "in progress", "ingested", "skipped", "failed"],
|
|
16
|
+
default: "not ingested",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{ _id: false }
|
|
20
|
+
);
|
|
21
|
+
|
|
6
22
|
const FileStoreSchema = new Schema(
|
|
7
23
|
{
|
|
8
24
|
stateId: { type: mongoose.Schema.Types.ObjectId, ref: "State" },
|
|
@@ -14,6 +30,7 @@ const FileStoreSchema = new Schema(
|
|
|
14
30
|
required: true,
|
|
15
31
|
unique: true,
|
|
16
32
|
},
|
|
33
|
+
filesWithStatus: [FileStatusSchema],
|
|
17
34
|
files: [{ type: Schema.Types.ObjectId, ref: "Files" }],
|
|
18
35
|
openAI: {
|
|
19
36
|
assistantId: {
|
package/models/Files.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
const mongoose = require("mongoose");
|
|
2
2
|
const { Schema } = mongoose;
|
|
3
3
|
|
|
4
|
+
const ScraperMetadataSchema = new Schema({
|
|
5
|
+
scraperId: { type: Schema.Types.ObjectId, ref: "ScraperConfig" },
|
|
6
|
+
contentLength: { type: Number },
|
|
7
|
+
scrapedAt: { type: Date },
|
|
8
|
+
sourceUrl: { type: String }
|
|
9
|
+
}, { _id: false });
|
|
10
|
+
|
|
4
11
|
const FileSchema = new Schema(
|
|
5
12
|
{
|
|
6
13
|
stateId: { type: mongoose.Schema.Types.ObjectId, ref: "State" },
|
|
14
|
+
programId: { type: Schema.Types.ObjectId, ref: "Program", required: true },
|
|
7
15
|
displayName: {
|
|
8
16
|
type: String,
|
|
9
17
|
required: [true, "Please provide a display name."],
|
|
@@ -23,6 +31,11 @@ const FileSchema = new Schema(
|
|
|
23
31
|
openAIFileId: {
|
|
24
32
|
type: String,
|
|
25
33
|
},
|
|
34
|
+
scraperMetadata: {
|
|
35
|
+
type: ScraperMetadataSchema,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
source: { type: String, default: "scraper", required: false},
|
|
26
39
|
},
|
|
27
40
|
{ timestamps: true, versionKey: false }
|
|
28
41
|
);
|