def test_resolve_tool_choice_tool_required():
    """Test that tool_required=True correctly sets tool_choice to 'required'."""
    from llama_index.llms.oci_data_science.utils import _resolve_tool_choice

    # Test with tool_required=True and no explicit tool_choice
    result = _resolve_tool_choice(tool_choice=None, tool_required=True)
    assert result == "required"

    # Test with tool_required=False and no explicit tool_choice
    result = _resolve_tool_choice(tool_choice=None, tool_required=False)
    assert result == "auto"

    # Test that explicit tool_choice overrides tool_required
    result = _resolve_tool_choice(tool_choice="none", tool_required=True)
    assert result == "none"
Test that tool_required=True correctly sets tool_choice to 'required'.
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_llms_oci_data_science.py