Files
RequestedFile
Section titled “RequestedFile”A required output file declared on a request. The runtime tells the
model about declared files; if produced by a tool, they surface in
ChatCompletionResponse.files. If missing, an error placeholder is
surfaced instead.
| Field | Type |
|---|---|
name | str |
format | str | None |
description | str | None |
RequestedFile.__init__
Section titled “RequestedFile.__init__”__init__( name: str, format: str | None = None, description: str | None = None,) -> NoneInputFile
Section titled “InputFile”User-provided input file attached to a chat request.
Text-like files are previewed in prompt context and can be paginated by the built-in file tools when the agentic runtime is active. Binary files are stored and mounted into shell/code workdirs, but are metadata-only in prompt context.
| Field | Type |
|---|---|
id | str |
name | str |
mime_type | str | None |
bytes | int |
InputFile.__init__
Section titled “InputFile.__init__”__init__(name: str, data: bytes, mime_type: str | None = None) -> NoneInputFile.from_text
Section titled “InputFile.from_text”from_text( name: str, text: str, mime_type: str = 'text/plain',) -> 'InputFile'InputFile.from_path
Section titled “InputFile.from_path”from_path( path: str, mime_type: str | None = None, name: str | None = None,) -> 'InputFile'FileSource
Section titled “FileSource”Where a file was produced.
| Field | Type |
|---|---|
tool | str |
round | int |
turn | int |
First-class output from an agentic run.
Files exist independently of the transcript. The body is inline for
small files (text for text content, data_base64 for binary). Large
files have a server-side url and text/data_base64 will be None -
use is_truncated() to detect.
| Field | Type |
|---|---|
id | str |
name | str |
format | str | None |
mime_type | str | None |
bytes | int |
source | FileSource |
text | str | None |
data_base64 | str | None |
preview | str | None |
File.is_text
Section titled “File.is_text”is_text() -> boolFile.is_binary
Section titled “File.is_binary”is_binary() -> boolFile.is_image
Section titled “File.is_image”is_image() -> boolFile.is_video
Section titled “File.is_video”is_video() -> boolFile.is_error
Section titled “File.is_error”is_error() -> boolFile.is_truncated
Section titled “File.is_truncated”is_truncated() -> boolFile.save
Section titled “File.save”save(path: str) -> NoneGenerated from mistralrs-pyo3/mistralrs.pyi.