bridge

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package bridge provides cross-service functions that transfer data between Google APIs server-side, avoiding the need to round-trip file content through the LLM's context window.

Index

Constants

This section is empty.

Variables

View Source
var DriveScopes = []string{driveapi.DriveScope}

Drive scopes needed by bridge functions.

Gmail scopes needed by bridge functions.

Functions

This section is empty.

Types

type GetDriveFileMetadataParams

type GetDriveFileMetadataParams struct {
	DriveAccount string
	FileID       string
}

GetDriveFileMetadataParams holds the parameters for GetDriveFileMetadata.

type GetDriveFileMetadataResult

type GetDriveFileMetadataResult struct {
	FileID      string
	FileName    string
	MIMEType    string
	WebViewLink string
}

GetDriveFileMetadataResult holds the result of GetDriveFileMetadata.

func GetDriveFileMetadata

func GetDriveFileMetadata(ctx context.Context, mgr *auth.Manager, params GetDriveFileMetadataParams) (*GetDriveFileMetadataResult, error)

GetDriveFileMetadata returns metadata for a Drive file without downloading its content. This is used for Calendar event attachments where only a reference (fileUrl, title, mimeType) is needed, not the actual file bytes.

type ReadDriveFileParams

type ReadDriveFileParams struct {
	DriveAccount string
	FileID       string
}

ReadDriveFileParams holds the parameters for ReadDriveFile.

type ReadDriveFileResult

type ReadDriveFileResult struct {
	Data     []byte
	FileName string
	MIMEType string
}

ReadDriveFileResult holds the result of ReadDriveFile.

func ReadDriveFile

func ReadDriveFile(ctx context.Context, mgr *auth.Manager, params ReadDriveFileParams) (*ReadDriveFileResult, error)

ReadDriveFile downloads a file from Google Drive and returns its raw bytes. This is used by the attach_drive_file tool to attach Drive files to emails without the data transiting through the LLM context window.

type SaveAttachmentToDriveParams

type SaveAttachmentToDriveParams struct {
	GmailAccount string
	MessageID    string
	AttachmentID string
	DriveAccount string
	FileName     string // If empty, must be provided by caller.
	FolderID     string // Optional destination folder.
}

SaveAttachmentToDriveParams holds the parameters for SaveAttachmentToDrive.

type SaveAttachmentToDriveResult

type SaveAttachmentToDriveResult struct {
	FileID      string
	FileName    string
	MIMEType    string
	Size        int64
	WebViewLink string
}

SaveAttachmentToDriveResult holds the result of SaveAttachmentToDrive.

func SaveAttachmentToDrive

func SaveAttachmentToDrive(ctx context.Context, mgr *auth.Manager, params SaveAttachmentToDriveParams) (*SaveAttachmentToDriveResult, error)

SaveAttachmentToDrive downloads a Gmail attachment and uploads it directly to Google Drive without the data ever entering the LLM context window.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL