Complete code examples demonstrating all operations are available on Blaxelβs GitHub: in TypeScript and in Python.
Set up authentication to Blaxel
Set up authentication to Blaxel
The Blaxel SDK authenticates with your workspace using credentials from these sources, in priority order:
- when running on Blaxel, authentication is handled automatically
- variables in your
.env
file (BL_WORKSPACE
andBL_API_KEY
, or see this page for other authentication options). - environment variables from your machine
- configuration file created locally when you log in through Blaxel CLI (or deploy on Blaxel)
In batch
Retrieve from the execution object
Logs for a process are available in the process execution object if the process is started with thewaitForCompletion: true
/ "wait_for_completion": True
parameter.
Both standard output (stdout) and standard error (stderr) are surfaced:
Retrieve from a completed process name or ID
Retrieve logs for a specific process (using either its name or process ID) after it has completed execution. By default, this retrieves standard output (stdout) only:Streaming
Retrieve via a callback function
The callback handlers receive log entries in real-time as theyβre generated by the process:- onLog/on_log: Receives complete log objects with additional metadata