Union.aiRemote#
The Union.aiRemote
Python API supports functionality similar to that of the union
CLI, enabling you to manage Union.ai workflows, tasks, launch plans and artifacts from within your Python code.
Note
The primary use case of Union.aiRemote
is to automate the deployment of Union.ai entities. As such, it is intended for use within scripts external to actual Union.ai workflow and task code, for example CI/CD pipeline scripts.
In other words: Do not use Union.aiRemote
within task code.
Creating a Union.aiRemote
object#
Ensure that you have the union
SDK installed, import the Union.aiRemote
class and create the object like this:
from union import Union.aiRemote
remote = Union.aiRemote()
By default, when created with a no-argument constructor, Union.aiRemote
will use the prevailing configuration in the local environment to connect to Union.ai, that is, the same configuration as would be used by the union
CLI in that environment (see Union.ai CLI > union
CLI configuration search path).
In the default case, as with the union
CLI, all operations will be applied to the default project, default
and default domain, development
.
Alternatively, you can initialize Union.aiRemote
by explicitly specifying a project, and a domain:
from union import Union.aiRemote
remote = Union.aiRemote(
default_project="my-project",
default_domain="my-domain",
)