Interface CreateChatParameters

Parameters for initializing a new chat session.

These parameters are used when creating a chat session with the chats.create() method.

interface CreateChatParameters {
    config?: GenerateContentConfig;
    history?: Content[];
    model: string;
}

Properties

Config for the entire chat session.

This config applies to all requests within the session unless overridden by a per-request config in SendMessageParameters.

history?: Content[]

The initial conversation history for the chat session.

This allows you to start the chat with a pre-existing history. The history must be a list of Content alternating between 'user' and 'model' roles. It should start with a 'user' message.

model: string

The name of the model to use for the chat session.

For example: 'gemini-2.0-flash', 'gemini-1.5-pro', etc. See gemini API docs to find the available models.

MMNEPVFCICPMFPCPTTAAATR