Skip to content

Conversation

westey-m
Copy link
Contributor

Motivation and Context

Being able to different invoke agents using a common API is useful to build higher level code on top of.

Description

Adding a common Invoke method with a common Thread object.

Contribution Checklist

### Motivation and Context

Being able to different invoke agents using a common API is useful to
build higher level code on top of.

### Description

Adding a common Invoke method with a common Thread object.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Mar 21, 2025
@github-actions github-actions bot changed the title Add a common agent invoke api. .Net: Add a common agent invoke api. Mar 21, 2025
### Description

- Moved kernel and kernelarguments to options
- Add multi-message invoke overload
- Seal threads and autocreate on new message
- Restrict usage of deleted threads.
- Added tests for threads logic

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Description

- Move invoke tests to subfolder
- Add implicit cast operator from response item to message
- Mark GetMessagesAsync as experimental for each Thread implementation

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
…#11125)

### Motivation and Context

Responses doesn't support an explicit create and will create a thread on
invoke automatically so create is a no-op and there is no id available
on create.

### Description

Remove returned id from AgentThread.Create to support responses

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Python support for common agent API

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Evan Mattson <[email protected]>
Co-authored-by: Tao Chen <[email protected]>
Co-authored-by: Ben Thomas <[email protected]>
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel documentation labels Mar 22, 2025
@github-actions github-actions bot changed the title .Net: Add a common agent invoke api. Python: .Net: Add a common agent invoke api. Mar 22, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Mar 22, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/agents
   agent.py1502285%46, 53, 57, 66–77, 124, 129, 134, 139, 144, 148, 152, 156, 263–265, 332
semantic_kernel/agents/autogen
   autogen_conversable_agent.py1171587%68, 74, 86, 88, 93–97, 271–272, 281–284
semantic_kernel/agents/azure_ai
   agent_thread_actions.py34112962%142, 144, 179–182, 369, 371, 410–411, 437, 440–444, 447–459, 462–493, 499–506, 509–522, 538–569, 613, 616, 647–681, 744, 749–754, 774–781, 812–821, 864–876
   azure_ai_agent.py1764077%92, 103–113, 118–123, 130–139, 150–156, 207, 209, 215, 226–231, 233, 235, 256–259, 329, 430, 528, 590
   azure_ai_channel.py41393%93, 120–121
semantic_kernel/agents/bedrock
   bedrock_agent.py2445179%77–84, 93, 159, 296, 315, 331–334, 340, 342, 345, 350, 390, 422–442, 446, 486, 505–508, 510–513, 555, 566–567, 579, 615–626, 637, 654–667, 684–693
   bedrock_agent_base.py1414171%101, 119–120, 145, 158–160, 187, 206–208, 213, 232–234, 239, 243–244, 264–266, 275, 294–298, 303, 322–326, 331, 343–345, 357–376
semantic_kernel/agents/channels
   bedrock_agent_channel.py79297%208–209
   chat_history_channel.py69297%147, 150
semantic_kernel/agents/chat_completion
   chat_completion_agent.py1982090%70, 80, 86, 98, 100, 105–109, 167, 170, 180, 188–193, 202, 354, 420, 481
semantic_kernel/agents/open_ai
   assistant_thread_actions.py3365683%107, 110, 113, 189, 191, 228–234, 405, 463, 480, 569–597, 611–620, 656–670, 682–683, 754, 759, 791
   open_ai_assistant_agent.py2282788%93, 110–111, 119–124, 131–141, 152–158, 315, 328, 364, 527, 630, 729
TOTAL21215245488% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3335 5 💤 0 ❌ 0 🔥 1m 37s ⏱️

### Description

- Add unit tests for AgentThread and ChatHistoryAgentThread
- Add unit tests for the OpenAIAssistantAgentThread

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
…entations where possible (#11133)

### Motivation and Context

Some Agents don't support a direct create operation, and threads are
created automatically on first invocation.

### Description

Make AgentThread.Create protected and expose on concrete implementations
where possible

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Ben Thomas and others added 3 commits March 23, 2025 10:53
…e xml docs. (#11138)

### Description

Add more options to getmessages for each agentthread and improve xml
docs.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Motivation and Context

Set 
- AzureAI:Endpoint from secrets
- AzureAI:ConnectionString from secrets 
- AzureAI:ChatModelId from vars

### Description

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

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Description

Fix bug in ChatCompletionAgent

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Description

Obsolete methods where possible and update samples

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@westey-m westey-m marked this pull request as ready for review March 24, 2025 22:10
@westey-m westey-m requested review from a team as code owners March 24, 2025 22:10
### Motivation and Context

<!-- 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.
-->
All Unit tests are passing.
All Bedrock Agent integration tests are passing.
All Bedrock agent samples are running.

### Description

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

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Improving integration tests for Bedrock Agents

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Ben Thomas <[email protected]>
…approach (#11171)

### Motivation and Context

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

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

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
…11172)

### Motivation and Context

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

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

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@westey-m westey-m added this pull request to the merge queue Mar 24, 2025
Merged via the queue into main with commit 17e63a7 Mar 24, 2025
32 checks passed
@westey-m westey-m deleted the feature-common-agent-api branch March 24, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants