Manage audio overview of your notebook (API)

After you create your notebook and add data sources to it, you can programmatically generate an audio overview of the notebook. At a time, a given notebook can have only one audio overview. This page describes how to create and delete audio overviews.

Difference between an audio overview and a podcast

An audio overview is different from a podcast in the following ways:

  • An audio overview must be associated with a notebook with data sources added to it. On the other hand, a podcast can be generated without a Gemini Notebook for business notebook, a Gemini Enterprise license, or a data store. To create a podcast, all you need is an enabled Google Cloud project and the Podcast API User role.
  • To create an audio overview, call the notebooks.audioOverview method. To create a podcast, call the podcasts method—a standalone API.

Use the US multi-regional endpoint

If your Gemini Notebook for business subscription is in the US multi-region, you can send the requests on this page to the US multi-regional endpoint, discoveryengine.us.rep.googleapis.com. A multi-regional endpoint processes your requests and terminates TLS within the multi-region, so your request data stays in the US while it's in transit. Using this endpoint doesn't change where your notebooks are stored. For more information, see Regional and multi-regional API endpoints overview in the Google Cloud security guide.

To use the US multi-regional endpoint, make the following changes to each request URL on this page:

  1. Replace the ENDPOINT_LOCATION-discoveryengine.googleapis.com host with discoveryengine.us.rep.googleapis.com.

  2. Set LOCATION to us.

The rest of each request stays the same. To learn how you choose your subscription's multi-region, see Get a subscription. For the list of regional and multi-regional service endpoints, see Regional and multi-regional service endpoints in the Virtual Private Cloud guide.

Create an audio overview

To generate an audio overview for the content in your notebook, call the notebooks.audioOverviews.create method. Because you can have only one audio overview per notebook, this method is successful only if the notebook has no existing audio overview.

REST

curl -X POST \
  -H "Authorization:Bearer $(gcloud auth print-access-token)" \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks/NOTEBOOK_ID/audioOverviews" \
  -d '{
  "sourceIds": [
    {
      "id": "SOURCE_ID"
    }
  ],
  "episodeFocus": "EPISODE_FOCUS",
  "languageCode": "LANGUAGE_CODE"
  }

Replace the following:

  • ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:
    • us for the US multi-region
    • eu for the EU multi-region
    • global for the Global location
    For more information, see Specify a multi-region for your data store.
  • PROJECT_NUMBER: the number of your Google Cloud project.
  • LOCATION: the geographic location of your data store, such as global. For more information, see Locations.
  • NOTEBOOK_ID: the unique identifier of the notebook.
  • SOURCE_ID: the ID of the source based on which you want to generate the audio overview. The sourceIdsfield is optional array; if you don't specify any source IDs, all sources in the notebook are used. For information about source ID, see Add and manage data sources in a notebook (API).
  • EPISODE_FOCUS: a string that describes which topics or content must be highlighted in the audio overview.
  • LANGUAGE_CODE: the language code that the audio overview was requested in.

If the request is successful, you should get a JSON response similar to the following. This response shows that the audio overview generation is in progress.

  {
    "audioOverview": {
      "status": "AUDIO_OVERVIEW_STATUS_IN_PROGRESS",
      "audioOverviewId": "AUDIO_OVERVIEW_ID",
      "generationOptions": {},
      "name": "AUDIO_OVERVIEW_NAME"
    }
  }

It takes a few minutes to generate an audio overview.

Verify a generated audio overview

To verify the generated audio overview, do the following:

  1. Open your notebook. For more information, see Access the created notebook.
  2. In your notebook's Studio, click Load to load the conversation. It takes a few moments to load the overview.

    In the studio, you can manage your audio overview with tasks such as changing the playback speed and downloading or deleting the audio overview file.

Delete an audio overview

To delete an existing audio overview, call the notebooks.audioOverviews.delete method.

REST

curl -X DELETE \
  -H "Authorization:Bearer $(gcloud auth print-access-token)" \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks/NOTEBOOK_ID/audioOverviews/default" \

Replace the following:

  • ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:
    • us for the US multi-region
    • eu for the EU multi-region
    • global for the Global location
    For more information, see Specify a multi-region for your data store.
  • PROJECT_NUMBER: the number of your Google Cloud project.
  • LOCATION: the geographic location of your data store, such as global. For more information, see Locations.
  • NOTEBOOK_ID: the unique identifier of the notebook.

If the request is successful, you should get an empty JSON.