Fix/librarian broken (#674)

* Set end-of-stream cleanly - clean streaming message structures

* Add tg-get-document-content
This commit is contained in:
cybermaggedon 2026-03-09 13:36:24 +00:00 committed by GitHub
parent df1808768d
commit 3c3e11bef5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 99 additions and 15 deletions

View file

@ -174,6 +174,4 @@ class LibraryResponseTranslator(MessageTranslator):
def from_response_with_completion(self, obj: LibrarianResponse) -> Tuple[Dict[str, Any], bool]:
"""Returns (response_dict, is_final)"""
# 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
return self.from_pulsar(obj), obj.is_final

View file

@ -212,8 +212,10 @@ 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
# Protocol flag: True if this is the final response for a request.
# Default True since most operations are single request/response.
# Only stream-document sets False for intermediate chunks.
is_final: bool = True
# FIXME: Is this right? Using persistence on librarian so that
# message chunking works