Home / Function/ _async_collect_files() — anthropic-sdk-python Function Reference

_async_collect_files() — anthropic-sdk-python Function Reference

Architecture documentation for the _async_collect_files() function in _files.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  ef8f0faa_c480_0152_1c90_cc9bca4c390b["_async_collect_files()"]
  b21d65c1_1f1b_5699_6638_2ab0107a8fb1["_files.py"]
  ef8f0faa_c480_0152_1c90_cc9bca4c390b -->|defined in| b21d65c1_1f1b_5699_6638_2ab0107a8fb1
  73ced425_e238_4e62_3e4a_712abab05e2d["async_files_from_dir()"]
  73ced425_e238_4e62_3e4a_712abab05e2d -->|calls| ef8f0faa_c480_0152_1c90_cc9bca4c390b
  style ef8f0faa_c480_0152_1c90_cc9bca4c390b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/lib/_files.py lines 36–42

async def _async_collect_files(directory: anyio.Path, relative_to: anyio.Path, files: list[FileTypes]) -> None:
    async for path in directory.iterdir():
        if await path.is_dir():
            await _async_collect_files(path, relative_to, files)
            continue

        files.append((path.relative_to(relative_to).as_posix(), await path.read_bytes()))

Subdomains

Frequently Asked Questions

What does _async_collect_files() do?
_async_collect_files() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/_files.py.
Where is _async_collect_files() defined?
_async_collect_files() is defined in src/anthropic/lib/_files.py at line 36.
What calls _async_collect_files()?
_async_collect_files() is called by 1 function(s): async_files_from_dir.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free