Class CodeChatSession (1.26.1)

CodeChatSession(
    model: vertexai.language_models._language_models.CodeChatModel,
    max_output_tokens: int = 128,
    temperature: float = 0.5,
)

CodeChatSession represents a chat session with code chat language model.

Within a code chat session, the model keeps context and remembers the previous converstion.

Inheritance

builtins.object > vertexai.language_models._language_models._ChatSessionBase > CodeChatSession

Properties

message_history

List of previous messages.

Methods

send_message

send_message(
    message: str,
    *,
    max_output_tokens: Optional[int] = None,
    temperature: Optional[float] = None
)

Sends message to the code chat model and gets a response.