Skip to content

Conversation

@moonbox3
Copy link
Collaborator

@moonbox3 moonbox3 commented Jul 5, 2024

Motivation and Context

Following in the steps of dotnet, we're beginning to add agent support to Python. For an initial implementation the focus is on non-grouped, chat completion agents. The first pass is covering a ChatCompletionAgent that allows the user to define a ChatCompletion Service as part of the SK Kernel, and then reference that service in an agent implementation.

Description

The PR:

  • Adds support for a standard chat completion agent
  • Adds the required abstractions to allow the single chat completion agent to work
  • Introduces a new agent concept sample showing how to invoke the agent for a streaming and non-streaming context.
  • Adds unit tests to cover the new code
  • Closes Python: implement single (non-group) agent #7079

image

Contribution Checklist

@moonbox3 moonbox3 requested a review from a team as a code owner July 5, 2024 18:02
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel documentation labels Jul 5, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jul 5, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL698638095% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1782 1 💤 0 ❌ 0 🔥 25.108s ⏱️

Copy link
Contributor

@crickman crickman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great parity! If there's any detail you'd like me to zoom-into, please feel free to direct my attention.

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lots of small comments!

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make it simpler taking advantage of Python!

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small nits, but looking good overall!

@crickman crickman self-requested a review July 11, 2024 19:14
@crickman crickman self-requested a review July 11, 2024 19:51
@moonbox3 moonbox3 enabled auto-merge July 11, 2024 19:52
@moonbox3 moonbox3 added this pull request to the merge queue Jul 11, 2024
Merged via the queue into microsoft:main with commit 240280a Jul 11, 2024
@moonbox3 moonbox3 deleted the single_sk_agent branch July 11, 2024 20:16
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
…oft#7116)

### Motivation and Context

Following in the steps of dotnet, we're beginning to add agent support
to Python. For an initial implementation the focus is on non-grouped,
chat completion agents. The first pass is covering a ChatCompletionAgent
that allows the user to define a ChatCompletion Service as part of the
SK Kernel, and then reference that service in an agent implementation.

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

The PR:
- Adds support for a standard chat completion agent
- Adds the required abstractions to allow the single chat completion
agent to work
- Introduces a new agent concept sample showing how to invoke the agent
for a streaming and non-streaming context.
- Adds unit tests to cover the new code
- Closes microsoft#7079 


![image](https://github.com/microsoft/semantic-kernel/assets/35585003/8fa1f248-52b2-41b9-85ac-38ac80a05a68)

<!-- 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 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents documentation python Pull requests for the Python Semantic Kernel

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Python: implement single (non-group) agent

5 participants