Fix PDF/docx parsing

This commit is contained in:
Saoud Rizwan 2024-08-31 02:38:59 -04:00
parent 1d87bcf767
commit 6cbd232039
2 changed files with 3 additions and 2 deletions

View File

@ -172,7 +172,7 @@ const tools: Tool[] = [
{
name: "read_file",
description:
"Read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file, for example to analyze code, review text files, or extract information from configuration files. Be aware that this tool may not be suitable for very large files or binary files, as it returns the raw content as a string.",
"Read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string.",
input_schema: {
type: "object",
properties: {

View File

@ -1,5 +1,6 @@
import * as path from "path"
import pdf from "pdf-parse"
// @ts-ignore-next-line
import pdf from "pdf-parse/lib/pdf-parse"
import mammoth from "mammoth"
import { isBinaryFile } from "isbinaryfile"
import fs from "fs/promises"