mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
Check if PDF files are present in the Obsidian vault before initializing the Khoj configuration (#293)
This commit is contained in:
@@ -51,8 +51,13 @@ export async function configureKhojBackend(vault: Vault, setting: KhojSetting, n
|
|||||||
"input-files": null,
|
"input-files": null,
|
||||||
"embeddings-file": `${khojDefaultMdIndexDirectory}/${indexName}.pt`,
|
"embeddings-file": `${khojDefaultMdIndexDirectory}/${indexName}.pt`,
|
||||||
"compressed-jsonl": `${khojDefaultMdIndexDirectory}/${indexName}.jsonl.gz`,
|
"compressed-jsonl": `${khojDefaultMdIndexDirectory}/${indexName}.jsonl.gz`,
|
||||||
},
|
}
|
||||||
"pdf": {
|
}
|
||||||
|
|
||||||
|
const hasPdfFiles = app.vault.getFiles().some(file => file.extension === 'pdf');
|
||||||
|
|
||||||
|
if (hasPdfFiles) {
|
||||||
|
data["content-type"]["pdf"] = {
|
||||||
"input-filter": [pdfInVault],
|
"input-filter": [pdfInVault],
|
||||||
"input-files": null,
|
"input-files": null,
|
||||||
"embeddings-file": `${khojDefaultPdfIndexDirectory}/${indexName}.pt`,
|
"embeddings-file": `${khojDefaultPdfIndexDirectory}/${indexName}.pt`,
|
||||||
|
|||||||
Reference in New Issue
Block a user