semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Generic gRPC client to invoke polyglot arbitrary native skills

Open thegovind opened this issue 2 years ago • 0 comments

Motivation and Context

Due to several customer requests, we want to have examples of polyglot Skills, starting with the most popular languages that customers demand. This PR implements a generic gRPC Skill Runner in C#, with a sample gRPC server in Java that implements a reference skill to fetch a random activity. By invoking Java code from C# code, this demonstrates the interoperability between Java and C# via gRPC.

Related to:

Description

🚧 WIP

sequenceDiagram
    participant CLR as GrpcSkillRunner<br>(gRPC client stub in .NET CLR)
    participant GSC as GrpcServerConnector
    participant JVM as RandomActivitySkill<br>(gRPC server in Java JVM)
    participant API as boredapi.com
    
    Note over GSC,JVM: Proto over HTTP/2
    
    CLR->>GSC: GetRandomActivityRequest(input: "surf")
    GSC->>JVM: GetRandomActivityRequest(input: "surf")
    JVM->>API: HTTP Request to /api/activity
    API->>JVM: HTTP Response with random activity data
    JVM->>GSC: GetRandomActivityResponse(activity: "Random activity")
    GSC->>CLR: GetRandomActivityResponse(activity: "Random activity")

Contribution Checklist

  • [ ] The code builds clean without any errors or warnings
  • [ ] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
  • [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with dotnet format
  • [ ] All unit tests pass, and I have added new tests where possible
  • [ ] I didn't break anyone :smile:

thegovind avatar Apr 14 '23 13:04 thegovind