Skip to main content

Module files

Module files 

Source
Expand description

Typed file outputs from agentic runs.

Structs§

File
A file produced by an agentic run.
FileSource
Where a file was produced.
FileStore
RequestedFile
A file the runtime asks the model to produce. Surfaces as File (or FileContent::Error if missing).

Enums§

FileContent
File body. Serialized untagged so the wire shape is flat.

Constants§

DEFAULT_FILE_TTL
Per-entry TTL. Matches the agentic session default.
MODEL_INLINE_BYTES
Max text bytes shown to the model inline. Above this it gets a preview + id and calls read_file.
READ_FILE_MAX_SLICE_CHARS
Per-call cap for read_file. Larger requests get truncated.
WIRE_EMBED_LIMIT_BYTES
Max body size embedded in responses. Above this the file ships reference-only; clients fetch via GET /v1/files/{id}.

Functions§

compose_tool_response_with_files
Append a metadata-only Files: summary. Bodies are never inlined; the model fetches via read_file(id).
format_from_name
Lowercase extension without the leading dot, or None if there’s no extension.
is_text_mime
True for mime types we can ship as utf-8 text.
merge_required_outputs_into_args
Merge required files into the tool call’s outputs arg so the executor reads them even if the model omitted them.
mime_for_format
Mime type for a format string. Falls back to application/octet-stream.
required_files_tool_addendum
Text appended to the code-execution tool’s description so the model sees the required-files contract. None if no required files.
tool_file_to_file
Convert a ToolFile to a File with full body. Elision happens later via File::elide_for_wire.