IChatClient Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a chat client.
public interface class IChatClient : IDisposable
public interface IChatClient : IDisposable
type IChatClient = interface
interface IDisposable
Public Interface IChatClient
Implements IDisposable
- Derived
- Implements
Remarks
Unless otherwise specified, all members of IChatClient are thread-safe for concurrent use. It is expected that all implementations of IChatClient support being used by multiple requests concurrently.
However, implementations of IChatClient might mutate the arguments supplied to GetResponseAsync(IList<ChatMessage>, ChatOptions, CancellationToken) and GetStreamingResponseAsync(IList<ChatMessage>, ChatOptions, CancellationToken), such as by adding additional messages to the messages list or configuring the options instance. Thus, consumers of the interface either should avoid using shared instances of these arguments for concurrent invocations or should otherwise ensure by construction that no IChatClient instances are used which might employ such mutation. For example, the WithChatOptions method be provided with a callback that could mutate the supplied options argument, and that should be avoided if using a singleton options instance.
Methods
Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable) |
GetResponseAsync(IList<ChatMessage>, ChatOptions, CancellationToken) |
Sends chat messages and returns the response. |
GetService(Type, Object) |
Asks the IChatClient for an object of the specified type |
GetStreamingResponseAsync(IList<ChatMessage>, ChatOptions, CancellationToken) |
Sends chat messages and streams the response. |