def test_prepare_chat_with_no_tools_tool_not_required():
    """Test that tool_required is correctly passed to the API request when False."""
    llm = Anthropic()

    result = llm._prepare_chat_with_tools(tools=[])

    assert "tool_choice" not in result
    assert len(result["tools"]) == 0
Test that tool_required is correctly passed to the API request when False.
llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py