UserInput Request/Response: rename id to requestId#7106
UserInput Request/Response: rename id to requestId#7106jozkee wants to merge 1 commit intodotnet:mainfrom
Conversation
I'm curious which other ID this was confused with? |
| // Validation: Capture each call id for each approval request to ensure later we have a matching response. | ||
| _ = (approvalRequestCallIds ??= []).Add(farc.FunctionCall.CallId); | ||
| (allApprovalRequestsMessages ??= []).Add(farc.Id, message); | ||
| (allApprovalRequestsMessages ??= []).Add(farc.RequestId, message); |
There was a problem hiding this comment.
Let's be thoughtful of when we merge this change with regards to next week's release and any other changes to this same area. It'd be good for all of the breaking changes we plan to make to all of this [Experimental] surface area to land in the same release.
There was a problem hiding this comment.
It probably won't make it for next week, unless we land these other proposed changes:
There was a problem hiding this comment.
Pull request overview
This PR improves API clarity by renaming the ambiguous id parameter to requestId in the UserInput Request/Response API classes. The change addresses issue #6492 where the generic "id" naming was confusing, making it unclear which ID was being referenced. Since these APIs are marked as experimental ([Experimental("MEAI001")]), this is an appropriate time to improve the naming before stabilization.
Key changes:
- Renamed
Idproperty toRequestIdinUserInputRequestContentandUserInputResponseContentbase classes - Updated all derived classes:
FunctionApprovalRequestContent,FunctionApprovalResponseContent,McpServerToolApprovalRequestContent, andMcpServerToolApprovalResponseContent - Updated usages in
FunctionInvokingChatClientandOpenAIResponsesChatClient
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputRequestContent.cs |
Renamed constructor parameter id to requestId and property Id to RequestId in base class |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UserInputResponseContent.cs |
Renamed constructor parameter id to requestId and property Id to RequestId in base class |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/FunctionApprovalRequestContent.cs |
Updated constructor parameter and CreateResponse method to use RequestId |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/FunctionApprovalResponseContent.cs |
Updated constructor parameter and documentation to use requestId |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/McpServerToolApprovalRequestContent.cs |
Updated constructor parameter and CreateResponse method to use RequestId |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/McpServerToolApprovalResponseContent.cs |
Updated constructor parameter and documentation to use requestId |
src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs |
Updated property access from .Id to .RequestId |
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponsesChatClient.cs |
Updated property access from .Id to .RequestId in three locations |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputRequestContentTests.cs |
Updated test parameter names and assertions |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/UserInputResponseContentTests.cs |
Updated test parameter names and assertions |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/FunctionApprovalRequestContentTests.cs |
Updated test parameter names and assertions |
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/FunctionApprovalResponseContentTests.cs |
Updated test parameter names and assertions |
Most likely the CallId from FunctionCall/ResultContent and McpServerToolCall/ResultContent. It was originally mentioned in #6779, in case that rings a bell. |
Ah, ok. |
Id is too vague, changing to RequestId in both approval request/response contents.
Related to #6492
@westey-m
Microsoft Reviewers: Open in CodeFlow