Skip to content

user

function user(input, options?): object;

Creates a user message entry

Parameter Type Description

input

| string | ( | { 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"; } | { audio: | string | { id: string; }; format?: string | null; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; })[]

The input message from the user.

options?

Record<string, any>

Any additional options that will be directly passed to the model.

object

A message entry.

content:
| string
| (
| {
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";
}
| {
audio: | string
| {
id: string;
};
format?: string | null;
providerData?: Record<string, any>;
transcript?: string | null;
type: "audio";
})[];
optional id: string;
optional providerData: Record<string, any>;
role: "user";
optional type: "message";