new(core.gbapp): New API endpoint.

This commit is contained in:
Rodrigo Rodriguez 2024-04-17 15:36:08 -03:00
parent df41f1c55b
commit 43feb52788

View file

@ -144,7 +144,7 @@ export class GBLLMOutputParser extends
if (source) {
const gbaiName = DialogKeywords.getGBAIPath(this.min.botId, 'gbkb');
const localName = Path.join(process.env.PWD,'work', gbaiName, 'docs', source.file);
const localName = Path.join(process.env.PWD, 'work', gbaiName, 'docs', source.file);
if (localName) {
const { url } = await ChatServices.pdfPageAsImage(this.min, localName, source.page);
@ -214,7 +214,7 @@ export class ChatServices {
let output = '';
for(const filePaths of Object.keys(uniqueDocuments)) {
for (const filePaths of Object.keys(uniqueDocuments)) {
const doc = uniqueDocuments[filePaths];
const metadata = doc.metadata;
const filename = Path.basename(metadata.source);
@ -492,12 +492,14 @@ export class ChatServices {
});
if (process.env.WIKIPEDIA_TOOL) {
const tool = new WikipediaQueryRun({
topKResults: 3,
maxDocContentLength: 4000,
});
functions.push(tool);
}
return functions;
}
}