Open
0 of 2 issues completedDescription
Broken out as a separate issue from #5719. Per #5719 (comment):
- The best current proposal seems to be adding another type
StreamingDataContent
which does not inherit fromDataContent
but rather inheritsAIContent
directly. The person instantiating this type would need to pass in a suitable factory/callback to the constructor that would return the stream. The person consuming this type would callcontent.TryTakeStream(out var stream)
, which may or may not give them a stream (depending on whether it's capable of supplying more than one reader) and if it does, hands responsibility for disposing that stream instance to the consumer. - I'm unclear on how this interacts with JSON serialization. Is there at least one practical case where this actually avoids buffering a large file in memory? I know it probably doesn't help with receiving any data from JSON-over-HTTP. But maybe it does help when sending JSON-over-HTTP. If there are no cases today where this actually avoids buffering in practice, then we might choose not to prioritize doing this now.
Activity