Fix/doc streaming proto (#673)

* Librarian streaming doc download

* Document stream download endpoint
This commit is contained in:
cybermaggedon 2026-03-09 12:36:10 +00:00 committed by GitHub
parent b2ef7bbb8c
commit df1808768d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 128 additions and 33 deletions

View file

@ -504,6 +504,15 @@ class Processor(AsyncProcessor):
try:
# Handle streaming operations specially
if v.operation == "stream-document":
async for resp in self.librarian.stream_document(v):
await self.librarian_response_producer.send(
resp, properties={"id": id}
)
return
# Non-streaming operations
resp = await self.process_request(v)
await self.librarian_response_producer.send(
@ -517,7 +526,8 @@ class Processor(AsyncProcessor):
error = Error(
type = "request-error",
message = str(e),
)
),
end_of_stream = True,
)
await self.librarian_response_producer.send(
@ -530,7 +540,8 @@ class Processor(AsyncProcessor):
error = Error(
type = "unexpected-error",
message = str(e),
)
),
end_of_stream = True,
)
await self.librarian_response_producer.send(