mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context Resolves #3887 Before: ```csharp var result = await kernel.InvokeAsync(excuseFunction, new("I missed the F1 final race")); ``` After: ```csharp var result = await kernel.InvokeAsync(excuseFunction, new() { ["input"] = "I missed the F1 final race" }); ```
28 lines
793 B
C#
28 lines
793 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.SemanticKernel;
|
|
using Microsoft.SemanticKernel.Plugins.Web;
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
public static class Example11_WebSearchQueries
|
|
{
|
|
public static async Task RunAsync()
|
|
{
|
|
Console.WriteLine("======== WebSearchQueries ========");
|
|
|
|
Kernel kernel = new();
|
|
|
|
// Load native plugins
|
|
var bing = kernel.ImportPluginFromType<SearchUrlPlugin>("search");
|
|
|
|
// Run
|
|
var ask = "What's the tallest building in Europe?";
|
|
var result = await kernel.InvokeAsync(bing["BingSearchUrl"], new() { ["input"] = ask });
|
|
|
|
Console.WriteLine(ask + "\n");
|
|
Console.WriteLine(result.GetValue<string>());
|
|
}
|
|
}
|