Files
semantic-kernel/dotnet/samples/KernelSyntaxExamples/Example11_WebSearchQueries.cs
T
Roger Barreto da2dfda017 .Net Removing special "input" argument (#4156)
### 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" });
```
2023-12-12 14:49:49 +00:00

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>());
}
}