class_docstr: A chat response from the model.
  
  * Use `response.last` (settable) for easy access to the text of the last response.
      (`messages[-1]['content']`)
  * Use `response.messages` to access the message history (including `.last`).
  * Use `response.candidates` to access all the responses generated by the model.
  
  Other attributes are just saved from the arguments to `genai.chat`, so you
  can easily continue a conversation:
  
  ```
  import google.generativeai as genai
  
  genai.configure(api_key=os.environ['GOOGLE_API_KEY'])
  
  response = genai.chat(messages=["Hello."])
  print(response.last) #  'Hello! What can I help you with?'
  response.reply("Can you tell me a joke?")
  ```
  
  See `genai.chat` for more details.
  
  Attributes:
      candidates: A list of candidate responses from the model.
  
          The top candidate is appended to the `messages` field.
  
          This list will contain a *maximum* of `candidate_count` candidates.
          It may contain fewer (duplicates are dropped), it will contain at least one.
  
          Note: The `temperature` field affects the variability of the responses. Low
          temperatures will return few candidates. Setting `temperature=0` is deterministic,
          so it will only ever return one candidate.
      filters: This indicates which `types.SafetyCategory`(s) blocked a
         candidate from this response, the lowest `types.HarmProbability`
         that triggered a block, and the `types.HarmThreshold` setting for that category.
         This indicates the smallest change to the `types.SafetySettings` that would be
         necessary to unblock at least 1 response.
  
         The blocking is configured by the `types.SafetySettings` in the request (or the
         default `types.SafetySettings` of the API).
      messages: Contains all the `messages` that were passed when the model was called,
          plus the top `candidate` message.
      model: The model name.
      context: Text that should be provided to the model first, to ground the response.
      examples: Examples of what the model should generate.
      messages: A snapshot of the conversation history sorted chronologically.
      temperature: Controls the randomness of the output. Must be positive.
      candidate_count: The **maximum** number of generated response messages to return.
      top_k: The maximum number of tokens to consider when sampling.
      top_p: The maximum cumulative probability of tokens to consider when sampling.
code: def to_dict(self) -> Dict[str, Any]:
      result = {
          "model": self.model,
          "context": self.context,
          "examples": self.examples,
          "messages": self.messages,
          "temperature": self.temperature,
          "candidate_count": self.candidate_count,
          "top_p": self.top_p,
          "top_k": self.top_k,
          "candidates": self.candidates,
      }
      return result
  
imports: import abc
  import dataclasses
  from typing import Any, Dict, Union, Iterable, Optional, Tuple, List
  from typing_extensions import TypedDict
  import google.ai.generativelanguage
  from google.generativeai import string_utils
  from google.generativeai.types import safety_types
  from google.generativeai.types import citation_types
label_desc: Use image node_id 2 for calling the ChatResponse obj's underlying member method code with example usage: obj.to_dict() and returns: result