forked from bterlson/openai-in-typespec
-
Notifications
You must be signed in to change notification settings - Fork 14
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
4c355d5
commit 4f9e832
Showing
5 changed files
with
73 additions
and
137 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
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,28 @@ | ||
using System.ClientModel; | ||
using System.ClientModel.Primitives; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
|
||
namespace OpenAI; | ||
|
||
#pragma warning disable CS1591 // public XML comments | ||
|
||
/// <summary> | ||
/// Represents an operation response with streaming content that can be deserialized and enumerated while the response | ||
/// is still being received. | ||
/// </summary> | ||
/// <typeparam name="T"> The data type representative of distinct, streamable items. </typeparam> | ||
// TODO: Revisit the IDisposable question | ||
public abstract class StreamingClientResult<T> : ClientResult, IAsyncEnumerable<T> | ||
{ | ||
protected StreamingClientResult(PipelineResponse response) : base(response) | ||
{ | ||
} | ||
|
||
// Note that if the implementation disposes the stream, the caller can only | ||
// enumerate the results once. I think this makes sense, but we should | ||
// make sure architects agree. | ||
public abstract IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default); | ||
} | ||
|
||
#pragma warning restore CS1591 // public XML comments |
This file was deleted.
Oops, something went wrong.