Files
semantic-kernel/python/tests/unit/kernel
Evan Mattson 858644a8d1 Python: Allow for Agents as Kernel Functions (#11184)
### Motivation and Context

We're moving towards a pattern where Agents can be called as tools. We
currently don't have this in Semantic Kernel Python.

This work builds off of the previous PR (#10828) but extends it to work
with any SK Agent now that we have a bit more of a common invocation
pattern (all agents take in `messages` kwarg). This also works now
because each agent creates its own thread internally, if one isn't
provided - so we don't need to worry about handling chat history for an
OpenAI Assistant or an Azure AI Agent.

<!-- 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

Allow agents to be configured as Kernel Functions, which can then be
used during Function Calling. We will advertise the Agent's name and
either its description or instructions (if description is blank).
- Provide a sample where we show a triage agent (ChatCompletionAgent)
calling either a billing agent (ChatCompletionAgent) or a refund agent
(ChatCompletionAgent ) as part of a tool call to satisfy the user's
query.
- Provide a sample where we show a triage agent (ChatCompletionAgent)
calling either a billing agent (AzureAIAgent) or a refund agent
(ChatCompletionAgent) to satisfy the user's query.


<!-- 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 😄
2025-03-26 02:29:12 +00:00
..