Skip to content

ToolCallOutputContent

type ToolCallOutputContent =
| {
providerData?: Record<string, any>;
text: string;
type: "text";
}
| {
detail?: "low" | "high" | "auto" | string & object;
image?: | string
| {
data: string | Uint8Array<ArrayBuffer>;
mediaType?: string;
}
| {
url: string;
}
| {
fileId: string;
};
providerData?: Record<string, any>;
type: "image";
}
| {
file: | string
| {
data: string | Uint8Array<ArrayBuffer>;
filename: string;
mediaType: string;
}
| {
filename?: string;
url: string;
}
| {
filename?: string;
id: string;
};
providerData?: Record<string, any>;
type: "file";
};
{
providerData?: Record<string, any>;
text: string;
type: "text";
}
optional providerData: Record<string, any>;

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

text: string;

The text output from the model.

type: "text";
{
detail?: "low" | "high" | "auto" | string & object;
image?: | string
| {
data: string | Uint8Array<ArrayBuffer>;
mediaType?: string;
}
| {
url: string;
}
| {
fileId: string;
};
providerData?: Record<string, any>;
type: "image";
}
optional detail: "low" | "high" | "auto" | string & object;

Controls the requested level of detail for vision models. Use a string to avoid constraining future model capabilities.

optional image:
| string
| {
data: string | Uint8Array<ArrayBuffer>;
mediaType?: string;
}
| {
url: string;
}
| {
fileId: string;
};

Inline image content or a reference to an uploaded file. Accepts a URL/data URL string or an object describing the data/url/fileId source.

optional providerData: Record<string, any>;

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

type: "image";
{
file: | string
| {
data: string | Uint8Array<ArrayBuffer>;
filename: string;
mediaType: string;
}
| {
filename?: string;
url: string;
}
| {
filename?: string;
id: string;
};
providerData?: Record<string, any>;
type: "file";
}
file:
| string
| {
data: string | Uint8Array<ArrayBuffer>;
filename: string;
mediaType: string;
}
| {
filename?: string;
url: string;
}
| {
filename?: string;
id: string;
} = FileReferenceSchema;

File output reference. Provide either a string (data URL / base64), a data object (requires mediaType + filename), or an object pointing to an uploaded file/URL.

optional providerData: Record<string, any>;

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

type: "file";