-
Notifications
You must be signed in to change notification settings - Fork 849
Description
DataContent can only be backed with a ReadOnlyMemory, we should also have type that can be backed with a stream so that we don't have to store large content in memory.
Ideally this type could support a stream without ever loading the entire contents to the stream (eg: as an internal Uri representation, or string representation, or fully buffered)
We should decide if such a representation would require a seeable stream, or if it could be made "one shot" where we wrap a non-seekable stream that would only ever be consumed once - either by copying out to another stream, or converting to some other AIContent like as a DataContent, or maybe a seekable version.
This seems similar to https://learn.microsoft.com/en-us/dotnet/api/system.net.http.streamcontent?view=net-8.0 vs https://learn.microsoft.com/en-us/dotnet/api/system.net.http.bytearraycontent?view=net-8.0