Partilhar via


StreamingResponse<T>.CreateFromResponse Method

Definition

Creates a new instance of StreamingResponse<T> using the provided underlying HTTP response. The provided function will be used to resolve the response into an asynchronous enumeration of streamed response items.

public static Azure.AI.Inference.StreamingResponse<T> CreateFromResponse (Azure.Response response, Func<Azure.Response,System.Collections.Generic.IAsyncEnumerable<T>> asyncEnumerableProcessor);
static member CreateFromResponse : Azure.Response * Func<Azure.Response, System.Collections.Generic.IAsyncEnumerable<'T>> -> Azure.AI.Inference.StreamingResponse<'T>
Public Shared Function CreateFromResponse (response As Response, asyncEnumerableProcessor As Func(Of Response, IAsyncEnumerable(Of T))) As StreamingResponse(Of T)

Parameters

response
Response

The HTTP response.

asyncEnumerableProcessor
Func<Response,IAsyncEnumerable<T>>

The function that will resolve the provided response into an IAsyncEnumerable.

Returns

A new instance of StreamingResponse<T> that will be capable of asynchronous enumeration of T items from the HTTP response.

Applies to