Skip to content

Conversation

@U2SG
Copy link
Collaborator

@U2SG U2SG commented Oct 30, 2025

上传文件接口中增加对callback_url、job_id、callback_secret参数
修改UploadResponse模型,增加job_id、file_id、status字段
改进上传文件的处理流程,支持回调通知机制

上传文件接口中增加对callback_url、job_id、callback_secret参数
修改UploadResponse模型,增加job_id、file_id、status字段
改进上传文件的处理流程,支持回调通知机制
@Mi221e Mi221e requested a review from yxuanzh October 30, 2025 09:38
- 在upload_file函数中增加对callback_url、job_id、callback_secret参数支持
  - 改进后台索引处理,支持回调通知机制
  - 增加HTTP客户端(httpx)用于发送回调请求
  - 实现回调通知功能_send_callback
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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference b/t file_id and rag_file_id?

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this line? To create a hard copy? if so why not directly use copy()

callback_secret=callback_secret,
)

async def _send_callback(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. if the user is under a NAT, how to make sure this callback_url is available from the server?
  2. 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?

@yxuanzh yxuanzh force-pushed the dev/main branch 2 times, most recently from c34499c to a9d1b9c Compare November 4, 2025 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants