How files work in an agent loop
Gmail’s send-email tool declares its attachments field as a file input ("format": "engini/file" in the tool schema). Two things follow:
- The model never produces base64. When Engini wraps the schema for the model, file fields become plain string fields. The model picks a file by name (a reference key), not by content.
- You decide what those names resolve to. You hand
handle_tool_callsa registry of files; the SDK swaps the key the model chose for the real file and encodes it on the way out.
The recipe
EnginiValidationError.
Without an LLM
Outside an agent loop, pass aFile straight into the tool call:
Run the original
python/examples/gmail-agent/ - includes a sample attachment; drop your own files into its files/ folder:
--file): File inputs.