Skip to content

Commit f6daf1e

Browse files
TheovanKraayCopilot
andcommitted
Update src/oss/langchain/short-term-memory.mdx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c399485 commit f6daf1e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/oss/langchain/short-term-memory.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ os.environ["COSMOSDB_ENDPOINT"] = "your_cosmosdb_endpoint"
124124
os.environ["COSMOSDB_KEY"] = "your_cosmosdb_key"
125125

126126
# Database and Container are created if they don't exist
127-
checkpointer = CosmosDBSaver( # [!code highlight]
127+
with CosmosDBSaver( # [!code highlight]
128128
database_name="your_database", # [!code highlight]
129129
container_name="your_container" # [!code highlight]
130-
) # [!code highlight]
130+
) as checkpointer: # [!code highlight]
131131

132-
agent = create_agent(
133-
"gpt-5",
134-
[get_user_info],
135-
checkpointer=checkpointer, # [!code highlight]
136-
)
132+
agent = create_agent(
133+
"gpt-5",
134+
[get_user_info],
135+
checkpointer=checkpointer, # [!code highlight]
136+
)
137137
```
138138

139139
<Note>

0 commit comments

Comments
 (0)