Files
semantic-kernel/python/samples/getting_started_with_agents
Evan Mattson ee40e88c13 Python: Introduce Agent group chat functionality (#8184)
### Motivation and Context

In the next phase of the agent work in Python, we are to introduce the
ability to have agents interact with each other. Agent group chat allows
developers to create richer and more dynamic agent interactions.

<!-- 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 introduces the following:
- Agent group chat functionality via an `agent_chat` base class that
forms the foundation for group chats. An `agent_group_chat` class
extends that underlying functionality and provides an entry point to
kick off the group chat either via invoking the chat for the defined
agents, or specifying if a provided agent is to join the existing chat.
- The required channels for the chat completion agent and assistant
agent to properly chat together
- Adds more concept samples and getting started with agent samples to
enrich the onboarding experiencing for those wanting to see the
capability of agents and agent group chat.
- Adds unit test for near 100% coverage
- Updates some existing imports for agents, which try and make the
required import experience more intuitive.
- Introduces assistant agent abstractions for working with files and
vector stores so we don't directly expose the underlying client types.
- Closes #7966 
- Closes #7577

<!-- 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
- [ ] I didn't break anyone 😄
2024-08-19 18:04:44 +00:00
..

Semantic Kernel Agents - Getting Started

This project contains a step by step guide to get started with Semantic Kernel Agents in Python.

PyPI:

  • For the use of Chat Completion agents, the minimum allowed Semantic Kernel pypi version is 1.3.0.
  • For the use of OpenAI Assistant agents, the minimum allowed Semantic Kernel pypi version is 1.4.0.
  • For the use of Agent Group Chat, the minimum allowed Semantic kernel pypi version is 1.6.0.

Source

Examples

The getting started with agents examples include:

Example Description
step1_agent How to create and use an agent.
step2_plugins How to associate plugins with an agent.
step3_chat How to create a conversation between agents.
step4_kernel_function_strategies How to utilize a KernelFunction as a chat strategy.
step5_json_result How to have an agent produce JSON.
step6_logging How to enable logging for agents.
step7_assistant How to create and use an OpenAI Assistant agent.
step8_assistant_vision How to provide an image as input to an Open AI Assistant agent.
step9_assistant_tool_code_interpreter How to use the code-interpreter tool for an Open AI Assistant agent.
step10_assistant_tool_file_search How to use the file-search tool for an Open AI Assistant agent.

Note: As we strive for parity with .NET, more getting_started_with_agent samples will be added. The current steps and names may be revised to further align with our .NET counterpart.

Configuring the Kernel

Similar to the Semantic Kernel Python concept samples, it is necessary to configure the secrets and keys used by the kernel. See the follow "Configuring the Kernel" guide for more information.

Running Concept Samples

Concept samples can be run in an IDE or via the command line. After setting up the required api key for your AI connector, the samples run without any extra command line arguments.