-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4b1858
commit 965e0ef
Showing
3 changed files
with
85 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package streaming | ||
|
||
import ( | ||
"context" | ||
"io" | ||
) | ||
|
||
// File represents a file output from a model over an SSE stream. On the wire, | ||
// it might be a data URL or a regular http URL. File abstracts over this and | ||
// provides a way to get the data regardless of the implementation. | ||
type File interface { | ||
// Body fetches the content of the file. If there are any errors, the | ||
// io.ReadCloser will be nil. It is the caller's responsibility to close | ||
// the io.ReadCloser. | ||
Body(ctx context.Context) (io.ReadCloser, error) | ||
} |