add xml doc

This commit is contained in:
xbotter 2023-11-13 23:12:24 +08:00
parent 0dbecdf209
commit dce814697d
No known key found for this signature in database
GPG key ID: D299220A7FE5CF1E
2 changed files with 21 additions and 5 deletions

View file

@ -13,6 +13,9 @@ using System.Threading.Tasks;
namespace BotSharp.Plugin.SemanticKernel
{
/// <summary>
/// Use Semantic Kernel as chat completion provider
/// </summary>
public class SemanticKernelChatCompletionProvider : IChatCompletion
{
private IKernel _kernel;
@ -20,8 +23,15 @@ namespace BotSharp.Plugin.SemanticKernel
private ITokenStatistics _tokenStatistics;
private string? _model = null;
/// <inheritdoc/>
public string Provider => "semantic-kernel";
/// <summary>
/// Create a new instance of <see cref="SemanticKernelChatCompletionProvider"/>
/// </summary>
/// <param name="kernel"></param>
/// <param name="services"></param>
/// <param name="tokenStatistics"></param>
public SemanticKernelChatCompletionProvider(IKernel kernel,
IServiceProvider services,
ITokenStatistics tokenStatistics)
@ -30,7 +40,7 @@ namespace BotSharp.Plugin.SemanticKernel
this._services = services;
this._tokenStatistics = tokenStatistics;
}
/// <inheritdoc/>
public RoleDialogModel GetChatCompletions(Agent agent, List<RoleDialogModel> conversations)
{
var hooks = _services.GetServices<IContentGeneratingHook>().ToList();
@ -81,18 +91,18 @@ namespace BotSharp.Plugin.SemanticKernel
return msg;
}
/// <inheritdoc/>
public Task<bool> GetChatCompletionsAsync(Agent agent, List<RoleDialogModel> conversations, Func<RoleDialogModel, Task> onMessageReceived, Func<RoleDialogModel, Task> onFunctionExecuting)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public Task<bool> GetChatCompletionsStreamingAsync(Agent agent, List<RoleDialogModel> conversations, Func<RoleDialogModel, Task> onMessageReceived)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public void SetModelName(string model)
{
if (!string.IsNullOrWhiteSpace(model))

View file

@ -24,9 +24,15 @@ namespace BotSharp.Plugin.SemanticKernel
private readonly ITokenStatistics _tokenStatistics;
private string? _model = null;
// <inheritdoc/>
/// <inheritdoc/>
public string Provider => "semantic-kernel";
/// <summary>
/// Create a new instance of <see cref="SemanticKernelTextCompletionProvider"/>
/// </summary>
/// <param name="kernel"></param>
/// <param name="services"></param>
/// <param name="tokenStatistics"></param>
public SemanticKernelTextCompletionProvider(IKernel kernel,
IServiceProvider services,
ITokenStatistics tokenStatistics)