Currently we have Kernel examples that are very simple using C#:
Kernel kernel = Kernel.CreateBuilder()
.AddOpenAIChatCompletion(modelId: “gpt-4o”, apiKey: “…”)
.Build();
Console.WriteLine(await kernel.InvokePromptAsync("Why is the sky blue?"));
In python there's no way to use it as function_name and plugin_name are required arguments and need to be created manually with a prompttemplateconfig.
Desired but not supported today
kernel = Kernel()
kernel.add_service(OpenAIChatCompletion(ai_model_id="gpt-4o", api_key="..."))
print(asyncio.run(kernel.invoke_prompt("Why is the sky blue")))
Currently to achieve a result all those lines are required in python:
kernel = Kernel()
kernel.add_service(OpenAIChatCompletion(ai_model_id="gpt-4o", api_key="..."))
prompt_template_config = PromptTemplateConfig(template="why is the sky blue")
tldr_function = kernel.add_function(function_name="tldrFunction",plugin_name="tldrPlugin", prompt_template_config = prompt_template_config)
result = asyncio.run(kernel.invoke(tldr_function))
print(result)
Currently we have Kernel examples that are very simple using C#:
In python there's no way to use it as
function_nameandplugin_nameare required arguments and need to be created manually with aprompttemplateconfig.Desired but not supported today
Currently to achieve a result all those lines are required in python: