Add "reasoning" attribute to AIMessage
Privileged issue
- [x] I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here.
Issue Content
Proposal is to add an attribute to AIMessage:
reasoning?: MessageContent;
See discussion on Slack (https://langchaincommunity.slack.com/archives/C07EHF3HC87/p1737150066310499) and discussion in #7434 and #7564
cc: @jacoblee93
We are going to put reasoning_content in additional_kwargs for now but will upgrade the schema in the future:
https://github.com/langchain-ai/langchainjs/pull/7604
@jacoblee93 - What is the format of reasoning_content? Whatever the model returns or should we be defining a specific type?
For now whatever the model defines (Deepseek makes it a string)
Would imagine in the future it'll be content blocks or string but would prefer to wait for the dust to settle a bit
@dosu Any update on this ?