I have the following model:
from pydantic import BaseModel
from collections.abc import AsyncIterable
class Message(BaseModel):
content_iterable: AsyncIterable[str]
content: str | None = None
content_iterable is an iterator that needs to be consumed by a client.
I would like content to be set as the full result of content_iterable once it has been consumed.
A client to my API will be consuming content_iterable, so I cannot simply consume it in my app and then set the result to content.
Is this possible?