ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

Update agent session API, to support uploading files while create a new session

Open flygithub opened this issue 11 months ago • 1 comments

What problem does this PR solve?

Update the agent session API "POST /api/v1/agents/{agent_id}/sessions", to support uploading files while create a new session: - currently, the API only supports requesting with a json body. If user wants to upload a doc or image when create session, like what is already supported on the web client, we need to update the API. - if upload an image, ragflow will call image2text, and a user_id is needed for the image2text model. So we need to send user_id in the API request. As form-data is needed to upload files, not json body, seems we need to put the user_id in the url as an optional parameter (currently user_id is an optional in json body).

Type of change

  • [ ] Bug Fix (non-breaking change which fixes an issue)
  • [ ] New Feature (non-breaking change which adds functionality)
  • [x] Documentation Update
  • [ ] Refactoring
  • [ ] Performance Improvement
  • [x] Other (please describe):

flygithub avatar Feb 17 '25 09:02 flygithub

Appreciation! It's really an amazing work if you could update the docs as well.

KevinHuSh avatar Feb 17 '25 09:02 KevinHuSh

  • Test Result: 屏幕截图 2025-02-17 220930 robot_dance

flygithub avatar Feb 17 '25 14:02 flygithub