fix(all): Libraries update.

This commit is contained in:
Rodrigo Rodriguez 2024-05-27 17:21:56 -03:00
parent 1173233971
commit cebb6b4e1f
4 changed files with 5 additions and 8 deletions

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8 KiB

View file

@ -209,7 +209,7 @@
"typescript": "5.4.5", "typescript": "5.4.5",
"url-join": "5.0.0", "url-join": "5.0.0",
"vhost": "3.0.2", "vhost": "3.0.2",
"vm2": "3.9.11", "vm2": "3.9.19",
"vm2-process": "2.1.5", "vm2-process": "2.1.5",
"walk-promise": "0.2.0", "walk-promise": "0.2.0",
"washyourmouthoutwithsoap": "1.0.2", "washyourmouthoutwithsoap": "1.0.2",

View file

@ -337,14 +337,14 @@ export class GBDeployer implements IGBDeployer {
azureOpenAIApiVersion: azureOpenAIVersion, azureOpenAIApiVersion: azureOpenAIVersion,
azureOpenAIApiInstanceName: azureOpenAIApiInstanceName azureOpenAIApiInstanceName: azureOpenAIApiInstanceName
}); });
try { try {
vectorStore = await HNSWLib.load(min['vectorStorePath'], embedding); vectorStore = await HNSWLib.load(min['vectorStorePath'], embedding);
} catch { } catch {
vectorStore = new HNSWLib(embedding, { vectorStore = new HNSWLib(embedding, {
space: 'cosine', space: 'cosine'
numDimensions: 1536
}); });
} }
return vectorStore; return vectorStore;
} }

View file

@ -917,7 +917,6 @@ export class KBService implements IGBKBService {
({ currentDomain, websiteIgnoreUrls }) => { ({ currentDomain, websiteIgnoreUrls }) => {
const anchors = Array.from(document.querySelectorAll('a')).filter(p => { const anchors = Array.from(document.querySelectorAll('a')).filter(p => {
try { try {
return currentDomain == new URL(p.href).hostname.toLocaleLowerCase(); return currentDomain == new URL(p.href).hostname.toLocaleLowerCase();
} catch (err) { } catch (err) {
return false; return false;
@ -1024,12 +1023,10 @@ export class KBService implements IGBKBService {
const websiteIgnoreUrls = min.core.getParam<string>(min.instance, 'Website Ignore URLs', null); const websiteIgnoreUrls = min.core.getParam<string>(min.instance, 'Website Ignore URLs', null);
if (website) { if (website) {
// Removes last slash if any. // Removes last slash if any.
website =website.replace(/\/(?=[^\/]*$)/, ""); website = website.replace(/\/(?=[^\/]*$)/, '');
Fs.rmSync(min['vectorStorePath'], { recursive: true, force: true });
let path = DialogKeywords.getGBAIPath(min.botId, `gbot`); let path = DialogKeywords.getGBAIPath(min.botId, `gbot`);
const directoryPath = Path.join(process.env.PWD, 'work', path, 'Website'); const directoryPath = Path.join(process.env.PWD, 'work', path, 'Website');
Fs.rmSync(directoryPath, { recursive: true, force: true }); Fs.rmSync(directoryPath, { recursive: true, force: true });