Skip to content

Streaming Function Filters? #7006

Closed Answered by dmytrostruk
Tyler-R-Kendrick asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Tyler-R-Kendrick , I think your approach is correct, here is an example how to use filters in streaming scenario:

private sealed class StreamingFunctionFilterExample : IFunctionInvocationFilter
{
public async Task OnFunctionInvocationAsync(FunctionInvocationContext context, Func<FunctionInvocationContext, Task> next)
{
await next(context);
// In streaming scenario, async enumerable is available in context result object.
// To override data: get async enumerable from function result, override data and set new async enumerable in con…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by sophialagerkranspandey
Comment options

You must be logged in to vote
3 replies
@dmytrostruk
Comment options

@Tyler-R-Kendrick
Comment options

@dmytrostruk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants