_get_weather() — anthropic-sdk-python Function Reference
Architecture documentation for the _get_weather() function in test_runners.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD be8a7f3a_5951_1f73_7331_3ad05c999ecf["_get_weather()"] 8ecd4321_1ed7_9c90_8d23_e61f807683d3["test_runners.py"] be8a7f3a_5951_1f73_7331_3ad05c999ecf -->|defined in| 8ecd4321_1ed7_9c90_8d23_e61f807683d3 49e71ebb_20f4_087e_7d45_f025ccd02165["test_basic_call_sync()"] 49e71ebb_20f4_087e_7d45_f025ccd02165 -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf c6cb9700_00c6_527f_dcfd_c498f856fc40["test_tool_call_error()"] c6cb9700_00c6_527f_dcfd_c498f856fc40 -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf d58be04b_df6f_a0c1_5a21_2cb82fab496e["test_custom_message_handling()"] d58be04b_df6f_a0c1_5a21_2cb82fab496e -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf eb9121ce_90c5_9e50_25e6_4cd4f45e879d["test_tool_call_caching()"] eb9121ce_90c5_9e50_25e6_4cd4f45e879d -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf 02207e27_836f_6963_15cf_0fc348ef6b62["test_streaming_call_sync()"] 02207e27_836f_6963_15cf_0fc348ef6b62 -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf 02fd438c_68ab_e0a1_e789_e598f8598566["test_max_iterations()"] 02fd438c_68ab_e0a1_e789_e598f8598566 -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf e9798232_e45a_0fe8_021e_639088536658["test_streaming_call_sync_events()"] e9798232_e45a_0fe8_021e_639088536658 -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf 2b3dba12_a276_98a4_6fd3_f9b5878e1c32["test_basic_call_async()"] 2b3dba12_a276_98a4_6fd3_f9b5878e1c32 -->|calls| be8a7f3a_5951_1f73_7331_3ad05c999ecf style be8a7f3a_5951_1f73_7331_3ad05c999ecf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/lib/tools/test_runners.py lines 584–599
def _get_weather(location: str, units: Literal["c", "f"]) -> Dict[str, Any]:
# Simulate a weather API call
print(f"Fetching weather for {location} in {units}")
if units == "c":
return {
"location": location,
"temperature": "20°C",
"condition": "Sunny",
}
else:
return {
"location": location,
"temperature": "68°F",
"condition": "Sunny",
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does _get_weather() do?
_get_weather() is a function in the anthropic-sdk-python codebase, defined in tests/lib/tools/test_runners.py.
Where is _get_weather() defined?
_get_weather() is defined in tests/lib/tools/test_runners.py at line 584.
What calls _get_weather()?
_get_weather() is called by 8 function(s): test_basic_call_async, test_basic_call_sync, test_custom_message_handling, test_max_iterations, test_streaming_call_sync, test_streaming_call_sync_events, test_tool_call_caching, test_tool_call_error.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free