在 Semantic Kernel 中有2个接口,分别是 ITextGenerationService
与 IChatCompletionService
,请问它们的区别是什么?
ITextGenerationService 与 IChatCompletionService 都继承了 IAIService 接口,
ITextGenerationService 接口中的方法:
IChatCompletionService 接口中的方法:
OpenAIChatCompletionService 同时实现了这2个接口
public sealed class OpenAIChatCompletionService : IChatCompletionService, ITextGenerationService
{
}
关于 text generation 的解释:
Text generation is a technique that involves the creation of human-like text using artificial intelligence and machine learning algorithms. It enables computers to generate coherent and contextually relevant text based on patterns and structures learned from existing textual data.
来自 https://h2o.ai/wiki/text-generation/
关于 chat completion 的解释:
A chat completion is a way of generating text based on a prompt. The prompt is a piece of text that you provide, and the completion is the text that is generated by the model. The model is a machine learning model that has been trained on a large corpus of text, and the prompt is used to seed the model to generate the completion.
Microsoft.SemanticKernel.Connectors.HuggingFace 只实现了 ITextGenerationService 接口