utilitas 2000.3.54 → 2000.3.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/manifest.mjs +1 -1
- package/lib/rag.mjs +4 -4
- package/package.json +1 -1
package/lib/manifest.mjs
CHANGED
package/lib/rag.mjs
CHANGED
|
@@ -98,8 +98,8 @@ const ensureApiKey = (options) => {
|
|
|
98
98
|
return options.apiKey;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
const
|
|
102
|
-
assert(options?.
|
|
101
|
+
const ensureCredentials = (options) => {
|
|
102
|
+
assert(options?.credentials, 'Google credentials are required.', 400);
|
|
103
103
|
assert(options?.projectId, 'Google project ID is required.', 400);
|
|
104
104
|
return options;
|
|
105
105
|
};
|
|
@@ -192,7 +192,7 @@ const initReranker = async (options = {}) => {
|
|
|
192
192
|
const model = options?.model || DEFAULT_RERANKER_MODELS[provider];
|
|
193
193
|
switch (provider) {
|
|
194
194
|
case GOOGLE:
|
|
195
|
-
|
|
195
|
+
ensureCredentials(options);
|
|
196
196
|
const { RankServiceClient } = await need(
|
|
197
197
|
'@google-cloud/discoveryengine', { raw: true }
|
|
198
198
|
);
|
|
@@ -200,7 +200,7 @@ const initReranker = async (options = {}) => {
|
|
|
200
200
|
const clientOptions = {
|
|
201
201
|
...location ? { apiEndpoint: `${location}-discoveryengine.googleapis.com` } : {},
|
|
202
202
|
...options?.apiEndpoint ? { apiEndpoint: options.apiEndpoint } : {},
|
|
203
|
-
keyFilename: options.
|
|
203
|
+
keyFilename: options.credentials,
|
|
204
204
|
};
|
|
205
205
|
const client = new RankServiceClient(clientOptions);
|
|
206
206
|
rerankerClients[provider] = {
|