Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic gRPC client to invoke polyglot arbitrary native skills #451

Closed
wants to merge 4 commits into from

Conversation

thegovind
Copy link
Contributor

@thegovind thegovind commented Apr 14, 2023

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

@shawncal
Copy link
Member

@thegovind Closing this out as you're working with @SergeyMenshykh on this.

@shawncal shawncal closed this Apr 26, 2023
shawncal pushed a commit that referenced this pull request May 3, 2023
…) with a sample proto file (#768)

### Motivation and Context
This is related to #451,
craigomatic#13, and
craigomatic#16, where we want to
demonstrate how Native skills can be invoked via gRPC and implemented
across various languages. In this case, we are specifically implementing
this polyglot Native skill in Java due to customer inquiries.


### Description
This change introduces a sample Java application that functions as a
gRPC server. The `GrpcOperationRunner` can invoke Java code using the
[activity.proto file in this
PR](https://github.com/thegovind/semantic-kernel/blob/feature-grpc/samples/java/JavaReferenceSkill/src/main/proto/activity.proto)
and its operation `GetRandomActivity`, as shown in
[`Example27_GrpcSkills` in
`kernel-syntax-examples`](https://github.com/microsoft/semantic-kernel/pull/730/files#diff-29f0ad84e48c3fe28f2ad26603940927306a57aaf76f6c01fc19e7ac82e33da0).
golden-aries pushed a commit to golden-aries/semantic-kernel that referenced this pull request Oct 24, 2023
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Two configs in the deployment templates have the wrong names.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Fix the names.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants