A utility class to create a chat session.

Constructors

Methods

Constructors

Image for: Constructors

Methods

Image for: Methods
  • Creates a new chat session.

    Parameters

    Returns Chat

    A new chat session.

    The config in the params will be used for all requests within the chat session unless overridden by a per-request config in

    const chat = ai.chats.create({
    model: 'gemini-2.0-flash'
    config: {
    temperature: 0.5,
    maxOutputTokens: 1024,
    }
    });