Skip to content

Conversation

@RobRoyce
Copy link
Member

  • Add PDFjs for reading PDF files (local and remote).

  • chore: upgrade various dependency minor versions.

  • feat(Chat): add chat button to source action bar and context menus.

  • feat(Chat): add model selector in chat toolbar for quickly changing models without opening the settings menu.

  • chore: bump dependencies

  • feat(Chat): provide a list of local file types that can be read for chat purposes (PDF and plain text file types).

  • feat(Chat): Implement online PDF and local file processing for use in Chat. Dramatically improved the ability to summarize, especially larger documents.

  • fix: a bug where theme settings were not saved to file correctly.

  • bump version to 0.8.5

* Add pdfjs for reading PDF files.

* Upgrade various dependeny minor versions.

* Add chat button to source action bar.

* Add chat model selector in chat toolbar.

* chore: bump dependencies

* feat(Chat): provide a list of local file types that can be read for chat purposes (PDF and plain text file types).

* feat(Chat): Implement online PDF and local file processing for use in Chat. Dramatically improved the ability to summarize, especially larger documents.

* chore: Remove unused functions but keep stubs for later use.

* fix: a bug where theme settings were not saved to file correctly.
@RobRoyce
Copy link
Member Author

Addresses #115

console.log("PDF detected, attempting to extract text from PDF...");

// Use http to get the PDF, then use pdfjs to extract the text
const response = await axios.get(reqUrl, { responseType: "arraybuffer" });

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on a [user-provided value](2).

return text;
} else {
const response = await axios.get(reqUrl);

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on a [user-provided value](2).
);
router.delete(
"/key",
this.apiKeyController.deleteApiKey.bind(this.apiKeyController)

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [a file system access](1), but is not rate-limited. This route handler performs [a file system access](2), but is not rate-limited.

getRouter() {
// Load the source from the database
router.use(SourceLoader.load);

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [a file system access](1), but is not rate-limited. This route handler performs [a file system access](2), but is not rate-limited.
router.use(this.summarizer.summarize());

// Store the source in the database
router.use(SourceLoader.store);

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [a file system access](1), but is not rate-limited.
);

// Check for the Source in local JSON files. Append to req.body if found.
if (fs.existsSync(filepath)) {

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).

// Check for the Source in local JSON files. Append to req.body if found.
if (fs.existsSync(filepath)) {
const json = fs.readFileSync(filepath, "utf8");

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).

// Store the Source into local JSON file using ID as filename.
const json = JSON.stringify([text, summary]);
fs.writeFileSync(filepath, json, "utf8");

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
];

// Read the file and check if it is a plain text file
const dataBuffer = fs.readFileSync(filePath);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
}

static async fromPdf(filePath: string) {
const dataBuffer = fs.readFileSync(filePath);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
Copy link
Member Author

@RobRoyce RobRoyce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@RobRoyce RobRoyce merged commit 63387e8 into main Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants