Skip to content

ToolCallStructuredOutput

type ToolCallStructuredOutput =
| {
providerData?: Record<string, any>;
text: string;
type: "input_text";
}
| {
detail?: string;
image?: | string
| {
id: string;
};
providerData?: Record<string, any>;
type: "input_image";
}
| {
file?: | string
| {
id: string;
}
| {
url: string;
};
filename?: string;
providerData?: Record<string, any>;
type: "input_file";
};
{
providerData?: Record<string, any>;
text: string;
type: "input_text";
}
optional providerData: Record<string, any>;

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

text: string;

A text input for example a message from a user

type: "input_text";
{
detail?: string;
image?: | string
| {
id: string;
};
providerData?: Record<string, any>;
type: "input_image";
}
optional detail: string;

Controls the level of detail requested for image understanding tasks. Future models may add new values, therefore this accepts any string.

optional image:
| string
| {
id: string;
};

The image input to the model. Could be provided inline (image), as a URL, or by reference to a previously uploaded OpenAI file.

optional providerData: Record<string, any>;

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

type: "input_image";
{
file?: | string
| {
id: string;
}
| {
url: string;
};
filename?: string;
providerData?: Record<string, any>;
type: "input_file";
}
optional file:
| string
| {
id: string;
}
| {
url: string;
};

The file input to the model. Could be raw data, a URL, or an OpenAI file ID.

optional filename: string;

Optional filename metadata when uploading file data inline.

optional providerData: Record<string, any>;

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

type: "input_file";