File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,17 @@ type VoyageModels = z.infer<typeof zVoyageModels>;
4949class VoyageEmbeddingsProvider implements EmbeddingsProvider < VoyageModels > {
5050 private readonly voyage : VoyageProvider ;
5151
52- constructor ( userConfig : UserConfig , providedFetch ?: typeof fetch ) {
53- assert ( userConfig . voyageApiKey , "voyageApiKey does not exist. This is likely a bug." ) ;
52+ constructor ( { voyageApiKey } : UserConfig , providedFetch ?: typeof fetch ) {
53+ assert ( voyageApiKey , "voyageApiKey does not exist. This is likely a bug." ) ;
5454
5555 const customFetch : typeof fetch = ( providedFetch ??
5656 createFetch ( { useEnvironmentVariableProxies : true } ) ) as unknown as typeof fetch ;
5757
58- this . voyage = createVoyage ( { apiKey : userConfig . voyageApiKey , fetch : customFetch } ) ;
58+ this . voyage = createVoyage ( { apiKey : voyageApiKey , fetch : customFetch } ) ;
5959 }
6060
61- static isConfiguredIn ( userConfig : UserConfig ) : boolean {
62- return ! ! userConfig . voyageApiKey ;
61+ static isConfiguredIn ( { voyageApiKey } : UserConfig ) : boolean {
62+ return ! ! voyageApiKey ;
6363 }
6464
6565 async embed < Model extends VoyageModels > (
You can’t perform that action at this time.
0 commit comments