The Gretel Object

A one-stop shop for interacting with Gretel’s APIs, models, and artifacts

The Gretel object provides a streamlined interface for Gretel's SDK:

from gretel_client import Gretel

Configure your Gretel session

Your Gretel session is configured upon instantiation of a Gretel object. To customize your session (e.g., with custom endpoints for a Hybrid deployment), pass any keyword argument of the configure_session function to the Gretel initialization method:

gretel = Gretel(project_name="sdk-docs", api_key="prompt")

Set the current project

Each Gretel instance is bound to a single project.

You have three options for setting the current project:

  1. Use the project_name keyword argument when you instantiate a Gretel object, as we demonstrated above. If the project does not exist, a new one will be created.

  2. Use the set_project method. For example, gretel.set_project("sdk-docs"). Again, if the project does not exist, a new one will be created.

  3. Do not set the project. In this case, a random project will be created when you submit the first job of the session.

Last updated