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

GitHub OpenAPI skill integration with planner #792

Merged
merged 12 commits into from May 4, 2023

Conversation

teresaqhoang
Copy link
Contributor

@teresaqhoang teresaqhoang commented May 3, 2023

Motivation and Context

This PR enables GitHub integration with Copilot Planner.

Description

Server-side

  • Added C# classes for GitHub schema objects
  • Adds tokenLimit for Planner response content. Currently, it's set at 75% of the remaining limit after memories response and document context have already been allocated.
  • Added OptimizeOpenApiSkillJson method that is called on Planner completion. This method:
    • removes all new line characters (huge token suck) from API response
    • truncates the API response by object until it's under the relatedInformationTokenLimit.
    • If the request can't be truncated, error message added to bot context
    • For GitHub skills specifically, the API response is deserialized into PullRequest or PullRequest[] objects to filter noisy properties.

Web app side

  • If plugins require additional api requirements, these are added to the ask variables (rather than headers in http request) -- this allows the kernel/planner to directly consume these without any additional handling server side
  • repo and owner added as additional GitHub api requirements
  • Rename ApiRequirements to ApiProperties. These properties can be optional.

image

glahaye
glahaye previously approved these changes May 3, 2023
@adrianwyatt adrianwyatt self-assigned this May 3, 2023
@amsacha amsacha mentioned this pull request May 4, 2023
5 tasks
@teresaqhoang teresaqhoang added the PR: ready for review All feedback addressed, ready for reviews label May 4, 2023
@adrianwyatt adrianwyatt enabled auto-merge (squash) May 4, 2023 15:41
@adrianwyatt adrianwyatt merged commit 9917ca3 into microsoft:main May 4, 2023
11 checks passed
teresaqhoang added a commit to teresaqhoang/semantic-kernel that referenced this pull request May 4, 2023
### Motivation and Context
This PR enables GitHub integration with Copilot Planner. 


### Description
Server-side
- Added C# classes for GitHub schema objects
- Adds tokenLimit for Planner response content. Currently, it's set at
75% of the remaining limit after memories response and document context
have already been allocated.
- Added `OptimizeOpenApiSkillJson` method that is called on Planner
completion. This method:
- removes all new line characters (huge token suck) from API response
- truncates the API response by object until it's under the
relatedInformationTokenLimit.
- If the request can't be truncated, error message added to bot context
- For GitHub skills specifically, the API response is deserialized into
`PullRequest` or `PullRequest[]` objects to filter noisy properties.

Web app side
- If plugins require additional api requirements, these are added to the
ask variables (rather than headers in http request) -- this allows the
kernel/planner to directly consume these without any additional handling
server side
- `repo` and `owner` added as additional GitHub api requirements
- Rename ApiRequirements to ApiProperties. These properties can be
optional.


![image](https://user-images.githubusercontent.com/125500434/236005717-14016432-b5de-47b3-a128-e38418c267e3.png)
@teresaqhoang teresaqhoang deleted the optimize-github-response branch May 15, 2023 16:59
codebrain pushed a commit to searchpioneer/semantic-kernel that referenced this pull request May 16, 2023
### Motivation and Context
This PR enables GitHub integration with Copilot Planner. 


### Description
Server-side
- Added C# classes for GitHub schema objects
- Adds tokenLimit for Planner response content. Currently, it's set at
75% of the remaining limit after memories response and document context
have already been allocated.
- Added `OptimizeOpenApiSkillJson` method that is called on Planner
completion. This method:
- removes all new line characters (huge token suck) from API response
- truncates the API response by object until it's under the
relatedInformationTokenLimit.
- If the request can't be truncated, error message added to bot context
- For GitHub skills specifically, the API response is deserialized into
`PullRequest` or `PullRequest[]` objects to filter noisy properties.

Web app side
- If plugins require additional api requirements, these are added to the
ask variables (rather than headers in http request) -- this allows the
kernel/planner to directly consume these without any additional handling
server side
- `repo` and `owner` added as additional GitHub api requirements
- Rename ApiRequirements to ApiProperties. These properties can be
optional.


![image](https://user-images.githubusercontent.com/125500434/236005717-14016432-b5de-47b3-a128-e38418c267e3.png)
dehoward pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
### Motivation and Context
This PR enables GitHub integration with Copilot Planner. 


### Description
Server-side
- Added C# classes for GitHub schema objects
- Adds tokenLimit for Planner response content. Currently, it's set at
75% of the remaining limit after memories response and document context
have already been allocated.
- Added `OptimizeOpenApiSkillJson` method that is called on Planner
completion. This method:
- removes all new line characters (huge token suck) from API response
- truncates the API response by object until it's under the
relatedInformationTokenLimit.
- If the request can't be truncated, error message added to bot context
- For GitHub skills specifically, the API response is deserialized into
`PullRequest` or `PullRequest[]` objects to filter noisy properties.

Web app side
- If plugins require additional api requirements, these are added to the
ask variables (rather than headers in http request) -- this allows the
kernel/planner to directly consume these without any additional handling
server side
- `repo` and `owner` added as additional GitHub api requirements
- Rename ApiRequirements to ApiProperties. These properties can be
optional.


![image](https://user-images.githubusercontent.com/125500434/236005717-14016432-b5de-47b3-a128-e38418c267e3.png)
golden-aries pushed a commit to golden-aries/semantic-kernel that referenced this pull request Oct 10, 2023
### Motivation and Context
This PR enables GitHub integration with Copilot Planner. 


### Description
Server-side
- Added C# classes for GitHub schema objects
- Adds tokenLimit for Planner response content. Currently, it's set at
75% of the remaining limit after memories response and document context
have already been allocated.
- Added `OptimizeOpenApiSkillJson` method that is called on Planner
completion. This method:
- removes all new line characters (huge token suck) from API response
- truncates the API response by object until it's under the
relatedInformationTokenLimit.
- If the request can't be truncated, error message added to bot context
- For GitHub skills specifically, the API response is deserialized into
`PullRequest` or `PullRequest[]` objects to filter noisy properties.

Web app side
- If plugins require additional api requirements, these are added to the
ask variables (rather than headers in http request) -- this allows the
kernel/planner to directly consume these without any additional handling
server side
- `repo` and `owner` added as additional GitHub api requirements
- Rename ApiRequirements to ApiProperties. These properties can be
optional.


![image](https://user-images.githubusercontent.com/125500434/236005717-14016432-b5de-47b3-a128-e38418c267e3.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants