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

assert_tool_use_response() — anthropic-sdk-python Function Reference

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

Function python AnthropicClient SyncAPI calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  59d20233_d69f_b950_5ea4_1ee77ec38630["assert_tool_use_response()"]
  239f7d64_6d26_d418_04e3_d586fe367986["test_beta_messages.py"]
  59d20233_d69f_b950_5ea4_1ee77ec38630 -->|defined in| 239f7d64_6d26_d418_04e3_d586fe367986
  8f450ef4_3bea_5a50_6741_63552939eb9f["test_tool_use()"]
  8f450ef4_3bea_5a50_6741_63552939eb9f -->|calls| 59d20233_d69f_b950_5ea4_1ee77ec38630
  2d02c760_5abf_bf03_495b_f7d4b3fe39ab["test_tool_use()"]
  2d02c760_5abf_bf03_495b_f7d4b3fe39ab -->|calls| 59d20233_d69f_b950_5ea4_1ee77ec38630
  b6dcecb2_d1cc_b379_c8e2_2beae6f86849["assert_message_matches()"]
  59d20233_d69f_b950_5ea4_1ee77ec38630 -->|calls| b6dcecb2_d1cc_b379_c8e2_2beae6f86849
  style 59d20233_d69f_b950_5ea4_1ee77ec38630 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/streaming/test_beta_messages.py lines 178–180

def assert_tool_use_response(events: list[ParsedBetaMessageStreamEvent], message: BetaMessage) -> None:
    assert_message_matches(message, EXPECTED_TOOL_USE_MESSAGE)
    assert [e.type for e in events] == EXPECTED_TOOL_USE_EVENT_TYPES

Subdomains

Frequently Asked Questions

What does assert_tool_use_response() do?
assert_tool_use_response() is a function in the anthropic-sdk-python codebase, defined in tests/lib/streaming/test_beta_messages.py.
Where is assert_tool_use_response() defined?
assert_tool_use_response() is defined in tests/lib/streaming/test_beta_messages.py at line 178.
What does assert_tool_use_response() call?
assert_tool_use_response() calls 1 function(s): assert_message_matches.
What calls assert_tool_use_response()?
assert_tool_use_response() is called by 2 function(s): test_tool_use, test_tool_use.

Analyze Your Own Codebase

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

Try Supermodel Free