-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Python: Fix function calling concept example. #6477
Conversation
…unction calling. Add a test.
Python 3.10 Test Coverage Report •
Python 3.10 Unit Test Overview
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to start adding these sample to sample tests? In a similar approach as the learn resources ones, but perhaps with individual tests to account for more complex things!
Yes, let's do it. I am going to start adding OpenAPI unit tests now, as we don't have any. I will start adding some of these concept examples as more tests. |
### Motivation and Context A function calling plugin example is failing due to an incorrect chat completion base method. Additionally, if one specifies to enable function calling with auto invoke set to False, and they don't provide a kernel, then there is no error thrown. <!-- 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. --> ### Description This PR: - Fixes the concept example that shows three different ways to handle function calling. - Fixes microsoft#6453 - Adjusts the error checks for the kernel and arguments in the open_ai_chat_completion_base: manual function calling doesn't require arguments, so don't throw if they aren't provided; however, it does require a kernel, which is used to configure the tools for the settings, so this check has to be by itself. - Add a unit test to exercise slightly different behavior. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### 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/CONT RIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBU TING.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 😄
### Motivation and Context A function calling plugin example is failing due to an incorrect chat completion base method. Additionally, if one specifies to enable function calling with auto invoke set to False, and they don't provide a kernel, then there is no error thrown. <!-- 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. --> ### Description This PR: - Fixes the concept example that shows three different ways to handle function calling. - Fixes microsoft#6453 - Adjusts the error checks for the kernel and arguments in the open_ai_chat_completion_base: manual function calling doesn't require arguments, so don't throw if they aren't provided; however, it does require a kernel, which is used to configure the tools for the settings, so this check has to be by itself. - Add a unit test to exercise slightly different behavior. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### 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 😄
Motivation and Context
A function calling plugin example is failing due to an incorrect chat completion base method. Additionally, if one specifies to enable function calling with auto invoke set to False, and they don't provide a kernel, then there is no error thrown.
Description
This PR:
Contribution Checklist