Files
semantic-kernel/python/samples
Evan Mattson bf42feda6d Python: Fix function calling concept example. (#6477)
### 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 #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 😄
2024-05-31 20:50:26 +00:00
..