diff --git a/langchain-core/src/language_models/chat_models.ts b/langchain-core/src/language_models/chat_models.ts index a44525fb7e86..f3b900427ba0 100644 --- a/langchain-core/src/language_models/chat_models.ts +++ b/langchain-core/src/language_models/chat_models.ts @@ -771,7 +771,7 @@ export abstract class BaseChatModel< parsed: RunOutput; } > { - if (!("bindTools" in this) || typeof this.bindTools !== "function") { + if (typeof this.bindTools !== "function") { throw new Error( `Chat model must implement ".bindTools()" to use withStructuredOutput.` ); @@ -897,4 +897,4 @@ export abstract class SimpleChatModel< ], }; } -} \ No newline at end of file +}