diff --git a/smart-sources-v1/adapters/pdf.js b/smart-sources-v1/adapters/pdf.js new file mode 100644 index 00000000..3be0926e --- /dev/null +++ b/smart-sources-v1/adapters/pdf.js @@ -0,0 +1,24 @@ +import { SourceAdapter } from "./_adapter.js"; + +export class SmartSourcesPdfAdapter extends SourceAdapter { + async _read() { + return await this.smart_source.fs.read(this.smart_source.data.path, 'base64'); + } + async read() { + if(!this.data.content) { + const base64 = await this._read(); + // PROBLEM: CANNOT USE PDF IN VISION API (2024-09-20) + } + // Return content from data.content + return this.data.content; + + } + + update() { + throw new Error('not available for file type'); + } + + create() { + throw new Error('not available for file type'); + } +} \ No newline at end of file diff --git a/smart-sources/blocks/_block.js b/smart-sources/blocks/_block.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-sources/blocks/markdown.js b/smart-sources/blocks/markdown.js new file mode 100644 index 00000000..0e639ee5 --- /dev/null +++ b/smart-sources/blocks/markdown.js @@ -0,0 +1,4 @@ +export function parse_blocks(source) { + const {blocks, ...rest} = source.smart_chunks.parse(source); + source.collection.create_blocks(source, blocks); +} \ No newline at end of file diff --git a/smart-sources/groups/_group.js b/smart-sources/groups/_group.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-sources/groups/cluster.js b/smart-sources/groups/cluster.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-sources/groups/directory.js b/smart-sources/groups/directory.js new file mode 100644 index 00000000..e69de29b