Skip to content

Revisit DataContent and friends #5719

Open
@stephentoub

Description

A few issues to sort out:

  • Derived types. We currently have DataContent (base type), ImageContent (derives from DataContent), and AudioContent (derives from DataContent). It's not clear what significant value ImageContent / AudioContent add: they're just constructors and enable applying more strong-typing based on media type. But presumably chat client implementations should also handle cases where DataContent is used rather than the derived type (we're not currently), and once you're handling both, what's the benefit of having the derived types.

  • Videos. We currently lack a VideoContent. If we're going to have ImageContent and AudioContent, we should also have VideoContent.

  • Non-in-memory data. We currently don't have any Stream-based support; everything needs to be loaded into memory. We should look at either adding a StreamingDataContent or augmenting DataContent with support for Stream. As these can be stored in chat message lists, we'll need to work through that. Should it require any Stream to be seekable? What should happen with JSON serialization employed as part of logging / caching / etc.?

  • Realtime. Do these content types work fine for representing partial data as might be sent or received as part of a streaming request / response?

cc: @SteveSandersonMS, @RogerBarreto, @eiriktsarpalis

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions