-
Notifications
You must be signed in to change notification settings - Fork 3.7k
.Net: Bug: Error in Polyglot Notebook using Ollama Connector #10310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
.NET Interactive now requires the .NET 9 SDK. |
Ensure you add the 9.0.0 dependency injection first. Ollama Connector depends on To fix, you need to restart your kernel and add the 9.0.0 explicitly as the first package. #r "nuget: Microsoft.Extensions.DependencyInjection, 9.0.0"
#r "nuget: Microsoft.SemanticKernel.Core, 1.35.0"
#r "nuget: Microsoft.SemanticKernel.Connectors.Ollama, 1.35.0-alpha"
using Microsoft.SemanticKernel;
using Kernel = Microsoft.SemanticKernel.Kernel;
var builder = Kernel.CreateBuilder();
#pragma warning disable SKEXP0070 // Ollama support is experimental
builder.AddOllamaChatCompletion("llama3.1:8b-instruct-q2_K", new Uri("http://localhost:11434"));
#pragma warning restore SKEXP0070 // Ollama support is experimental
var kernel = builder.Build();
Console.WriteLine("It worked!");
Console.WriteLine(kernel); |
Thanks! After installing the .NET 9 SDK and upgrading to the latest version of the Polyglot Notebooks extension, it is now working. Upgrading the extension was weird. I upgraded, but |
@dschilling This is a known issue (#3757). Until it's fixed, a restart of VS Code should be sufficient to trigger the download of the latest |
Describe the bug
Notebooks that reference the
Microsoft.SemanticKernel.Core
andMicrosoft.SemanticKernel.Connectors.Ollama
nuget packages output errors when they run.To Reproduce
Create a Polyglot Notebook with these two code blocks:
Run the code blocks. It produces this output:
Expected behavior
I expected it to output:
... which is what happens if you create a .NET 8 Console App with the same two nuget packages and that C# code.
Platform
Additional context
I have cross posted this issue with the Polyglot Notebooks team. dotnet/interactive#3823
The text was updated successfully, but these errors were encountered: