Class GeminiMessageConnector
public class GeminiMessageConnector : IStreamingMiddleware, IMiddleware
- Inheritance
-
GeminiMessageConnector
- Implements
- Inherited Members
Constructors
GeminiMessageConnector(bool)
Initializes a new instance of the GeminiMessageConnector class.
public GeminiMessageConnector(bool strictMode = false)
Parameters
strictMode
boolwhether to throw an exception if it encounters an unsupport message type. If true, the connector will throw an exception if it encounters an unsupport message type. If false, it will ignore processing the message and return the message as is.
Properties
Name
the name of the middleware
public string Name { get; }
Property Value
Methods
InvokeAsync(MiddlewareContext, IAgent, CancellationToken)
The method to invoke the middleware
public Task<IMessage> InvokeAsync(MiddlewareContext context, IAgent agent, CancellationToken cancellationToken = default)
Parameters
context
MiddlewareContextagent
IAgentcancellationToken
CancellationToken
Returns
InvokeAsync(MiddlewareContext, IStreamingAgent, CancellationToken)
The streaming version of InvokeAsync(MiddlewareContext, IAgent, CancellationToken).
public IAsyncEnumerable<IMessage> InvokeAsync(MiddlewareContext context, IStreamingAgent agent, CancellationToken cancellationToken = default)
Parameters
context
MiddlewareContextagent
IStreamingAgentcancellationToken
CancellationToken