Gretel Navigator Inference API
Real-time data generation with Gretel Navigator
Last updated
Was this helpful?
Real-time data generation with Gretel Navigator
Last updated
Was this helpful?
The previous sections on the were focused on running batch jobs, which are -based and do not support real-time interaction. In this section, we will introduce the Navigator inference API, which makes it easy to generate high-quality synthetic tabular and text data – in real time – with just a few lines of code, powered by .
Navigator currently supports two data generation modes: tabular
and natural_language
. In both modes, you can choose the backend model that powers the generation, which we'll describe in more detail below.
The has a factories
attribute that provides helper methods for creating new objects that interact with Gretel's non-project-based APIs. Let's use the factories
attribute to fetch the available backend models that power Navigator's tabular
data generation:
This will print the list of available models, the first of which will be gretelai/auto
, which automatically selects the current default model, which will change with time as models continue to evolve.
To initialize the Navigator Tabular inference API, we use the initialize_navigator_api
method. Then, we can generate synthetic data in real time using its generate
method:
You can augment an existing dataset using the edit
method:
Finally, Navigator's tabular
mode supports streaming data generation. To enable streaming, simply set the stream
parameter to True
:
Navigator's natural_language
mode gives you access to state-of-the-art LLMs for generating text data. Let's fetch the available backend models that power Navigator's natural_language
data generation:
Similar to the tabular
mode, this will print the list of available models, the first of which will be gretelai/gpt-auto
, which automatically selects the current default model.
To initialize the Navigator Natural Language inference API, we again use the initialize_navigator_api
method. Then, we can generate synthetic text data in real time using its generate
method: