File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
tests/accuracy/sdk/accuracy-result-storage Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,14 @@ import {
88 ModelResponse ,
99} from "./result-storage.js" ;
1010
11+ // Omitting these as they might contain large chunk of texts
12+ const OMITTED_MODEL_RESPONSE_FIELDS : ( keyof ModelResponse ) [ ] = [ "messages" , "text" ] ;
13+
1114export class MongoDBBasedResultStorage implements AccuracyResultStorage {
1215 private client : MongoClient ;
1316 private resultCollection : Collection < AccuracyResult > ;
1417
15- constructor (
16- connectionString : string ,
17- database : string ,
18- collection : string ,
19- // Omitting these as they might contain large chunk of texts
20- private readonly omittedModelResponseFields : ( keyof ModelResponse ) [ ] = [ "messages" , "text" ]
21- ) {
18+ constructor ( connectionString : string , database : string , collection : string ) {
2219 this . client = new MongoClient ( connectionString ) ;
2320 this . resultCollection = this . client . db ( database ) . collection < AccuracyResult > ( collection ) ;
2421 }
@@ -63,7 +60,7 @@ export class MongoDBBasedResultStorage implements AccuracyResultStorage {
6360 modelResponse : ModelResponse ;
6461 } ) : Promise < void > {
6562 const savedModelResponse : ModelResponse = { ...modelResponse } ;
66- for ( const field of this . omittedModelResponseFields ) {
63+ for ( const field of OMITTED_MODEL_RESPONSE_FIELDS ) {
6764 delete savedModelResponse [ field ] ;
6865 }
6966
You can’t perform that action at this time.
0 commit comments