Message from the user.
A HumanMessage is a message that is passed in from a user to the model.
HumanMessage(
self,
content: str | list[str | dict] | None = None,
content_blocks: list[types.ContentBlock] | None = None,
**kwargs: Any = {}
)Example:
from langchain_core.messages import HumanMessage, SystemMessage
messages = [
SystemMessage(content="You are a helpful assistant! Your name is Bob."),
HumanMessage(content="What is your name?"),
]
# Instantiate a chat model and invoke it with the messages
model = ...
print(model.invoke(messages))The contents of the message.
Currently inherited from BaseMessage, but not used.
Currently inherited from BaseMessage, but not used.
The name of the function.
The unique identifier of the node.
Return standard, typed ContentBlock dicts from the message.
Prompt text.
Return True as this class is serializable.
Get the namespace of the LangChain object.
Return a unique identifier for this class for serialization purposes.
Convert the graph to a JSON-serializable format.
Serialize a "not implemented" object.