forked from phoenix/litellm-mirror
23 lines
No EOL
373 B
Text
23 lines
No EOL
373 B
Text
```python
|
|
from langchain.memory import ChatMessageHistory
|
|
|
|
history = ChatMessageHistory()
|
|
|
|
history.add_user_message("hi!")
|
|
|
|
history.add_ai_message("whats up?")
|
|
```
|
|
|
|
|
|
```python
|
|
history.messages
|
|
```
|
|
|
|
<CodeOutputBlock lang="python">
|
|
|
|
```
|
|
[HumanMessage(content='hi!', additional_kwargs={}),
|
|
AIMessage(content='whats up?', additional_kwargs={})]
|
|
```
|
|
|
|
</CodeOutputBlock> |