VetiverAPI.vetiver_post

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

Create new POST endpoint that is aware of model input data

Parameters

endpoint_fx : typing.Callable

Custom function to be run at endpoint

endpoint_name : str = None

Name of endpoint

Examples

from vetiver import mock, VetiverModel, VetiverAPI
X, y = mock.get_mock_data()
model = mock.get_mock_model().fit(X, y)

v = VetiverModel(model = model, model_name = "model", prototype_data = X)
v_api = VetiverAPI(model = v, check_prototype = True)

def sum_values(x):
    return x.sum()
v_api.vetiver_post(sum_values, "sums")