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 can be bound to a single project. This is relevant when you submit project-based jobs like training or generating synthetic data with a Gretel Model.

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 if/when you run a submit_* method. This behavior is described in the Train and Generate Jobs section.

A Note on "Project Name"

Project names must be unique, but project display names can be the same. Because of this, many times your project name will be different than the display name. The display name is what is surfaced in the UI.

To look up your project name in the Console:

  1. Navigate to the Projects tab

  2. Select your project

  3. Click on "Settings", down and to the right of the project name

The box labeled "Name" is your project name.

Last updated

Was this helpful?