Skip to content
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

method not found exception #10

Open
ujdev911 opened this issue Apr 3, 2024 · 5 comments
Open

method not found exception #10

ujdev911 opened this issue Apr 3, 2024 · 5 comments

Comments

@ujdev911
Copy link

ujdev911 commented Apr 3, 2024

hi i am getting method not found exception, can you please help and tell me what i am doing wrong
System.MissingMethodException: 'Method not found: 'System.Collections.Generic.Dictionary`2<System.String,System.Object> Microsoft.SemanticKernel.PromptExecutionSettings.get_ExtensionData()'.'


try
{
    var builder = Kernel.CreateBuilder();

    // provide the HTTP client used to interact with Ollama API
    builder.Services.AddTransient<HttpClient>();

    builder.AddOllamaTextGeneration(
       modelId: "mistral:latest", // Ollama model Id
        baseUrl: "http://127.0.0.1:11434" // Ollama endpoint
    );

    var kernel = builder.Build();
    string prompt = File.ReadAllText("prompt.txt");
    string input = "test";
    var result = await kernel.InvokePromptAsync(prompt, new KernelArguments
{     {"input", input}            });
    string s = result.GetValue<string>();
}
catch (Exception ex)
{

}

prompt.txt

Bot: How can I help you?
User: {{$input}}

---------------------------------------------

The intent of the user in 5 words or less:

i am using .net 8 winform project

@BLaZeKiLL
Copy link
Owner

Could you let me know what version of Semantic Kernel you are using? Something might have changed in the new versions. I'll take a look at this over the weekend.

Also, the Ollama Plugin will soon be integrated into the main repository of semantic kernel. You can check out here. Some minor work is pending, hopefully, it gets merged into main soon

@ujdev911
Copy link
Author

ujdev911 commented Apr 4, 2024

Thank you for getting back to me! I have the following packages installed
image

@descention
Copy link

Try changing your builder.AddOllamaTextGeneration to builder.AddOllamaChatCompletion. I had the same error the first time I tried.

@willvelida
Copy link

@descention - This worked for me! Thank you!

@BLaZeKiLL
Copy link
Owner

builder. AddOllamaTextGeneration should also work; I have pushed version 1.3.1 of the plugin that I tested against semantic kernel 1.14.1; let me know if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants