VetiverAPI.vetiver_post

VetiverAPI.vetiver_post(endpoint_fx, endpoint_name=None, **kw)

Create new POST endpoint that is aware of model input data

Parameters

Name Type Description Default
endpoint_fx typing.Callable Custom function to be run at endpoint required
endpoint_name str Name of endpoint None

Examples

>>> import vetiver as vt
>>> X, y = vt.get_mock_data()
>>> model = vt.get_mock_model().fit(X, y)
>>> v = vt.VetiverModel(model = model, model_name = "model", prototype_data = X)
>>> v_api = vt.VetiverAPI(model = v, check_prototype = True)
>>> def sum_values(x):
...     return x.sum()
>>> v_api.vetiver_post(sum_values, "sums")