Class MiddlewareStreamingAgent
public class MiddlewareStreamingAgent : IMiddlewareStreamAgent, IStreamingAgent, IAgent, IAgentMetaInformation
- Inheritance
-
MiddlewareStreamingAgent
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
MiddlewareStreamingAgent(IStreamingAgent, string?, IEnumerable<IStreamingMiddleware>?)
public MiddlewareStreamingAgent(IStreamingAgent agent, string? name = null, IEnumerable<IStreamingMiddleware>? streamingMiddlewares = null)
Parameters
agent
IStreamingAgentname
stringstreamingMiddlewares
IEnumerable<IStreamingMiddleware>
Properties
Name
public string Name { get; }
Property Value
StreamingAgent
Get the inner agent.
public IStreamingAgent StreamingAgent { get; }
Property Value
StreamingMiddlewares
Get the streaming middlewares.
public IEnumerable<IStreamingMiddleware> StreamingMiddlewares { get; }
Property Value
Methods
GenerateReplyAsync(IEnumerable<IMessage>, GenerateReplyOptions?, CancellationToken)
Generate reply
public Task<IMessage> GenerateReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? options = null, CancellationToken cancellationToken = default)
Parameters
messages
IEnumerable<IMessage>conversation history
options
GenerateReplyOptionscompletion option. If provided, it should override existing option if there's any
cancellationToken
CancellationToken
Returns
GenerateStreamingReplyAsync(IEnumerable<IMessage>, GenerateReplyOptions?, CancellationToken)
public IAsyncEnumerable<IMessage> GenerateStreamingReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? options = null, CancellationToken cancellationToken = default)
Parameters
messages
IEnumerable<IMessage>options
GenerateReplyOptionscancellationToken
CancellationToken
Returns
UseStreaming(IStreamingMiddleware)
public void UseStreaming(IStreamingMiddleware middleware)
Parameters
middleware
IStreamingMiddleware