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

feat: support download uploaded documents #532

Merged
merged 7 commits into from
Dec 30, 2024
Merged

Conversation

Rutheniumlmw
Copy link
Collaborator

@Rutheniumlmw Rutheniumlmw commented Dec 23, 2024

part of #466

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tidb-ai-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 9:12am
tidb-ai-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 9:12am

Copy link

vercel bot commented Dec 23, 2024

@Rutheniumlmw is attempting to deploy a commit to the pingcap Team on Vercel.

A member of the Team first needs to authorize it.

backend/app/api/routes/download.py Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
backend/app/api/main.py Outdated Show resolved Hide resolved
backend/app/api/routes/download.py Outdated Show resolved Hide resolved
headers = {"Content-Length": str(file_size)}
def iterfile():
with filestorage.open(name) as f:
while chunk := f.read(8192): # 每次读取 8KB
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please refer to FastAPI Document. It's not necessary to manually call f.read().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@634750802 634750802 changed the title fix:The link of upload files is broken in the chat view #466 feat: support download uploaded documents Dec 24, 2024
Copy link
Collaborator

@634750802 634750802 left a comment

Choose a reason for hiding this comment

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

nice work

@Mini256 Mini256 merged commit aaf81b9 into pingcap:main Dec 30, 2024
8 checks passed
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