Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
Chat session to make multi-turn send message request. sendMessage method makes async call to get response of a chat message. sendMessageStream method makes async call to stream response of a chat message.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class ChatSession (0.3.1)\n\nChat session to make multi-turn send message request. `sendMessage` method makes async call to get response of a chat message. `sendMessageStream` method makes async call to stream response of a chat message.\n\nPackage\n-------\n\n[@google-cloud/vertexai](../overview.html)\n\nConstructors\n------------\n\n### (constructor)(request)\n\n constructor(request: StartChatSessionRequest);\n\nConstructs a new instance of the `ChatSession` class\n\nProperties\n----------\n\n### generation_config\n\n generation_config?: GenerationConfig;\n\n### history\n\n get history(): Content[];\n\n### safety_settings\n\n safety_settings?: SafetySetting[];\n\n### tools\n\n tools?: Tool[];\n\nMethods\n-------\n\n### appendHistory(streamGenerateContentResultPromise, newContent)\n\n appendHistory(streamGenerateContentResultPromise: Promise\u003cStreamGenerateContentResult\u003e, newContent: Content[]): Promise\u003cvoid\u003e;\n\n### sendMessage(request)\n\n sendMessage(request: string | Array\u003cstring | Part\u003e): Promise\u003cGenerateContentResult\u003e;\n\nMake an sync call to send message.\n\n### sendMessageStream(request)\n\n sendMessageStream(request: string | Array\u003cstring | Part\u003e): Promise\u003cStreamGenerateContentResult\u003e;\n\nMake an async call to stream send message. Response will be returned in stream."]]