ReallzeV.SemanticKernel.Plugins.Web.ShaBing 1.0.1-pre

This is a prerelease version of ReallzeV.SemanticKernel.Plugins.Web.ShaBing.
dotnet add package ReallzeV.SemanticKernel.Plugins.Web.ShaBing --version 1.0.1-pre                
NuGet\Install-Package ReallzeV.SemanticKernel.Plugins.Web.ShaBing -Version 1.0.1-pre                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ReallzeV.SemanticKernel.Plugins.Web.ShaBing" Version="1.0.1-pre" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ReallzeV.SemanticKernel.Plugins.Web.ShaBing --version 1.0.1-pre                
#r "nuget: ReallzeV.SemanticKernel.Plugins.Web.ShaBing, 1.0.1-pre"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ReallzeV.SemanticKernel.Plugins.Web.ShaBing as a Cake Addin
#addin nuget:?package=ReallzeV.SemanticKernel.Plugins.Web.ShaBing&version=1.0.1-pre&prerelease

// Install ReallzeV.SemanticKernel.Plugins.Web.ShaBing as a Cake Tool
#tool nuget:?package=ReallzeV.SemanticKernel.Plugins.Web.ShaBing&version=1.0.1-pre&prerelease                

说明

  • 这是一个基于PlayWright的Unofficial Bing Search API简单实现,用于SemanticKernel.Plugins.Web中测试使用。当然也可直接使用。

  • 使用前需安装PlayWright,参考Installation | Playwright

基本使用

  • SemanticKernel.Plugins.Web使用方式
var textSearch = new ShaBingSearch();
var query = "什么是语义内核?";
KernelSearchResults<object> objectResults = await textSearch.GetSearchResultsAsync(
    query,
    new() { Top = 4 }
);
await foreach (ShaBingWebPage webPage in objectResults.Results)
{
    Console.WriteLine($"名称:            {webPage.Name}");
    Console.WriteLine($"摘要:         {webPage.Snippet}");
    Console.WriteLine($"网址:             {webPage.Url}");
    Console.WriteLine($"显示网址:      {webPage.DisplayUrl}");
    Console.WriteLine($"最后爬取日期: {webPage.DateLastCrawled}");
}
  • 直接使用
using var bingSearch = new ShaBingSearchCore();
var results = await bingSearch.ExecuteSearchAsync(
    "什么是语义内核?", 
    new Microsoft.SemanticKernel.Data.TextSearchOptions() { Top = 10 }
);
Console.WriteLine(JsonSerializer.Serialize(results, new JsonSerializerOptions
{
    Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
    WriteIndented = true
}));
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1-pre 37 2/28/2025
1.0.0-pre 28 2/28/2025