diff --git a/.eslintrc.js b/.eslintrc.js index 5b999efa470b056e329b4c23a73904e0794bdc2f..077771bc0c716fcd35971848830e6245205e6213 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,4 +7,7 @@ module.exports = { rootDir: ["apps/*/"], }, }, + rules: { + "max-params": ["error", 4], + }, }; diff --git a/packages/core/src/PromptHelper.ts b/packages/core/src/PromptHelper.ts index 556b2865280f39e3d1d44df49beb79c4d0da3be8..8b497df9340b9ae73d1b889df012b16382682229 100644 --- a/packages/core/src/PromptHelper.ts +++ b/packages/core/src/PromptHelper.ts @@ -37,6 +37,7 @@ export class PromptHelper { tokenizer: (text: string) => Uint32Array; separator = " "; + // eslint-disable-next-line max-params constructor( contextWindow = DEFAULT_CONTEXT_WINDOW, numOutput = DEFAULT_NUM_OUTPUTS, diff --git a/packages/core/src/embeddings/utils.ts b/packages/core/src/embeddings/utils.ts index 097e9d78c90c54091617413fcace4797abea6b69..1e3821b8714cd220cc8a1ffc1db63b790fca58c7 100644 --- a/packages/core/src/embeddings/utils.ts +++ b/packages/core/src/embeddings/utils.ts @@ -66,6 +66,7 @@ export function similarity( * @param similarityCutoff minimum similarity score * @returns */ +// eslint-disable-next-line max-params export function getTopKEmbeddings( queryEmbedding: number[], embeddings: number[][], @@ -108,6 +109,7 @@ export function getTopKEmbeddings( return [resultSimilarities, resultIds]; } +// eslint-disable-next-line max-params export function getTopKEmbeddingsLearner( queryEmbedding: number[], embeddings: number[][], @@ -120,6 +122,7 @@ export function getTopKEmbeddingsLearner( // https://github.com/mljs/libsvm which itself hasn't been updated in a while } +// eslint-disable-next-line max-params export function getTopKMMREmbeddings( queryEmbedding: number[], embeddings: number[][], diff --git a/packages/core/src/indices/summary/SummaryIndexRetriever.ts b/packages/core/src/indices/summary/SummaryIndexRetriever.ts index aeb703ee2c7ef90de22d2c3d7f422502d3ab0990..173b58d000ce655ab54a8c4f2431fe141605447d 100644 --- a/packages/core/src/indices/summary/SummaryIndexRetriever.ts +++ b/packages/core/src/indices/summary/SummaryIndexRetriever.ts @@ -61,6 +61,7 @@ export class SummaryIndexLLMRetriever implements BaseRetriever { parseChoiceSelectAnswerFn: ChoiceSelectParserFunction; serviceContext: ServiceContext; + // eslint-disable-next-line max-params constructor( index: SummaryIndex, choiceSelectPrompt?: ChoiceSelectPrompt, diff --git a/packages/core/src/readers/SimpleMongoReader.ts b/packages/core/src/readers/SimpleMongoReader.ts index 1c2b0dc76f4c59c7aa6a8ad3749d02e0aa89d5fa..73d6bb7d5a0d8a3c240dede92be0426c6f26541d 100644 --- a/packages/core/src/readers/SimpleMongoReader.ts +++ b/packages/core/src/readers/SimpleMongoReader.ts @@ -36,6 +36,7 @@ export class SimpleMongoReader implements BaseReader { * @returns {Promise<Document[]>} * @throws If a field specified in fieldNames or metadataNames is not found in a MongoDB document. */ + // eslint-disable-next-line max-params public async loadData( dbName: string, collectionName: string, diff --git a/packages/core/src/synthesizers/builders.ts b/packages/core/src/synthesizers/builders.ts index 460ca06e7ee0417df88c8a7f78b1a58e82cc0608..1e8db1ab2d6c32ef6502907c77baa0e9aedc2053 100644 --- a/packages/core/src/synthesizers/builders.ts +++ b/packages/core/src/synthesizers/builders.ts @@ -168,6 +168,7 @@ export class Refine implements ResponseBuilder { return response; } + // eslint-disable-next-line max-params private async refineResponseSingle( initialReponse: string, queryStr: string,