Type guard to check if an object is an AIMessage. Preserves the MessageStructure type parameter when called with a typed BaseMessage. When called with a typed BaseMessage, preserves the TStructure type
isInstance<
T extends MessageStructure<MessageToolSet>
>(obj: BaseMessage<T>): obj is BaseMessage<T, MessageType> AIMessage<T>| Name | Type | Description |
|---|---|---|
obj* | BaseMessage<T> |