@@ -12,6 +12,11 @@ import {
1212 GenerativeOpenAIConfig ,
1313 GenerativeXAIConfig ,
1414 ModuleConfig ,
15+ RerankerCohereConfig ,
16+ RerankerJinaAIConfig ,
17+ RerankerNvidiaConfig ,
18+ RerankerTransformersConfig ,
19+ RerankerVoyageAIConfig ,
1520 VectorConfigCreate ,
1621} from '../types/index.js' ;
1722import { configure } from './index.js' ;
@@ -1240,6 +1245,7 @@ describe('Unit testing of the vectorizer factory class', () => {
12401245
12411246 it ( 'should create the correct Text2VecMistralConfig type with all values' , ( ) => {
12421247 const config = configure . vectorizer . text2VecMistral ( {
1248+ baseURL : 'base-url' ,
12431249 name : 'test' ,
12441250 model : 'model' ,
12451251 vectorizeCollectionName : true ,
@@ -1253,6 +1259,7 @@ describe('Unit testing of the vectorizer factory class', () => {
12531259 vectorizer : {
12541260 name : 'text2vec-mistral' ,
12551261 config : {
1262+ baseURL : 'base-url' ,
12561263 model : 'model' ,
12571264 vectorizeCollectionName : true ,
12581265 } ,
@@ -1587,12 +1594,14 @@ describe('Unit testing of the generative factory class', () => {
15871594
15881595 it ( 'should create the correct GenerativeAnyscaleConfig type with all values' , ( ) => {
15891596 const config = configure . generative . anyscale ( {
1597+ baseURL : 'base-url' ,
15901598 model : 'model' ,
15911599 temperature : 0.5 ,
15921600 } ) ;
15931601 expect ( config ) . toEqual < ModuleConfig < 'generative-anyscale' , GenerativeAnyscaleConfig | undefined > > ( {
15941602 name : 'generative-anyscale' ,
15951603 config : {
1604+ baseURL : 'base-url' ,
15961605 model : 'model' ,
15971606 temperature : 0.5 ,
15981607 } ,
@@ -1769,13 +1778,15 @@ describe('Unit testing of the generative factory class', () => {
17691778
17701779 it ( 'should create the correct GenerativeMistralConfig type with all values' , ( ) => {
17711780 const config = configure . generative . mistral ( {
1781+ baseURL : 'base-url' ,
17721782 maxTokens : 100 ,
17731783 model : 'model' ,
17741784 temperature : 0.5 ,
17751785 } ) ;
17761786 expect ( config ) . toEqual < ModuleConfig < 'generative-mistral' , GenerativeMistralConfig | undefined > > ( {
17771787 name : 'generative-mistral' ,
17781788 config : {
1789+ baseURL : 'base-url' ,
17791790 maxTokens : 100 ,
17801791 model : 'model' ,
17811792 temperature : 0.5 ,
@@ -1929,3 +1940,97 @@ describe('Unit testing of the generative factory class', () => {
19291940 } ) ;
19301941 } ) ;
19311942} ) ;
1943+
1944+ describe ( 'Unit testing of the reranker factory class' , ( ) => {
1945+ it ( 'should create the correct RerankerCohereConfig type using required & default values' , ( ) => {
1946+ const config = configure . reranker . cohere ( ) ;
1947+ expect ( config ) . toEqual < ModuleConfig < 'reranker-cohere' , RerankerCohereConfig | undefined > > ( {
1948+ name : 'reranker-cohere' ,
1949+ config : undefined ,
1950+ } ) ;
1951+ } ) ;
1952+
1953+ it ( 'should create the correct RerankerCohereConfig type with all values' , ( ) => {
1954+ const config = configure . reranker . cohere ( {
1955+ model : 'model' ,
1956+ } ) ;
1957+ expect ( config ) . toEqual < ModuleConfig < 'reranker-cohere' , RerankerCohereConfig | undefined > > ( {
1958+ name : 'reranker-cohere' ,
1959+ config : {
1960+ model : 'model' ,
1961+ } ,
1962+ } ) ;
1963+ } ) ;
1964+
1965+ it ( 'should create the correct RerankerJinaAIConfig type using required & default values' , ( ) => {
1966+ const config = configure . reranker . jinaai ( ) ;
1967+ expect ( config ) . toEqual < ModuleConfig < 'reranker-jinaai' , RerankerJinaAIConfig | undefined > > ( {
1968+ name : 'reranker-jinaai' ,
1969+ config : undefined ,
1970+ } ) ;
1971+ } ) ;
1972+
1973+ it ( 'should create the correct RerankerJinaAIConfig type with all values' , ( ) => {
1974+ const config = configure . reranker . jinaai ( {
1975+ model : 'model' ,
1976+ } ) ;
1977+ expect ( config ) . toEqual < ModuleConfig < 'reranker-jinaai' , RerankerJinaAIConfig | undefined > > ( {
1978+ name : 'reranker-jinaai' ,
1979+ config : {
1980+ model : 'model' ,
1981+ } ,
1982+ } ) ;
1983+ } ) ;
1984+
1985+ it ( 'should create the correct RerankerNvidiaConfig type with required & default values' , ( ) => {
1986+ const config = configure . reranker . nvidia ( ) ;
1987+ expect ( config ) . toEqual < ModuleConfig < 'reranker-nvidia' , RerankerNvidiaConfig | undefined > > ( {
1988+ name : 'reranker-nvidia' ,
1989+ config : undefined ,
1990+ } ) ;
1991+ } ) ;
1992+
1993+ it ( 'should create the correct RerankerNvidiaConfig type with all values' , ( ) => {
1994+ const config = configure . reranker . nvidia ( {
1995+ baseURL : 'base-url' ,
1996+ model : 'model' ,
1997+ } ) ;
1998+ expect ( config ) . toEqual < ModuleConfig < 'reranker-nvidia' , RerankerNvidiaConfig | undefined > > ( {
1999+ name : 'reranker-nvidia' ,
2000+ config : {
2001+ baseURL : 'base-url' ,
2002+ model : 'model' ,
2003+ } ,
2004+ } ) ;
2005+ } ) ;
2006+
2007+ it ( 'should create the correct RerankerTransformersConfig type using required & default values' , ( ) => {
2008+ const config = configure . reranker . transformers ( ) ;
2009+ expect ( config ) . toEqual < ModuleConfig < 'reranker-transformers' , RerankerTransformersConfig > > ( {
2010+ name : 'reranker-transformers' ,
2011+ config : { } ,
2012+ } ) ;
2013+ } ) ;
2014+
2015+ it ( 'should create the correct RerankerVoyageAIConfig with required & default values' , ( ) => {
2016+ const config = configure . reranker . voyageAI ( ) ;
2017+ expect ( config ) . toEqual < ModuleConfig < 'reranker-voyageai' , RerankerVoyageAIConfig | undefined > > ( {
2018+ name : 'reranker-voyageai' ,
2019+ config : undefined ,
2020+ } ) ;
2021+ } ) ;
2022+
2023+ it ( 'should create the correct RerankerVoyageAIConfig type with all values' , ( ) => {
2024+ const config = configure . reranker . voyageAI ( {
2025+ baseURL : 'base-url' ,
2026+ model : 'model' ,
2027+ } ) ;
2028+ expect ( config ) . toEqual < ModuleConfig < 'reranker-voyageai' , RerankerVoyageAIConfig | undefined > > ( {
2029+ name : 'reranker-voyageai' ,
2030+ config : {
2031+ baseURL : 'base-url' ,
2032+ model : 'model' ,
2033+ } ,
2034+ } ) ;
2035+ } ) ;
2036+ } ) ;
0 commit comments