Skip to content

ComposerOption

type ComposerOption = {
attachments?: {
accept?: Record<string, string[]>;
enabled: boolean;
maxCount?: number;
maxSize?: number | Record<string, number>;
};
dictation?: {
enabled: boolean;
};
models?: ModelOption[];
placeholder?: string;
tools?: ToolOption[];
};
optional attachments: {
accept?: Record<string, string[]>;
enabled: boolean;
maxCount?: number;
maxSize?: number | Record<string, number>;
};

Configuration for file attachments in the composer. If not provided, attachments will be disabled.

Name Type Description

accept?

Record<string, string[]>

The MIME types and extensions that are accepted for file uploads, similar to showOpenFilePicker. When not specified, all MIME types and extensions are accepted.

enabled

boolean

Whether file attachments are enabled in the composer.

Default

false;

maxCount?

number

The maximum number of attachments that can be sent in a single message.

Default

10;

maxSize?

number | Record<string, number>

The maximum size of an attachment in bytes. Provide a number to apply the same limit to every attachment, or a record of MIME type patterns to per-type limits (for example, { "image/*": 10 * 1024 * 1024 }). Add a "*" or "" entry to set the fallback limit for files that do not match another MIME type pattern; otherwise they use the default limit.

Default

100 * 1024 * 1024 (100MB)

optional dictation: {
enabled: boolean;
};

Dictation (voice input) settings for the composer. Disabled when not provided.

Name Type Description

enabled

boolean

Enable dictation.

Default

false;

optional models: ModelOption[];

A list of models that users can choose from before sending a message.

ModelOption


optional placeholder: string;

The placeholder text to show in the composer input.

'Message the AI';

optional tools: ToolOption[];

When provided a list of tool options, the user will be able to select a tool from a menu in the composer.

ToolOption