mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Check if PDF files are present in the Obsidian vault before initializing the Khoj configuration (#293)
This commit is contained in:
parent
7364bac8ae
commit
07cf5a214a
1 changed files with 7 additions and 2 deletions
|
@ -51,8 +51,13 @@ export async function configureKhojBackend(vault: Vault, setting: KhojSetting, n
|
|||
"input-files": null,
|
||||
"embeddings-file": `${khojDefaultMdIndexDirectory}/${indexName}.pt`,
|
||||
"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-files": null,
|
||||
"embeddings-file": `${khojDefaultPdfIndexDirectory}/${indexName}.pt`,
|
||||
|
|
Loading…
Reference in a new issue