infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
12.5k stars 1.22k forks source link

[Feature Request]: RAGFlow API proposal #1102

Open JinHai-CN opened 1 month ago

JinHai-CN commented 1 month ago

Is there an existing issue for the same feature request?

Describe the feature you'd like

RAGFlow's API interfaces are not enough and theAPI are not RESTful style. The goal of this issue is to propose the RESTFul APIs which covers most functions of RAGFlow.

Knowledge base

Content management in knowledge base

File management

AI assistant management

Model management

Conversation management

Related issues: #345 #717

Scoutink commented 1 month ago

This is exactly what I am looking for...

yangboz commented 1 month ago

Is there an existing issue for the same feature request?

  • [x] I have checked the existing issues.

Describe the feature you'd like

RAGFlow's API interfaces are not enough and theAPI are not RESTful style. The goal of this issue is to propose the RESTFul APIs which covers most functions of RAGFlow.

Knowledge base

  • [x] create knowledge base API: create dataset #1106
  • [ ] remove knowledge base
  • [ ] update knowledge base
  • [ ] list knowledge bases
  • [ ] get the description of a specific knowledge base

Content management in knowledge base

  • [ ] upload files
  • [ ] download files
  • [ ] remove files
  • [ ] update file attributes(name, enable status, ...)
  • [ ] list files
  • [ ] get the description of a specific file
  • [ ] start parsing a file
  • [ ] abort file parsing
  • [ ] get parsing progress
  • [ ] get the chunk list of a parsed file
  • [ ] remove chunks of a parsed file
  • [ ] download/fetch a chunk of a parsed file
  • [ ] update the chunk status
  • [ ] insert a new chunk to a parse file
  • [ ] retrieval test on a specific knowledge base

File management

  • [ ] create a directory
  • [ ] remove directories from a directory
  • [ ] move a directory
  • [ ] copy a directory
  • [ ] get the description of a specific directory
  • [ ] list file or directory from a parent directory
  • [ ] upload files into a specific directory
  • [ ] remove files from a specific directory
  • [ ] download files from a specific directory
  • [ ] move file
  • [ ] copy file
  • [ ] attach files to a knowledge base.
  • [ ] get the description of a specific file

AI assistant management

  • [ ] create an assistant
  • [ ] remove assistants
  • [ ] list assistants
  • [ ] update assistant config
  • [ ] get the description of a specific assitant

Model management

  • [ ] list models
  • [ ] get the description of a specific model

Conversation management

  • [ ] create a conversation
  • [ ] delete conversations
  • [ ] list conversations
  • [ ] chat
  • [ ] get the conversation history.

Related issues: #345 #717

I am wondering with flaskrest,flaskrestplus will helps a lot. or flask_restx

jeremi commented 1 month ago

for me: self.api_url = f"{base_url}/api/{version}" should be: self.api_url = f"{base_url}/{version}/api"

Also even after this change I could not call the create dataset endpoint.

cecilia-uu commented 1 month ago
  • create a knowledge base is it supposed to work? I could not make it work. There seem to be a few issues with the SDK, including configuring the wrong URL path.

for me: self.api_url = f"{base_url}/api/{version}" should be: self.api_url = f"{base_url}/{version}/api"

Also even after this change I could not call the create dataset endpoint.

Hi jeremi, thanks for your question. I would like to inform you that we have introduced a newly proposed API endpoint - http:///api/v1/. The previous URL you mentioned is now deprecated . If you want to create a dataset, you can use http:///api/v1/dataset by POST request.

jeremi commented 1 month ago

I tried it by building the latest main, and it does not work; I get a 404 with some HTML as a returned value.

If I invert API and version number, I get a JSON response, but with a 404 in the body:

200
b'{"data":null,"retcode":100,"retmsg":"<NotFound \'404: Not Found\'>"}\n'
cecilia-uu commented 1 month ago

Could you share your screenshot for the input and output?