ben-ai-models-registry 1.0.30 → 1.0.32

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.
@@ -1,41 +1,44 @@
1
1
  const mongoose = require("mongoose");
2
2
  const { Schema, Types } = mongoose;
3
3
 
4
- const OpenAIChatMessages = new Schema({
5
- role: {
6
- type: String,
7
- required: true,
8
- },
9
- content: {
10
- type: String,
11
- required: true,
12
- },
13
- AIchatId: {
14
- type: String,
15
- },
16
- }, { _id: false });
4
+ const chatMessages = new Schema(
5
+ {
6
+ role: {
7
+ type: String,
8
+ required: true,
9
+ },
10
+ content: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ },
15
+ { _id: false }
16
+ );
17
17
 
18
18
  const ChatMessageSchema = new mongoose.Schema(
19
- {
20
- assistantType: {
21
- type: String,
22
- enum: {
23
- values: ['openai', 'langchain'],
24
- },
25
- },
26
- programID: {
27
- type: mongoose.Schema.Types.ObjectId,
28
- ref: "Program",
29
- },
30
- bId: {
31
- type: String,
32
- },
33
- chatMessages: [OpenAIChatMessages],
34
- },
35
- {
36
- timestamps: true,
37
- versionKey: false,
38
- }
19
+ {
20
+ assistantType: {
21
+ type: String,
22
+ enum: {
23
+ values: ["openai", "langchain"],
24
+ },
25
+ },
26
+ programID: {
27
+ type: Types.ObjectId,
28
+ ref: "Program",
29
+ },
30
+ userId: {
31
+ type: Types.ObjectId,
32
+ ref: "User",
33
+ },
34
+ chatMessages: [chatMessages],
35
+ },
36
+ {
37
+ timestamps: true,
38
+ versionKey: false,
39
+ }
39
40
  );
40
41
 
41
- module.exports = mongoose.models.ChatMessages || mongoose.model("ChatMessages", ChatMessageSchema);
42
+ module.exports =
43
+ mongoose.models.ChatMessages ||
44
+ mongoose.model("ChatMessages", ChatMessageSchema);
package/models/Program.js CHANGED
@@ -137,6 +137,9 @@ const ProgramSchema = new Schema(
137
137
  // type: [ChunkingOptionsSchema],
138
138
  type: Schema.Types.Mixed,
139
139
  },
140
+ latestInstructions: {
141
+ type: String,
142
+ },
140
143
  status: {
141
144
  type: String,
142
145
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ben-ai-models-registry",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {