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

assert_is_file_content() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  fc3e0627_eb3c_a199_98e4_dff322660661["assert_is_file_content()"]
  e20f2c32_b105_01cb_557f_c10174db767d["_files.py"]
  fc3e0627_eb3c_a199_98e4_dff322660661 -->|defined in| e20f2c32_b105_01cb_557f_c10174db767d
  9a63633c_8e74_26f9_c6a1_f20798823de1["is_file_content()"]
  fc3e0627_eb3c_a199_98e4_dff322660661 -->|calls| 9a63633c_8e74_26f9_c6a1_f20798823de1
  style fc3e0627_eb3c_a199_98e4_dff322660661 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_files.py lines 33–38

def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
    if not is_file_content(obj):
        prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
        raise RuntimeError(
            f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/anthropics/anthropic-sdk-python/tree/main#file-uploads"
        ) from None

Subdomains

Frequently Asked Questions

What does assert_is_file_content() do?
assert_is_file_content() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_files.py.
Where is assert_is_file_content() defined?
assert_is_file_content() is defined in src/anthropic/_files.py at line 33.
What does assert_is_file_content() call?
assert_is_file_content() calls 1 function(s): is_file_content.

Analyze Your Own Codebase

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

Try Supermodel Free