Librarian streaming doc download

This commit is contained in:
Cyber MacGeddon 2026-03-09 12:31:17 +00:00
parent b2ef7bbb8c
commit 65d6b39eb8
4 changed files with 48 additions and 33 deletions

View file

@ -174,4 +174,6 @@ class LibraryResponseTranslator(MessageTranslator):
def from_response_with_completion(self, obj: LibrarianResponse) -> Tuple[Dict[str, Any], bool]:
"""Returns (response_dict, is_final)"""
return self.from_pulsar(obj), True
# For streaming responses, check end_of_stream to determine if this is the final message
is_final = getattr(obj, 'end_of_stream', True)
return self.from_pulsar(obj), is_final

View file

@ -212,6 +212,9 @@ class LibrarianResponse:
# list-uploads response
upload_sessions: list[UploadSession] = field(default_factory=list)
# stream-document response - indicates final chunk in stream
end_of_stream: bool = False
# FIXME: Is this right? Using persistence on librarian so that
# message chunking works