Grounding with File Inputs

Ground generative AI prompt templates with files so the AI model can use documents, spreadsheets, presentations, images, and email text in the resolved prompt.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations

With file inputs, you ground a prompt template with richer context than record fields alone. Add PDFs, images, Microsoft Office files, text files, CSV files, and email files so the AI model can process contracts, product sheets, presentations, and text at run time.

Note
Note Not every AI model accepts file inputs. Before you add files, review Details for the selected AI model. Unsupported files are excluded from the request. Excluded files are listed in the Resolution panel after processing.
How the file is sent File Types
Sent as a file (no conversion) .pdf, .jpg, .jpeg, .png
Converted to PDF at run time, then sent as a file

.xls, .xlsx, .xltx

.doc, .docx

.ppt, .pptx

.txt

.csv (converted to text first, then to PDF)

Added as text in the prompt (not sent as a file) .eml: The email body is extracted as plain text. Attachments and HTML formatting aren’t included.

After you select a file, the file and its metadata are associated with the prompt template. Files are stored as Salesforce Files. To use file metadata in the prompt template, click Resources and insert a merge field.

How Conversion and Exclusions Work

Conversion runs at run time, not when you upload the file in Preview. Each file converts one at a time. If conversion fails, then that file is excluded and a warning appears.

After processing, the Resolution panel can show:

  • PDF Conversion Completed: The file was converted to PDF so the AI model can process it.
  • Email Text Extraction Completed: Email text was added to the prompt. Attachments and formatting weren’t included.

Warning messages appear when conversion fails, a file exceeds a limit, conversion times out, or the AI model doesn’t support the file type.

Converted files appear in the resolved prompt with a PDF icon. Open the icon to view the original file.

Open Details for the selected AI model to see file-type limits and how each type is sent.

Einstein Trust Layer

At run time, JPEG, PNG, and PDF files are sent as files. Files that convert to PDF are also sent as PDF files. The Einstein Trust Layer doesn’t apply protections to the contents of those files. To apply protections in the Einstein Trust Layer to a PDF, extract the PDF content as text into the prompt template, and then send the prompt to the AI model.

Prompt Builder adds only extracted plain text from .eml files. The Einstein Trust Layer applies data masking to that extracted text.