OpenInterpreter / open-interpreter

A natural language interface for computers
http://openinterpreter.com/
GNU Affero General Public License v3.0
54.99k stars 4.79k forks source link

Is this service has ability to read directly PDF, or what is to be installed enabled, if any to read them? #1373

Open lion137 opened 3 months ago

lion137 commented 3 months ago

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

We need to have an ability to feed the endpoints with the pdf files

Describe alternatives you've considered

No response

Additional context

No response

MikeBirdTech commented 3 months ago

What did you try and what issue did you encounter?

lion137 commented 3 months ago

Tried to upload a pdf file and got a response:

It seems there are issues with installing the necessary packages for text extraction. Unfortunately, I am unable to extract the text from the PDF file at the moment. If you have the text content available in another format or if there is any other way I can assist you, please let me know.

MikeBirdTech commented 3 months ago

This is not an issue with Open Interpreter as it states there are issues with installing the necessary packages for text extraction. Please look into your system permissions then try again. Also, sharing information like what model/prompt you are using will help with resolution

lion137 commented 3 months ago

This is web app in docker to which slack app is talking to via http, we're using it in company for uploading files to chat, there is another app to chat with openai GPT's. Container has all permissions on the server, or at least I don't know about permissions issues. The engine used is: gpt-4 and this is our requirements.txt file: image

And this is code which calls a lib:

import os

from loguru import logger
from slack_bolt import App

from files_analyzer.engine import FilesAnalyzer

# app = App(token=..., signing_secret=...))
app = App()

def get_bot_response(event: dict) -> str:
    files_analyzer = FilesAnalyzer()
    if (files := event.get("files")) is None:
        files = []
    return files_analyzer.processor(event=event, files=files)

@app.event("app_mention")
def event_mention(event: dict, say) -> None:
    logger.info(f"Event triggered from channel: {event['channel']}")
    bot_response: str = get_bot_response(event=event)
    say(bot_response, thread_ts=event["ts"])

@app.event("message")
def event_message(event: dict, say) -> None:
    logger.info(f"Event triggered by user: {event['user']}")
    bot_response: str = get_bot_response(event=event)
    say(bot_response)