Ray
This section contains detailed reference documentation for working with the Ray API in Graphbook.
- graphbook.init(*, host='0.0.0.0', port=8005) None
Initializes Ray and Graphbook web server if not already initialized.
- Parameters:
host – The host address to bind the web server to. Default is 0.0.0.0.
port – The port to bind the web server to. Default is 8005.
- graphbook.run(dag: DAGNode, name: str | None = None) dict
Runs a workflow synchronously. See
run_async()
for more details.- Returns:
The multi-output value of the argument leaf node.
- graphbook.run_async(dag: DAGNode, name: str | None = None) ObjectRef
Run a workflow asynchronously.
If the workflow with the given id already exists, it will be resumed.
- Parameters:
dag – The leaf node of the DAG. Will recursively run its dependencies.
name – A unique identifier that can be used to identify the graphbook execution in the web UI. If not specified, a random id will be generated.
- Returns:
The running result as ray.ObjectRef.