Python Endpoints
This guide explains how to use the Tensor One Python SDK to run, monitor, and manage serverless endpoints using synchronous, asynchronous, and streaming methods.Prerequisites
Before using the SDK:- Install the
tensorone
Python SDK - Set your API key
- Initialize the endpoint
Setup Example
Run Synchronously
Userun_sync()
to execute the endpoint and block until completion or timeout:
Run Asynchronously (Standard Python)
Run Asynchronously with asyncio
Health Check
Inspect worker and job status:Streaming Output
Ensure your handler setsreturn_aggregate_stream: True
: