- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- FileMetadata
- FileSource
Lists metadata for all files in the current session.
HTTP request
GET https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}:listSessionFileMetadata
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The resource name of the Session. Format: |
Request body
The request body must be empty.
Response body
Response message for AssistantService.ListSessionFileMetadata
method.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"fileMetadata": [
{
object ( |
Fields | |
---|---|
fileMetadata[] |
The |
totalQuotaPercentage |
The total quota percentage used by all the files. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the name
resource:
discoveryengine.sessions.listSessionFileMetadata
For more information, see the IAM documentation.
FileMetadata
The metadata of the file.
JSON representation |
---|
{
"fileId": string,
"name": string,
"mimeType": string,
"byteSize": string,
"tokenCount": string,
"quotaPercentage": number,
"selected": boolean,
"usedInConversation": boolean,
"originalUri": string,
"originalSourceType": enum ( |
Fields | |
---|---|
fileId |
The ID of the file. |
name |
The name of the file uploaded. |
mimeType |
The content type of the file, see https://www.iana.org/assignments/media-types/media-types.xhtml. |
byteSize |
The size of the context file in bytes. |
tokenCount |
The length of the file measured in tokens. |
quotaPercentage |
The percentage of the quota used by the file. |
selected |
If the file is selected to be used. |
usedInConversation |
Whether the file was used in the session previously (i.e. was used in a query) and is part of the conversation history, or is only uploaded and not used yet. |
originalUri |
Optional. The original location of the file. It may be a local file path, or any other URI that allows accessing the file in an external system. There are two scenarios in which this url may be empty: 1. If the file was sent as inline data (e.g. pasted from the clipboard). 2. If the original location is not available. Note that there's no guarantee that the URI will be pointing to a valid or actually existing file. For example, a file might have been uploaded to the session, and then deleted from the original source. |
originalSourceType |
Optional. The type of the original source of the file. |
uploadTime |
Output only. The time the file was uploaded (If this is a file generated by an internal process and then made available to the session, this indicates the moment it happened). Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
metadata |
Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used. |
FileSource
Original source of the file.
Enums | |
---|---|
FILE_SOURCE_UNSPECIFIED |
Default value. Unknown source. |
FILE_SOURCE_INLINE |
The data of the file was provided inline (e.g. pasted from the clipboard). |
FILE_SOURCE_LOCAL |
The file was uploaded from a local file. |
FILE_SOURCE_CLOUD_STORAGE |
The file was uploaded from Cloud Storage. |
FILE_SOURCE_CLOUD_DRIVE |
The file was uploaded from Drive. |
FILE_SOURCE_URL |
The file was retrieved from a URL (e.g. public web). |