MCPcopy
hub / github.com/langchain-ai/langchainjs / isInstance

Function isInstance

libs/langchain-core/src/messages/base.ts:368–376  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

366 }
367
368 static isInstance(obj: unknown): obj is BaseMessage {
369 return (
370 typeof obj === "object" &&
371 obj !== null &&
372 MESSAGE_SYMBOL in obj &&
373 (obj as Record<symbol, unknown>)[MESSAGE_SYMBOL] === true &&
374 isMessage(obj)
375 );
376 }
377
378 // this private method is used to update the ID for the runtime
379 // value as well as in lc_kwargs for serialisation

Callers 1

makeMessageTypeMatcherFunction · 0.50

Calls 2

isMessageFunction · 0.85
isInstanceMethod · 0.65

Tested by

no test coverage detected