mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
33 lines
869 B
C#
33 lines
869 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.SemanticKernel;
|
|
using Microsoft.SemanticKernel.Skills.Web;
|
|
using RepoUtils;
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
public static class Example11_WebSearchQueries
|
|
{
|
|
public static async Task RunAsync()
|
|
{
|
|
Console.WriteLine("======== WebSearchQueries ========");
|
|
|
|
IKernel kernel = Kernel.Builder.WithLogger(ConsoleLogger.Log).Build();
|
|
|
|
// Load native skills
|
|
var skill = new SearchUrlSkill();
|
|
var bing = kernel.ImportSkill(skill, "search");
|
|
|
|
// Run
|
|
var ask = "What's the tallest building in Europe?";
|
|
var result = await kernel.RunAsync(
|
|
ask,
|
|
bing["BingSearchUrl"]
|
|
);
|
|
|
|
Console.WriteLine(ask + "\n");
|
|
Console.WriteLine(result);
|
|
}
|
|
}
|