gpt4 book ai didi

Does openAI/chatGPT has an API's to Answer Questions from Multiple File uploads? and Does openAI/chatGPT file upload API support docx/pdf files?(OpenAI/chat GPT是否有API来回答来自多个文件上传的问题?OpenAI/chat GPT文件上传API是否支持docx/pdf文件?)

翻译 作者:bug小助手 更新时间:2023-10-26 22:08:47 29 4
gpt4 key购买 nike



Does openAI/chatGPT support docx/pdf file upload too?

OpenAI/chat GPT也支持docx/pdf文件上传吗?


I want to upload multiple files to openAI/chatGPT. I tried it with https://platform.openai.com/docs/api-reference/files/create and I was successfully able to upload in Json lines format, can it support docx/pdf?

我想上传多个文件到openAI/chatGPT。我在https://platform.openai.com/docs/api-reference/files/create上试了一下,我成功地上传了Json lines格式,它能支持docx/pdf吗?


Which openAI/chatGPT API can be used to ask questions on multiple files uploaded to openAI/chatGPT?

哪种OpenAI/chat GPT接口可以用来对上传到OpenAI/chat GPT的多个文件提问?


The files are long and many so I cannot read them and ask questions as suggested in this article
https://plainenglish.io/blog/using-gpt-to-answer-questions-from-multiple-text-files

这些文件又长又多,所以我不能像本文https://plainenglish.io/blog/using-gpt-to-answer-questions-from-multiple-text-files中建议的那样阅读它们并提出问题


Please share some useful API to solve my problem

请分享一些有用的API来解决我的问题


Thank you

谢谢


更多回答
优秀答案推荐

If you explore the library langchain you will discover that it allows reading multiple pdf files, there is an import "from langchain.document_loaders import PyPDFDirectoryLoader" which helps doing it.
It then offers the QA functionality that you require.

如果您浏览这个库langchain,您会发现它允许读取多个pdf文件,有一个导入“from langchain.Document_Loaders导入PyPDFDirectoryLoader”可以帮助您做到这一点。然后,它提供您所需的QA功能。


below is a quick start to start doing it:

下面是一个快速开始这样做:


import os
import sys

from credentials import OPENAI_API_KEY

query = sys.argv[1]

from langchain.indexes.vectorstore import VectorstoreIndexCreator
from langchain.document_loaders import PyPDFDirectoryLoader

os.environ["OPENAI_API_KEY"]=OPENAI_API_KEY


loader = PyPDFDirectoryLoader("pdfs")
print("loader", loader)
index = VectorstoreIndexCreator().from_loaders([loader])

print(index.query(query))

you can run ask questioning it by running:

您可以通过运行以下命令来运行Ask Query:


python model.py "provide the name of certifiations in the resume"

“在简历中提供认证的名称”


更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com