Closed mateuszmigas closed 1 month ago
Hi @mateuszmigas , thanks for reporting this issue!
You can define different functions which will use different models, but as first step you need to register all available models in your app in Kernel, and then during function initialization or invocation you can select which model to use based on registered models in Kernel:
// Build a kernel with multiple chat completion services
var builder = Kernel.CreateBuilder()
.AddOpenAIChatCompletion(
modelId: "gpt-4-0125-preview",
apiKey: TestConfiguration.OpenAI.ApiKey)
.AddOpenAIChatCompletion(
modelId: "gpt-3.5-turbo-0125",
apiKey: TestConfiguration.OpenAI.ApiKey);
Kernel kernel = builder.Build();
var prompt = "Hello AI, what can you do for me?";
var result = await kernel.InvokePromptAsync(prompt, new(new OpenAIPromptExecutionSettings { ModelId = "gpt-3.5-turbo-0125" }));
@dmytrostruk thanks for answer!
Describe the bug Function OpenAIPromptExecutionSettings do not override kernel modelId.
To Reproduce Steps to reproduce the behavior: Run the following code:
Expected behavior It should use execution settings model.
Screenshots N/A
Platform
Additional context Code to run: