Skip to content

Classify

This is a low-level function that allows you to invoke your function with custom data. It currently only supports Classification function types.

nyckel.invoke

invoke(function_id: str, data: str, credentials: Credentials) -> Dict
Source code in src/nyckel/functions/pretrained.py
6
7
8
9
def invoke(function_id: str, data: str, credentials: Credentials) -> Dict:
    session = credentials.get_session()
    endpoint = f"https://www.nyckel.com/v1/functions/{function_id}/invoke"
    return session.post(endpoint, json={"data": data}).json()