Mapbox line labels/arrows via geojson layer's layout property

I’m trying to add labels and arrows to my map’s lines using the technique outlined here and which both use the ‘layout’ property of the mapbox layer. However, it appears that ‘layout’ is not supported in the Python API.

Basically, the layers are defined as so:
layers=[dict(sourcetype = ‘geojson’,
source={‘type’: ‘FeatureCollection’, ‘features’: line_features},
dict(sourcetype = ‘geojson’,
source={‘type’: ‘FeatureCollection’, ‘features’: line_features},
layout={‘symbol-placement’: ‘line’, ‘text-field’: ‘{title}’, ‘text-size’: 16}),

Which results in ‘plotly.exceptions.PlotlyDictKeyError: ‘layout’ is not allowed in ‘layer’’. Is there an alternate way of implementing arrows/line labels using the geojson source? I tried creating lines via Scattermapbox, but I have >20k lines and it was extraordinarily slow (at least when used via Dash). Is it easy to expose this property to the API and how would one do so beyond simple steps of adding to the Python Layer object?