Skip to content

docs: fix async memory tool example - #1981

Closed
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1290-async-example
Closed

nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1290-async-example

Conversation

@nightcityblade

Copy link
Copy Markdown

What problem this solves

The BetaAsyncAbstractMemoryTool docstring currently shows the synchronous base class, synchronous handlers, and synchronous client. Following it raises errors instead of demonstrating the async API.

Why this change was made

The example now subclasses BetaAsyncAbstractMemoryTool, defines async handlers, uses AsyncAnthropic, and awaits the tool runner inside an asyncio entry point.

User impact

Users can copy the async memory-tool example and follow the correct async control flow.

Evidence

  • .venv/bin/ruff check src/anthropic/lib/tools/_beta_builtin_memory_tool.py
  • .venv/bin/ruff format --check src/anthropic/lib/tools/_beta_builtin_memory_tool.py
  • .venv/bin/pytest -n 0 tests/lib/tools/memory_tools/test_filesystem.py (69 passed)

Fixes #1290

@nightcityblade
nightcityblade requested a review from a team as a code owner October 5, 2026 15:24
@nightcityblade

Copy link
Copy Markdown
Author

Closing this as a duplicate of #1291. I missed the older linked PR during my duplicate check—sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BetaAsyncAbstractMemoryTool docstring contains sync-only example (copy-paste from sync class)

1 participant