Method: projects.locations.collections.engines.assistants.agents.files.import

Imports a file to an Agent. Currently only No-code agents are supported.

HTTP request

POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*/assistants/*/agents/*}/files:import

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The resource name of the Agent. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}/agents/{agent}

Request body

The request body contains data with the following structure:

JSON representation
{
  "fileName": string,
  "mimeType": string
}
Fields
fileName

string

Required. The name of the file.

mimeType

string

Optional. The content type of the file, see https://www.iana.org/assignments/media-types/media-types.xhtml.

This field is required when the data source does not provide the content type.

Response body

Response for the AgentService.ImportAgentFile method.

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

JSON representation
{
  "agentFile": {
    object (AgentFile)
  }
}
Fields
agentFile

object (AgentFile)

The imported AgentFile.

Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the Authentication Overview.

AgentFile

Describes a file used internally by an agent as a context on each invocation.

JSON representation
{
  "name": string,
  "fileName": string,
  "mimeType": string
}
Fields
name

string

Identifier. The resource name of the file. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}/agents/{agent}/files/{file}

fileName

string

Required. The name of the file.

mimeType

string

Immutable. The content type of the file.