Skip to content

Commit 8e0feed

Browse files
authored
Fix formatting and highlight code sections (#1181)
## Overview <!-- Brief description of what documentation is being added/updated --> ## Type of change Improves code highlighting consistency in the documentation and ensures that emphasis is placed on the short-term-memory-related logic rather than unrelated context. **Type:** Update existing documentation ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x] I have read the [contributing guidelines](README.md) - [ ] I have tested my changes locally using `docs dev` - [ ] All code examples have been tested and work correctly - [ ] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed - I have gotten approval from the relevant reviewers - (Internal team members only / optional) I have created a preview deployment using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml)
1 parent c639b7b commit 8e0feed

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,9 @@ def update_user_info(
679679
runtime: ToolRuntime[CustomContext, CustomState],
680680
) -> Command:
681681
"""Look up and update user info."""
682-
user_id = runtime.context.user_id # [!code highlight]
682+
user_id = runtime.context.user_id
683683
name = "John Smith" if user_id == "user_123" else "Unknown user"
684-
return Command(update={
684+
return Command(update={ # [!code highlight]
685685
"user_name": name,
686686
# update the message history
687687
"messages": [
@@ -699,12 +699,11 @@ def greet(
699699
"""Use this to greet the user once you found their info."""
700700
user_name = runtime.state["user_name"]
701701
return f"Hello {user_name}!"
702-
# [!code highlight]
703702
agent = create_agent(
704703
model="gpt-5-nano",
705704
tools=[update_user_info, greet],
706-
state_schema=CustomState,
707-
context_schema=CustomContext, # [!code highlight]
705+
state_schema=CustomState, # [!code highlight]
706+
context_schema=CustomContext,
708707
)
709708

710709
agent.invoke(

0 commit comments

Comments
 (0)