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 ¶
var DriveScopes = []string{driveapi.DriveScope}
Drive scopes needed by bridge functions.
var GmailScopes = []string{gmailapi.MailGoogleComScope}
Gmail scopes needed by bridge functions.
Functions ¶
This section is empty.
Types ¶
type GetDriveFileMetadataParams ¶
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 ¶
ReadDriveFileParams holds the parameters for ReadDriveFile.
type ReadDriveFileResult ¶
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.