Class ChatSession (1.75.0)

ChatSession(
    model: vertexai.generative_models._generative_models._GenerativeModel,
    *,
    history: typing.Optional[
        typing.List[vertexai.generative_models._generative_models.Content]
    ] = None,
    response_validation: bool = True
)

Chat session holds the chat history.

Methods

send_message

Generates content.

Exceptions
Type Description
ResponseValidationError If the response was blocked or is incomplete.

send_message_async

Generates content asynchronously.

Exceptions
Type Description
ResponseValidationError If the response was blocked or is incomplete.