Skip to content

.Net: Add support for getting notified of all messages and obsolete remaining methods using threadId. #11229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

westey-m
Copy link
Contributor

Motivation and Context

Some agents currently support returning fully formed messages in a ChatHistory object when invoking with streaming.
These invoke methods need to be obsoleted since they are not using AgentThread.
Moving to a new pattern where we allow an optional OnNewMessage callback on options where users can subscribe to all fully formed messages, whether with streaming or without.

Description

  • Updated AzureAIAgent, OpenAIAssistantAgent and ChatCompletion agent
  • Added additional integration tests for this
  • Updated samples to new pattern

Contribution Checklist

obsolete remaining methods using threadid.
@westey-m westey-m requested a review from a team as a code owner March 27, 2025 14:58
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Mar 27, 2025
@github-actions github-actions bot changed the title Add support for getting notified of all messages and obsolete remaining methods using threadId. .Net: Add support for getting notified of all messages and obsolete remaining methods using threadId. Mar 27, 2025
@westey-m westey-m enabled auto-merge March 27, 2025 16:02
@westey-m westey-m added this pull request to the merge queue Mar 27, 2025
github-merge-queue bot pushed a commit that referenced this pull request Mar 27, 2025
…emaining methods using threadId. (#11229)

### Motivation and Context

Some agents currently support returning fully formed messages in a
ChatHistory object when invoking with streaming.
These invoke methods need to be obsoleted since they are not using
`AgentThread`.
Moving to a new pattern where we allow an optional `OnNewMessage`
callback on options where users can subscribe to all fully formed
messages, whether with streaming or without.

### Description

- Updated AzureAIAgent, OpenAIAssistantAgent and ChatCompletion agent
- Added additional integration tests for this
- Updated samples to new pattern

### 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 😄
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 27, 2025
@westey-m westey-m added this pull request to the merge queue Mar 27, 2025
Merged via the queue into microsoft:main with commit 38d891e Mar 27, 2025
20 checks passed
@westey-m westey-m deleted the common-agent-api-obsoletewithhistory branch March 27, 2025 16:35
glorious-beard pushed a commit to glorious-beard/semantic-kernel that referenced this pull request Apr 6, 2025
…emaining methods using threadId. (microsoft#11229)

### Motivation and Context

Some agents currently support returning fully formed messages in a
ChatHistory object when invoking with streaming.
These invoke methods need to be obsoleted since they are not using
`AgentThread`.
Moving to a new pattern where we allow an optional `OnNewMessage`
callback on options where users can subscribe to all fully formed
messages, whether with streaming or without.

### Description

- Updated AzureAIAgent, OpenAIAssistantAgent and ChatCompletion agent
- Added additional integration tests for this
- Updated samples to new pattern

### 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 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants