Minor Changes
- #12252
bbf8a1aThanks @thushanth-bengre-langchain! - Standardize finish reason onmessage-finishevents and finalAIMessages. Provider integrations setfinish_reason(raw provider value),normalized_finish_reason(stop | length | tool_call | content_filter | refusal | context_exceeded | error | other) and, for Anthropic,finish_state(complete | suspended) inresponse_metadata; events carry them asfinishReason,normalizedFinishReasonandfinishState. Core no longer maps provider values: it passes these fields through and corrects two provider-agnostic cases (a refusal block becomesrefusal, andstopwith tool calls becomestool_call). TheFinishReasontype changes fromstop | length | tool_use | content_filterto the values above (tool_useis nowtool_call).MessageFinishEvent.reasonis deprecated but still emitted with its old values (tool_callmaps totool_use,refusaltocontent_filter,context_exceededtolength; left unset forotheranderror).response_metadata.finish_reasonon streamed messages now holds the raw provider value instead of the normalized one.