diff --git a/LLama.Examples/NewVersion/SemanticKernelChat.cs b/LLama.Examples/NewVersion/SemanticKernelChat.cs index 6d9b4396..9bdbcfec 100644 --- a/LLama.Examples/NewVersion/SemanticKernelChat.cs +++ b/LLama.Examples/NewVersion/SemanticKernelChat.cs @@ -27,9 +27,6 @@ namespace LLama.Examples.NewVersion using var model = LLamaWeights.LoadFromFile(parameters); using var context = model.CreateContext(parameters); var ex = new InteractiveExecutor(context); - //var builder = new KernelBuilder(); - //builder.WithAIService("local-llama", new LLamaSharpChatCompletion(ex), true); - //var kernel = builder.Build(); var chatGPT = new LLamaSharpChatCompletion(ex); diff --git a/LLama.SemanticKernel/README.md b/LLama.SemanticKernel/README.md new file mode 100644 index 00000000..369968b0 --- /dev/null +++ b/LLama.SemanticKernel/README.md @@ -0,0 +1,26 @@ +# LLamaSharp.SemanticKernel + +LLamaSharp.SemanticKernel are connections for [SemanticKernel](https://github.com/microsoft/semantic-kernel): an SDK for intergrating various LLM interfaces into a single implementation. With this, you can add local LLaMa queries as another connection point with your existing connections. + +For reference on how to implement it, view the following examples: + +- [SemanticKernelChat](../LLama.Examples/NewVersion/SemanticKernelChat.cs) +- [SemanticKernelPrompt](../LLama.Examples/NewVersion/SemanticKernelPrompt.cs) + +## ITextCompletion +```csharp +using var model = LLamaWeights.LoadFromFile(parameters); +// LLamaSharpTextCompletion can accept ILLamaExecutor. +var ex = new StatelessExecutor(model, parameters); +var builder = new KernelBuilder(); +builder.WithAIService("local-llama", new LLamaSharpTextCompletion(ex), true); +``` + +## IChatCompletion +```csharp +using var model = LLamaWeights.LoadFromFile(parameters); +using var context = model.CreateContext(parameters); +// LLamaSharpChatCompletion requires InteractiveExecutor, as it's the best fit for the given command. +var ex = new InteractiveExecutor(context); +var chatGPT = new LLamaSharpChatCompletion(ex); +```