ben-ai-models-registry 1.0.34 → 1.0.35
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/README.md +30 -6
- package/models/Run.js +33 -3
- package/models/User.js +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,19 +16,40 @@ To use these models in your application, follow these steps:
|
|
|
16
16
|
1. Install the package:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
|
|
20
19
|
npm install ben-ai-models-registry
|
|
20
|
+
```
|
|
21
21
|
|
|
22
22
|
2. Import the models:
|
|
23
23
|
|
|
24
|
-
```
|
|
25
|
-
|
|
24
|
+
```js
|
|
26
25
|
import { Run, JobStatus, LanguageObject } from 'ben-ai-models-registry';
|
|
26
|
+
```
|
|
27
27
|
|
|
28
|
+
### Modifying the Model Locally for Another Project
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
If you need to adapt the models for a specific project without immediately publishing changes to the `ben-ai-models-registry` package, you can modify them locally:
|
|
31
|
+
|
|
32
|
+
1. Navigate to the `ben-ai-models-registry` folder within your project's `node_modules` directory:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
<your_project>\node_modules\ben-ai-models-registry
|
|
36
|
+
```
|
|
30
37
|
|
|
31
|
-
|
|
38
|
+
2. Make your changes directly in the local files of the `ben-ai-models-registry` package.
|
|
39
|
+
|
|
40
|
+
3. To ensure your project uses the locally modified version, update the `package.json` file in your project (located at `<your_project>\package.json`) by specifying a local file dependency:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"ben-ai-models-registry": "file:../ben-ai-models-registry"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Note**: Adjust the relative path (`../ben-ai-models-registry`) based on the location of the ben-ai-models-registry folder relative to your project.
|
|
49
|
+
|
|
50
|
+
4. Run `npm install` in your project directory to apply the changes and link the local version of the package.
|
|
51
|
+
|
|
52
|
+
### Publishing Changes to the ben-ai-models-registry Package:
|
|
32
53
|
|
|
33
54
|
1. Clone the repository
|
|
34
55
|
2. Make your changes.
|
|
@@ -37,11 +58,14 @@ If you need to make changes to the models, follow these steps:
|
|
|
37
58
|
|
|
38
59
|
```sh
|
|
39
60
|
npm login
|
|
61
|
+
```
|
|
62
|
+
|
|
40
63
|
5. Publish the updated package to npm:
|
|
41
64
|
|
|
42
65
|
```sh
|
|
43
66
|
npm publish
|
|
67
|
+
```
|
|
44
68
|
|
|
45
|
-
Note
|
|
69
|
+
**Note**: You must have publishing access to the npm package to publish changes.
|
|
46
70
|
|
|
47
71
|
Feel free to contribute to the repository by submitting pull requests with your improvements and suggestions.
|
package/models/Run.js
CHANGED
|
@@ -4,6 +4,8 @@ const { Schema } = mongoose;
|
|
|
4
4
|
const AssistantModel = {
|
|
5
5
|
Langchain: "langchain-assistant",
|
|
6
6
|
OpenAI: "openAI-assistant",
|
|
7
|
+
Langchain: "langchain-assistant",
|
|
8
|
+
OpenAI: "openAI-assistant",
|
|
7
9
|
};
|
|
8
10
|
|
|
9
11
|
const ModelName = {
|
|
@@ -22,11 +24,28 @@ const ModelName = {
|
|
|
22
24
|
GPT3_5Turbo: "gpt-3.5-turbo",
|
|
23
25
|
GPT3_5Turbo1106: "gpt-3.5-turbo-1106",
|
|
24
26
|
GPT3_5TurboInstruct: "gpt-3.5-turbo-instruct",
|
|
27
|
+
GPT4O: "gpt-4o",
|
|
28
|
+
GPT4OMini: "gpt-4o-mini",
|
|
29
|
+
GPT4TurboPreview: "gpt-4-turbo-preview",
|
|
30
|
+
GPT4Turbo: "gpt-4-turbo",
|
|
31
|
+
GPT4Turbo20240409: "gpt-4-turbo-2024-04-09",
|
|
32
|
+
GPT40125Preview: "gpt-4-0125-preview",
|
|
33
|
+
GPT41106Preview: "gpt-4-1106-preview",
|
|
34
|
+
GPT4: "gpt-4",
|
|
35
|
+
GPT40613: "gpt-4-0613",
|
|
36
|
+
GPT432K: "gpt-4-32k",
|
|
37
|
+
GPT432K0613: "gpt-4-32k-0613",
|
|
38
|
+
GPT3_5Turbo0125: "gpt-3.5-turbo-0125",
|
|
39
|
+
GPT3_5Turbo: "gpt-3.5-turbo",
|
|
40
|
+
GPT3_5Turbo1106: "gpt-3.5-turbo-1106",
|
|
41
|
+
GPT3_5TurboInstruct: "gpt-3.5-turbo-instruct",
|
|
25
42
|
};
|
|
26
43
|
|
|
27
44
|
const RunType = {
|
|
28
45
|
SINGLE_LOOP: "single-loop",
|
|
29
46
|
PAIR_WISE_COMPARE: "pair-wise-compare",
|
|
47
|
+
SINGLE_LOOP: "single-loop",
|
|
48
|
+
PAIR_WISE_COMPARE: "pair-wise-compare",
|
|
30
49
|
};
|
|
31
50
|
|
|
32
51
|
const AnswerSchema = new Schema(
|
|
@@ -56,7 +75,7 @@ const AnswerSchema = new Schema(
|
|
|
56
75
|
const EvaluationQuestionSchema = new Schema(
|
|
57
76
|
{
|
|
58
77
|
question: { type: String },
|
|
59
|
-
score: { type:
|
|
78
|
+
score: { type: Number },
|
|
60
79
|
reasoning: { type: String },
|
|
61
80
|
},
|
|
62
81
|
{ versionKey: false }
|
|
@@ -67,17 +86,24 @@ const EvaluationSchema = new Schema(
|
|
|
67
86
|
criterion: { type: String },
|
|
68
87
|
questions: [EvaluationQuestionSchema],
|
|
69
88
|
reasoning: { type: String },
|
|
70
|
-
overallScore: { type:
|
|
89
|
+
overallScore: { type: Number },
|
|
71
90
|
},
|
|
72
91
|
{ timestamps: true, versionKey: false }
|
|
73
92
|
);
|
|
74
93
|
|
|
94
|
+
const RagEvaluation = new Schema({
|
|
95
|
+
correctness: { type: EvaluationQuestionSchema },
|
|
96
|
+
relevance: { type: EvaluationQuestionSchema },
|
|
97
|
+
groundedness: { type: EvaluationQuestionSchema },
|
|
98
|
+
retrievalRelevance: { type: EvaluationQuestionSchema },
|
|
99
|
+
});
|
|
100
|
+
|
|
75
101
|
const EvalSchema = new Schema(
|
|
76
102
|
{
|
|
77
103
|
evalData: [
|
|
78
104
|
{
|
|
79
105
|
answers: { type: [AnswerSchema] },
|
|
80
|
-
llmEvaluation: { type:
|
|
106
|
+
llmEvaluation: { type: RagEvaluation },
|
|
81
107
|
humanEvaluation: { type: [EvaluationSchema] },
|
|
82
108
|
humanOverallScore: { type: String },
|
|
83
109
|
},
|
|
@@ -108,8 +134,12 @@ const RunSchema = new mongoose.Schema(
|
|
|
108
134
|
},
|
|
109
135
|
evalResults: { type: [EvalSchema], required: true },
|
|
110
136
|
llmPassRate: { type: Schema.Types.Mixed },
|
|
137
|
+
relevanceScore: { type: Schema.Types.Mixed },
|
|
138
|
+
groundednessScore: { type: Schema.Types.Mixed },
|
|
139
|
+
retrievalRelevanceScore: { type: Schema.Types.Mixed },
|
|
111
140
|
humanPassRate: { type: Schema.Types.Mixed },
|
|
112
141
|
totalScore: { type: Schema.Types.Mixed },
|
|
142
|
+
numberOfRetrievedDocs: { type: Number },
|
|
113
143
|
},
|
|
114
144
|
{ timestamps: true, versionKey: false }
|
|
115
145
|
);
|
package/models/User.js
CHANGED
|
@@ -3,7 +3,12 @@ const { Schema } = mongoose;
|
|
|
3
3
|
|
|
4
4
|
const UserSchema = new Schema(
|
|
5
5
|
{
|
|
6
|
-
|
|
6
|
+
email: { type: String, required: true, unique: true },
|
|
7
|
+
firstName: { type: String, required: true },
|
|
8
|
+
lastName: { type: String, required: true },
|
|
9
|
+
organization: { type: String, required: true },
|
|
10
|
+
acceptedTerms: { type: Boolean, required: true },
|
|
11
|
+
acceptedFutureContact: { type: Boolean, default: false },
|
|
7
12
|
refName: {
|
|
8
13
|
type: String,
|
|
9
14
|
},
|
|
@@ -13,4 +18,4 @@ const UserSchema = new Schema(
|
|
|
13
18
|
{ timestamps: true, versionKey: false }
|
|
14
19
|
);
|
|
15
20
|
|
|
16
|
-
module.exports = mongoose.models.User || mongoose.model("User", UserSchema);
|
|
21
|
+
module.exports = mongoose.models.User || mongoose.model("User", UserSchema);
|