Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

flygithub
Copy link
Contributor

@flygithub flygithub commented Feb 17, 2025

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

  • Documentation Update
  • Other (please describe):

@KevinHuSh KevinHuSh added the ci Continue Integration label Feb 17, 2025
@KevinHuSh
Copy link
Collaborator

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

@flygithub
Copy link
Contributor Author

flygithub commented Feb 17, 2025

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

@KevinHuSh KevinHuSh merged commit 409310a into infiniflow:main Feb 18, 2025
2 checks passed
@flygithub flygithub deleted the update_session_api_for_upload_file branch February 19, 2025 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continue Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants