mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Fixed typo in get_started.mdx (#10163)
Fix typo: 'Whats up' -> 'What's up' Thanks CC: @baskaryan, @eyurtsev, @rlancemartin. --------- Co-authored-by: Aashish Saini <141953346+AashishSainiShorthillsAI@users.noreply.github.com> Co-authored-by: AryamanJaiswalShorthillsAI <142397527+AryamanJaiswalShorthillsAI@users.noreply.github.com> Co-authored-by: Adarsh Shrivastav <142413097+AdarshKumarShorthillsAI@users.noreply.github.com> Co-authored-by: Vishal <141389263+VishalYadavShorthillsAI@users.noreply.github.com> Co-authored-by: ChetnaGuptaShorthillsAI <142381084+ChetnaGuptaShorthillsAI@users.noreply.github.com> Co-authored-by: PankajKumarShorthillsAI <142473460+PankajKumarShorthillsAI@users.noreply.github.com> Co-authored-by: AbhishekYadavShorthillsAI <142393903+AbhishekYadavShorthillsAI@users.noreply.github.com> Co-authored-by: AmitSinghShorthillsAI <142410046+AmitSinghShorthillsAI@users.noreply.github.com> Co-authored-by: Aayush <142384656+AayushShorthillsAI@users.noreply.github.com>
This commit is contained in:
parent
f6f0b0f975
commit
7403faa063
@ -7,7 +7,7 @@ from langchain.memory import ConversationBufferMemory
|
||||
|
||||
memory = ConversationBufferMemory()
|
||||
memory.chat_memory.add_user_message("hi!")
|
||||
memory.chat_memory.add_ai_message("whats up?")
|
||||
memory.chat_memory.add_ai_message("what's up?")
|
||||
```
|
||||
|
||||
When using memory in a chain, there are a few key concepts to understand.
|
||||
@ -28,7 +28,7 @@ memory.load_memory_variables({})
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
{'history': "Human: hi!\nAI: whats up?"}
|
||||
{'history': "Human: hi!\nAI: what's up?"}
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
@ -41,12 +41,12 @@ For example, if you want the memory variables to be returned in the key `chat_hi
|
||||
```python
|
||||
memory = ConversationBufferMemory(memory_key="chat_history")
|
||||
memory.chat_memory.add_user_message("hi!")
|
||||
memory.chat_memory.add_ai_message("whats up?")
|
||||
memory.chat_memory.add_ai_message("what's up?")
|
||||
```
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
{'chat_history': "Human: hi!\nAI: whats up?"}
|
||||
{'chat_history': "Human: hi!\nAI: what's up?"}
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
@ -65,13 +65,13 @@ In order to return as a list of messages, you can set `return_messages=True`
|
||||
```python
|
||||
memory = ConversationBufferMemory(return_messages=True)
|
||||
memory.chat_memory.add_user_message("hi!")
|
||||
memory.chat_memory.add_ai_message("whats up?")
|
||||
memory.chat_memory.add_ai_message("what's up?")
|
||||
```
|
||||
<CodeOutputBlock lang="python">
|
||||
|
||||
```
|
||||
{'history': [HumanMessage(content='hi!', additional_kwargs={}, example=False),
|
||||
AIMessage(content='whats up?', additional_kwargs={}, example=False)]}
|
||||
AIMessage(content='what's up?', additional_kwargs={}, example=False)]}
|
||||
```
|
||||
|
||||
</CodeOutputBlock>
|
||||
|
Loading…
Reference in New Issue
Block a user