Skip to content

The agent engineering platform.

langchain_google_genai : Add missing _identifying_params property. (#17224)

German Martin1032faba5fe9
diff --git a/libs/partners/google-genai/langchain_google_genai/llms.py b/libs/partners/google-genai/langchain_google_genai/llms.py
index bf147410ce..d6eb16d981 100644
--- a/libs/partners/google-genai/langchain_google_genai/llms.py
+++ b/libs/partners/google-genai/langchain_google_genai/llms.py
@@ -151,6 +151,18 @@ Supported examples:
def _model_family(self) -> str:
return GoogleModelFamily(self.model)
+ @property
+ def _identifying_params(self) -> Dict[str, Any]:
+ """Get the identifying parameters."""
+ return {
+ "model": self.model,
+ "temperature": self.temperature,
+ "top_p": self.top_p,
+ "top_k": self.top_k,
+ "max_output_tokens": self.max_output_tokens,
+ "candidate_count": self.n,
+ }
+
class GoogleGenerativeAI(_BaseGoogleGenerativeAI, BaseLLM):
"""Google GenerativeAI models.