The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Make Google PaLM classes serialisable (#11121)
David Duongdb36a0ee99c0
diff --git a/libs/langchain/langchain/chat_models/google_palm.py b/libs/langchain/langchain/chat_models/google_palm.pyindex cc7c288f89..5b8a62edcd 100644--- a/libs/langchain/langchain/chat_models/google_palm.py+++ b/libs/langchain/langchain/chat_models/google_palm.py@@ -248,6 +248,14 @@ class ChatGooglePalm(BaseChatModel, BaseModel):"""Number of chat completions to generate for each prompt. Note that the API maynot return the full n completions if duplicates are generated."""+ @property+ def lc_secrets(self) -> Dict[str, str]:+ return {"google_api_key": "GOOGLE_API_KEY"}++ @classmethod+ def is_lc_serializable(self) -> bool:+ return True+@root_validator()def validate_environment(cls, values: Dict) -> Dict:"""Validate api key, python package exists, temperature, top_p, and top_k."""diff --git a/libs/langchain/langchain/llms/google_palm.py b/libs/langchain/langchain/llms/google_palm.pyindex 1a0a409979..b15f383d1a 100644--- a/libs/langchain/langchain/llms/google_palm.py+++ b/libs/langchain/langchain/llms/google_palm.py@@ -95,6 +95,14 @@ class GooglePalm(BaseLLM, BaseModel):"""Number of chat completions to generate for each prompt. Note that the API maynot return the full n completions if duplicates are generated."""+ @property+ def lc_secrets(self) -> Dict[str, str]:+ return {"google_api_key": "GOOGLE_API_KEY"}++ @classmethod+ def is_lc_serializable(self) -> bool:+ return True+@root_validator()def validate_environment(cls, values: Dict) -> Dict:"""Validate api key, python package exists."""