"""Get the identifying parameters."""
        return {
            "model": self.model,
            "temperature": self.temperature,
            "top_k": self.top_k,
            "n": self.n,
        }
    @property
    def _generation_method(self) -> Callable:
        return self._generative_model.generate_content
    @property
    def _async_generation_method(self) -> Callable:
        return self._generative_model.generate_content_async
    def _prepare_params(
        self, messages: Sequence[BaseMessage], stop: Optional[List[str]], **kwargs: Any
    ) -> Dict[str, Any]:
        contents = _messages_to_genai_contents(messages)
        gen_config = {
            k: v
            for k, v in {
                "candidate_count": self.n,
                "temperature": self.temperature,
                "stop_sequences": stop,
                "max_output_tokens": self.max_output_tokens,
                "top_k": self.top_k,
                "top_p": self.top_p,
            }.items()
            if v is not None
        }
        if "generation_config" in kwargs:
            gen_config = {**gen_config, **kwargs.pop("generation_config")}
        params = {"generation_config": gen_config, "contents": contents, **kwargs}
        return params
    def _generate(
        self,
        messages: List[BaseMessage],
        stop: Optional[List[str]] = None,
        run_manager: Optional[CallbackManagerForLLMRun] = None,
        **kwargs: Any,
    ) -> ChatResult:
        params = self._prepare_params(messages, stop, **kwargs)
        response: genai.types.GenerateContentResponse = _chat_with_retry(
            **params,
            generation_method=self._generation_method,
        )