-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Joseph Petro
committed
Sep 20, 2024
1 parent
79e061c
commit e181a43
Showing
6 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function parse_blocks(source) { | ||
const {blocks, ...rest} = source.smart_chunks.parse(source); | ||
source.collection.create_blocks(source, blocks); | ||
} |
Empty file.
Empty file.
Empty file.