@@ -12,6 +12,11 @@ import {
12
12
GenerativeOpenAIConfig ,
13
13
GenerativeXAIConfig ,
14
14
ModuleConfig ,
15
+ RerankerCohereConfig ,
16
+ RerankerJinaAIConfig ,
17
+ RerankerNvidiaConfig ,
18
+ RerankerTransformersConfig ,
19
+ RerankerVoyageAIConfig ,
15
20
VectorConfigCreate ,
16
21
} from '../types/index.js' ;
17
22
import { configure } from './index.js' ;
@@ -1220,6 +1225,7 @@ describe('Unit testing of the vectorizer factory class', () => {
1220
1225
1221
1226
it ( 'should create the correct Text2VecMistralConfig type with all values' , ( ) => {
1222
1227
const config = configure . vectorizer . text2VecMistral ( {
1228
+ baseURL : 'base-url' ,
1223
1229
name : 'test' ,
1224
1230
model : 'model' ,
1225
1231
vectorizeCollectionName : true ,
@@ -1233,6 +1239,7 @@ describe('Unit testing of the vectorizer factory class', () => {
1233
1239
vectorizer : {
1234
1240
name : 'text2vec-mistral' ,
1235
1241
config : {
1242
+ baseURL : 'base-url' ,
1236
1243
model : 'model' ,
1237
1244
vectorizeCollectionName : true ,
1238
1245
} ,
@@ -1567,12 +1574,14 @@ describe('Unit testing of the generative factory class', () => {
1567
1574
1568
1575
it ( 'should create the correct GenerativeAnyscaleConfig type with all values' , ( ) => {
1569
1576
const config = configure . generative . anyscale ( {
1577
+ baseURL : 'base-url' ,
1570
1578
model : 'model' ,
1571
1579
temperature : 0.5 ,
1572
1580
} ) ;
1573
1581
expect ( config ) . toEqual < ModuleConfig < 'generative-anyscale' , GenerativeAnyscaleConfig | undefined > > ( {
1574
1582
name : 'generative-anyscale' ,
1575
1583
config : {
1584
+ baseURL : 'base-url' ,
1576
1585
model : 'model' ,
1577
1586
temperature : 0.5 ,
1578
1587
} ,
@@ -1749,13 +1758,15 @@ describe('Unit testing of the generative factory class', () => {
1749
1758
1750
1759
it ( 'should create the correct GenerativeMistralConfig type with all values' , ( ) => {
1751
1760
const config = configure . generative . mistral ( {
1761
+ baseURL : 'base-url' ,
1752
1762
maxTokens : 100 ,
1753
1763
model : 'model' ,
1754
1764
temperature : 0.5 ,
1755
1765
} ) ;
1756
1766
expect ( config ) . toEqual < ModuleConfig < 'generative-mistral' , GenerativeMistralConfig | undefined > > ( {
1757
1767
name : 'generative-mistral' ,
1758
1768
config : {
1769
+ baseURL : 'base-url' ,
1759
1770
maxTokens : 100 ,
1760
1771
model : 'model' ,
1761
1772
temperature : 0.5 ,
@@ -1909,3 +1920,97 @@ describe('Unit testing of the generative factory class', () => {
1909
1920
} ) ;
1910
1921
} ) ;
1911
1922
} ) ;
1923
+
1924
+ describe ( 'Unit testing of the reranker factory class' , ( ) => {
1925
+ it ( 'should create the correct RerankerCohereConfig type using required & default values' , ( ) => {
1926
+ const config = configure . reranker . cohere ( ) ;
1927
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-cohere' , RerankerCohereConfig | undefined > > ( {
1928
+ name : 'reranker-cohere' ,
1929
+ config : undefined ,
1930
+ } ) ;
1931
+ } ) ;
1932
+
1933
+ it ( 'should create the correct RerankerCohereConfig type with all values' , ( ) => {
1934
+ const config = configure . reranker . cohere ( {
1935
+ model : 'model' ,
1936
+ } ) ;
1937
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-cohere' , RerankerCohereConfig | undefined > > ( {
1938
+ name : 'reranker-cohere' ,
1939
+ config : {
1940
+ model : 'model' ,
1941
+ } ,
1942
+ } ) ;
1943
+ } ) ;
1944
+
1945
+ it ( 'should create the correct RerankerJinaAIConfig type using required & default values' , ( ) => {
1946
+ const config = configure . reranker . jinaai ( ) ;
1947
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-jinaai' , RerankerJinaAIConfig | undefined > > ( {
1948
+ name : 'reranker-jinaai' ,
1949
+ config : undefined ,
1950
+ } ) ;
1951
+ } ) ;
1952
+
1953
+ it ( 'should create the correct RerankerJinaAIConfig type with all values' , ( ) => {
1954
+ const config = configure . reranker . jinaai ( {
1955
+ model : 'model' ,
1956
+ } ) ;
1957
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-jinaai' , RerankerJinaAIConfig | undefined > > ( {
1958
+ name : 'reranker-jinaai' ,
1959
+ config : {
1960
+ model : 'model' ,
1961
+ } ,
1962
+ } ) ;
1963
+ } ) ;
1964
+
1965
+ it ( 'should create the correct RerankerNvidiaConfig type with required & default values' , ( ) => {
1966
+ const config = configure . reranker . nvidia ( ) ;
1967
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-nvidia' , RerankerNvidiaConfig | undefined > > ( {
1968
+ name : 'reranker-nvidia' ,
1969
+ config : undefined ,
1970
+ } ) ;
1971
+ } ) ;
1972
+
1973
+ it ( 'should create the correct RerankerNvidiaConfig type with all values' , ( ) => {
1974
+ const config = configure . reranker . nvidia ( {
1975
+ baseURL : 'base-url' ,
1976
+ model : 'model' ,
1977
+ } ) ;
1978
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-nvidia' , RerankerNvidiaConfig | undefined > > ( {
1979
+ name : 'reranker-nvidia' ,
1980
+ config : {
1981
+ baseURL : 'base-url' ,
1982
+ model : 'model' ,
1983
+ } ,
1984
+ } ) ;
1985
+ } ) ;
1986
+
1987
+ it ( 'should create the correct RerankerTransformersConfig type using required & default values' , ( ) => {
1988
+ const config = configure . reranker . transformers ( ) ;
1989
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-transformers' , RerankerTransformersConfig > > ( {
1990
+ name : 'reranker-transformers' ,
1991
+ config : { } ,
1992
+ } ) ;
1993
+ } ) ;
1994
+
1995
+ it ( 'should create the correct RerankerVoyageAIConfig with required & default values' , ( ) => {
1996
+ const config = configure . reranker . voyageAI ( ) ;
1997
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-voyageai' , RerankerVoyageAIConfig | undefined > > ( {
1998
+ name : 'reranker-voyageai' ,
1999
+ config : undefined ,
2000
+ } ) ;
2001
+ } ) ;
2002
+
2003
+ it ( 'should create the correct RerankerVoyageAIConfig type with all values' , ( ) => {
2004
+ const config = configure . reranker . voyageAI ( {
2005
+ baseURL : 'base-url' ,
2006
+ model : 'model' ,
2007
+ } ) ;
2008
+ expect ( config ) . toEqual < ModuleConfig < 'reranker-voyageai' , RerankerVoyageAIConfig | undefined > > ( {
2009
+ name : 'reranker-voyageai' ,
2010
+ config : {
2011
+ baseURL : 'base-url' ,
2012
+ model : 'model' ,
2013
+ } ,
2014
+ } ) ;
2015
+ } ) ;
2016
+ } ) ;
0 commit comments