Repository navigation
Python: Implement Function calling for Chat - #2356
Merged
Gina Triolo (gitri-ms) merged 49 commits intoOct 12, 2023
Merged
Conversation
Eduard van Valkenburg (eavanvalkenburg)
requested a review
from a team
as a code owner
August 8, 2023 13:35
Abby Harrison (awharrison-28)
suggested changes
Aug 9, 2023
Eduard van Valkenburg (eavanvalkenburg)
requested a review
from a team
as a code owner
August 21, 2023 14:29
Eduard van Valkenburg (eavanvalkenburg)
force-pushed
the
function_calling
branch
2 times, most recently
from
August 25, 2023 06:56
b8246de to
5cd7f85
Compare
Member
|
Handful of checks are not yet passing, so will turn this one to draft for now. Please feel free to re-open when things are resolved. |
Lee Miller (lemillermicrosoft)
marked this pull request as draft
August 25, 2023 17:41
Eduard van Valkenburg (eavanvalkenburg)
force-pushed
the
function_calling
branch
2 times, most recently
from
August 26, 2023 11:25
40b8ec0 to
10c93fa
Compare
Member
Author
|
Gina Triolo (@gitri-ms) I got a hanging push earlier, naming is now updated. |
Member
Author
|
Lee Miller (@lemillermicrosoft) fixed all tests |
Eduard van Valkenburg (eavanvalkenburg)
marked this pull request as ready for review
August 27, 2023 17:52
Abby Harrison (awharrison-28)
approved these changes
Aug 29, 2023
Gina Triolo (gitri-ms)
approved these changes
Aug 29, 2023
Gina Triolo (gitri-ms)
left a comment
Contributor
There was a problem hiding this comment.
Just one tiny thing to fix, then LGTM!
Lee Miller (lemillermicrosoft)
previously requested changes
Aug 30, 2023
Lee Miller (lemillermicrosoft)
left a comment
Member
There was a problem hiding this comment.
Left some comments, I think we should remove changes to the template config where they are not required and lean on the skill collection for supplying available functions.
Member
Gina Triolo (gitri-ms)
marked this pull request as draft
August 30, 2023 20:22
Gina Triolo (gitri-ms)
self-requested a review
August 30, 2023 20:22
Eduard van Valkenburg (eavanvalkenburg)
force-pushed
the
function_calling
branch
from
October 4, 2023 19:38
69e47a8 to
5adac35
Compare
Eduard van Valkenburg (eavanvalkenburg)
requested review from
Gina Triolo (gitri-ms) and
Lee Miller (lemillermicrosoft)
October 4, 2023 19:56
Gina Triolo (gitri-ms)
approved these changes
Oct 12, 2023
SOE-YoungS
pushed a commit
to SOE-YoungS/semantic-kernel
that referenced
this pull request
Nov 1, 2023
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel 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. --> I built support for function calling into SK! Related to/fixes: - microsoft#2315 - microsoft#2175 - microsoft#1450 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> This implementation builds on top of all the existing pieces, but did require some major work, so feel free to comment on where that is or is not appropriate. - Added a `ChatMessage` class to capture the relevant pieces of function calling (name and content) - Added a `complete_chat_with_functions_async` into OpenAIChatCompletions class - Added a `function_call` field to ChatRequestSettings class - Added several helper functions and smaller changes - Added a sample with updated core_skill that uses function calling to demonstrate - Added a second sample that shows how to use function_calling with non-sk functions. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Abby Harrison <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation and Context
I built support for function calling into SK!
Related to/fixes:
Description
This implementation builds on top of all the existing pieces, but did require some major work, so feel free to comment on where that is or is not appropriate.
ChatMessageclass to capture the relevant pieces of function calling (name and content)complete_chat_with_functions_asyncinto OpenAIChatCompletions classfunction_callfield to ChatRequestSettings classContribution Checklist