Open
Conversation
上传文件接口中增加对callback_url、job_id、callback_secret参数 修改UploadResponse模型,增加job_id、file_id、status字段 改进上传文件的处理流程,支持回调通知机制
- 在upload_file函数中增加对callback_url、job_id、callback_secret参数支持 - 改进后台索引处理,支持回调通知机制 - 增加HTTP客户端(httpx)用于发送回调请求 - 实现回调通知功能_send_callback
yxuanzh
reviewed
Oct 31, 2025
| logger.error(f"Background indexing failed for file_id: {doc_id}, error: {error_message}") | ||
| callback_payload = { | ||
| "file_id": doc_id, | ||
| "rag_file_id": doc_id, |
Contributor
There was a problem hiding this comment.
what's the difference b/t file_id and rag_file_id?
yxuanzh
reviewed
Oct 31, 2025
| finally: | ||
| logger.debug(f"Background indexing semaphore released for file_id: {doc_id}") | ||
| if callback_url and callback_payload is not None: | ||
| payload_with_job = dict(callback_payload) |
Contributor
There was a problem hiding this comment.
What's the purpose of this line? To create a hard copy? if so why not directly use copy()
yxuanzh
reviewed
Oct 31, 2025
| callback_secret=callback_secret, | ||
| ) | ||
|
|
||
| async def _send_callback( |
Contributor
There was a problem hiding this comment.
- if the user is under a NAT, how to make sure this callback_url is available from the server?
- For this function my feeling is, its invasion is a little bit strong. My idea is to shield application layer from access layer kind of stuff, for example: http related thing. Instead of setting the function here, is it better to move it to api layer?
c34499c to
a9d1b9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
上传文件接口中增加对callback_url、job_id、callback_secret参数
修改UploadResponse模型,增加job_id、file_id、status字段
改进上传文件的处理流程,支持回调通知机制