Patch Changes
-
#9763
8f0757fThanks @AdamParker19! - fix(langchain): resolve className collision in MODEL_PROVIDER_CONFIGRefactored
getChatModelByClassNameto accept an optionalmodelProviderparameter for direct lookup, avoiding the className collision issue where multiple providers share the same className (e.g.,google-vertexaiandgoogle-vertexai-webboth use"ChatVertexAI"). WhenmodelProvideris provided, the function uses direct config lookup instead of searching by className. Backward compatibility is maintained for existing callers that only passclassName. This eliminates the duplicated import logic that was previously in_initChatModelHelper.