Skip to content

ComposerOption

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

The maximum size of an attachment in bytes.

Default

100 * 1024 * 1024 (100MB)

optional models: ModelOption[];

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


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.