Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update ToChatResponse{Async} to also factor in AuthorName#6910

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
stephentoub merged 2 commits intodotnet:mainfromstephentoub:authorsplit
Oct 10, 2025

Conversation

@stephentoub
Copy link
Member

@stephentoubstephentoub commentedOct 10, 2025
edited by dotnet-policy-servicebot
Loading

Originally we were only factoring in Role. Then we also augmented it to factor in MessageId, since updates from different messages are by definition not part of the same message. Now it also makes sense to factor in AuthorName, as different text from different speakers / agents are also by definition not part of the same message.

Microsoft Reviewers:Open in CodeFlow

Originally we were only factoring in Role. Then we also augmented it to factor in MessageId, since updates from different messages are by definition not part of the same message. Now it also makes sense to factor in AuthorName, as different text from different speakers / agents are also by definition not part of the same message.
@stephentoubstephentoub requested a review froma team as acode ownerOctober 10, 2025 04:03
@stephentoubstephentoub requested review fromCopilot and removed request fora teamOctober 10, 2025 04:03
@stephentoub
Copy link
MemberAuthor

cc:@westey-m

westey-m reacted with thumbs up emoji

@github-actionsgithub-actionsbot added the area-aiMicrosoft.Extensions.AI libraries labelOct 10, 2025
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates theToChatResponse andToChatResponseAsync methods to includeAuthorName as an additional boundary condition for determining when to create new chat messages from streaming updates. Previously, the methods only consideredRole andMessageId changes as triggers for new message boundaries. Now, changes inAuthorName will also dictate message boundaries, ensuring that text from different speakers/agents are properly separated into distinct messages.

Key changes:

  • Enhanced boundary detection logic to includeAuthorName comparison alongside existingRole andMessageId checks
  • Comprehensive test coverage for variousAuthorName boundary scenarios
  • Updated existing tests to reflect the new behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

FileDescription
src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseExtensions.csRefactored message boundary detection logic to includeAuthorName comparison and added helper methods for clean boundary checking
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/ChatCompletion/ChatResponseUpdateExtensionsTests.csAdded extensive test coverage forAuthorName boundary scenarios and updated existing tests to accommodate the new behavior

@stephentoubstephentoubenabled auto-merge (squash)October 10, 2025 12:10
@stephentoubstephentoub merged commit3d0419c intodotnet:mainOct 10, 2025
6 checks passed
@stephentoubstephentoub deleted the authorsplit branchOctober 10, 2025 22:38
joperezr pushed a commit to joperezr/extensions that referenced this pull requestOct 14, 2025
* Update ToChatResponse{Async} to also factor in AuthorNameOriginally we were only factoring in Role. Then we also augmented it to factor in MessageId, since updates from different messages are by definition not part of the same message. Now it also makes sense to factor in AuthorName, as different text from different speakers / agents are also by definition not part of the same message.* Fix useAsync inversion in tests
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull requestOct 21, 2025
* Update ToChatResponse{Async} to also factor in AuthorNameOriginally we were only factoring in Role. Then we also augmented it to factor in MessageId, since updates from different messages are by definition not part of the same message. Now it also makes sense to factor in AuthorName, as different text from different speakers / agents are also by definition not part of the same message.* Fix useAsync inversion in tests
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull requestOct 21, 2025
* Update ToChatResponse{Async} to also factor in AuthorNameOriginally we were only factoring in Role. Then we also augmented it to factor in MessageId, since updates from different messages are by definition not part of the same message. Now it also makes sense to factor in AuthorName, as different text from different speakers / agents are also by definition not part of the same message.* Fix useAsync inversion in tests
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 10, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

Copilot code reviewCopilotCopilot left review comments

@jozkeejozkeejozkee approved these changes

@eiriktsarpaliseiriktsarpalisAwaiting requested review from eiriktsarpalis

Assignees

@stephentoubstephentoub

Labels

area-aiMicrosoft.Extensions.AI libraries

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@stephentoub@jozkee

[8]ページ先頭

©2009-2025 Movatter.jp