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

test_tracks_tool_input_type_alias_is_up_to_date() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  42114240_4d88_077a_0d26_d81f7b50ca80["test_tracks_tool_input_type_alias_is_up_to_date()"]
  8cc8cd20_a242_314f_b59d_2d554c624e7c["test_messages.py"]
  42114240_4d88_077a_0d26_d81f7b50ca80 -->|defined in| 8cc8cd20_a242_314f_b59d_2d554c624e7c
  style 42114240_4d88_077a_0d26_d81f7b50ca80 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/streaming/test_messages.py lines 309–338

def test_tracks_tool_input_type_alias_is_up_to_date() -> None:
    from typing import get_args

    from pydantic import BaseModel

    from anthropic.types.content_block import ContentBlock

    # Get the content block union type
    content_block_union = get_args(ContentBlock)[0]

    # Get all types from ContentBlock union
    content_block_types = get_args(content_block_union)

    # Types that should have an input property
    types_with_input: Set[Any] = set()

    # Check each type to see if it has an input property in its model_fields
    for block_type in content_block_types:
        if issubclass(block_type, BaseModel) and "input" in block_type.model_fields:
            types_with_input.add(block_type)

    # Get the types included in TRACKS_TOOL_INPUT
    tracked_types = TRACKS_TOOL_INPUT

    # Make sure all types with input are tracked
    for block_type in types_with_input:
        assert block_type in tracked_types, (
            f"ContentBlock type {block_type.__name__} has an input property, "
            f"but is not included in TRACKS_TOOL_INPUT. You probably need to update the TRACKS_TOOL_INPUT type alias."
        )

Subdomains

Frequently Asked Questions

What does test_tracks_tool_input_type_alias_is_up_to_date() do?
test_tracks_tool_input_type_alias_is_up_to_date() is a function in the anthropic-sdk-python codebase, defined in tests/lib/streaming/test_messages.py.
Where is test_tracks_tool_input_type_alias_is_up_to_date() defined?
test_tracks_tool_input_type_alias_is_up_to_date() is defined in tests/lib/streaming/test_messages.py at line 309.

Analyze Your Own Codebase

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

Try Supermodel Free