refactor(api): migrate web chat endpoints to BaseModel (#37962)

This commit is contained in:
chariri
2026-07-09 04:23:13 +00:00
committed by GitHub
parent 89d5f74a40
commit 458aa4892d
23 changed files with 770 additions and 568 deletions
+2 -4
View File
@@ -173,7 +173,7 @@ class FileService:
return upload_file
def get_file_preview(self, file_id: str, tenant_id: str):
def get_file_preview(self, file_id: str, tenant_id: str) -> str:
"""
Return a short text preview extracted from a document file.
"""
@@ -191,9 +191,7 @@ class FileService:
raise UnsupportedFileTypeError()
text = ExtractProcessor.load_from_upload_file(upload_file, return_text=True)
text = text[0:PREVIEW_WORDS_LIMIT] if text else ""
return text
return text[0:PREVIEW_WORDS_LIMIT] if text else ""
def get_image_preview(self, file_id: str, timestamp: str, nonce: str, sign: str):
result = file_helpers.verify_image_signature(