Skip to content

Consider Adding ChatResponse.ReasoningText #6757

@rogerbarreto

Description

@rogerbarreto

With the growth of reasoning models and the presence of TextReasoningContent would be desirable to have a easier way to extract all the thinking content from ChatResponse.

ChatResponse response = chatClient.GetResponseAsync(...);
string? text = response.Text;
string? thinking = response.ReasoningText; // GG

This would avoid the complexity of combining multiple message thinking together like below:

    string assistantThinking = string.Join("\n", result.Messages
        .SelectMany(m => m.Contents)
        .OfType<TextReasoningContent>()
        .Select(trc => trc.Text));

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-aiMicrosoft.Extensions.AI libraries

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions