chore: import upstream snapshot with attribution
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:21:23 +08:00
commit b957a53def
5423 changed files with 863745 additions and 0 deletions
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft. All rights reserved.
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Plugins.Grpc;
namespace Plugins;
// This example shows how to use gRPC plugins.
public class ImportPluginFromGrpc(ITestOutputHelper output) : BaseTest(output)
{
[Fact(Skip = "Setup crendentials")]
public async Task RunAsync()
{
Kernel kernel = new();
// Import a gRPC plugin using one of the following Kernel extension methods
// kernel.ImportGrpcPlugin
// kernel.ImportGrpcPluginFromDirectory
var plugin = kernel.ImportPluginFromGrpcFile("<path-to-.proto-file>", "<plugin-name>");
// Add arguments for required parameters, arguments for optional ones can be skipped.
var arguments = new KernelArguments
{
["address"] = "<gRPC-server-address>",
["payload"] = "<gRPC-request-message-as-json>"
};
// Run
var result = await kernel.InvokeAsync(plugin["<operation-name>"], arguments);
Console.WriteLine($"Plugin response: {result.GetValue<string>()}");
}
}