Method: projects.locations.notebooks.sources.batchCreate

Creates a list of Sources.

HTTP request

POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/notebooks/*}/sources:batchCreate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The parent resource where the sources will be created. Format: projects/{project}/locations/{location}/notebooks/{notebook}

Request body

The request body contains data with the following structure:

JSON representation
{
  "userContents": [
    {
      object (UserContent)
    }
  ]
}
Fields
userContents[]

object (UserContent)

Required. The UserContents to be uploaded.

Response body

Response for SourceService.BatchCreateSources method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "sources": [
    {
      object (Source)
    }
  ]
}
Fields
sources[]

object (Source)

The Sources.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • discoveryengine.sources.create

For more information, see the IAM documentation.

UserContent

The "Content" messages refer to data the user wants to upload.

JSON representation
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "googleDriveContent": {
    object (GoogleDriveContent)
  },
  "textContent": {
    object (TextContent)
  },
  "webContent": {
    object (WebContent)
  },
  "videoContent": {
    object (VideoContent)
  },
  "agentspaceContent": {
    object (AgentspaceContent)
  }
  // End of mutually exclusive fields.
}
Fields
The user content. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
googleDriveContent

object (GoogleDriveContent)

The content from Google Drive.

textContent

object (TextContent)

The text content uploaded as source.

webContent

object (WebContent)

The web content uploaded as source.

videoContent

object (VideoContent)

The video content uploaded as source.

agentspaceContent

object (AgentspaceContent)

Agentspace content uploaded as source.

End of mutually exclusive fields.

GoogleDriveContent

The content from Google Drive.

JSON representation
{
  "documentId": string,
  "mimeType": string,
  "sourceName": string
}
Fields
documentId

string

The document ID of the selected document.

mimeType

string

The mime type of the selected document.

This can be used to differentiate type of content selected in the drive picker. Use application/vnd.google-apps.document for Google Docs or application/vnd.google-apps.presentation for Google Slides.

sourceName

string

The name to be displayed for the source.

TextContent

The text content uploaded as source.

JSON representation
{
  "sourceName": string,
  "content": string
}
Fields
sourceName

string

The display name of the text source.

content

string

The name to be displayed for the source.

WebContent

The web content uploaded as source.

JSON representation
{
  "url": string,
  "sourceName": string
}
Fields
url

string

If URL is supplied, will fetch the webpage in the backend.

sourceName

string

The name to be displayed for the source.

VideoContent

Video content uploaded as source.

JSON representation
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "youtubeUrl": string
  // End of mutually exclusive fields.
}
Fields
Specifies the format of the video content The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
youtubeUrl

string

The youtube url of the video content.

End of mutually exclusive fields.

AgentspaceContent

Agentspace content uploaded as source.

JSON representation
{
  "documentName": string,
  "engineName": string,
  "ideaforgeIdeaName": string
}
Fields
documentName

string

Optional. The full resource name of the Agentspace document. Format: projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{documentId}.

engineName

string

Optional. Engine to verify the permission of the document. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}.

ideaforgeIdeaName

string

Optional. Resource name of the idea forge instance. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/ideaForgeInstances/{instance}