Skip to content

method not found exception #10

@ujdev911

Description

@ujdev911

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions