mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 02:41:59 -04:00
13 lines
285 B
Plaintext
13 lines
285 B
Plaintext
```python
|
|
from langchain.messages import HumanMessage
|
|
from langchain_core.load import dumpd, load
|
|
|
|
message = HumanMessage("What is the capital of France?")
|
|
|
|
# Serialize to a plain dict
|
|
serialized = dumpd(message)
|
|
|
|
# Deserialize back to a message object
|
|
restored = load(serialized)
|
|
```
|