mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-09 14:35:50 +00:00
Make Google PaLM classes serialisable (#11121)
Similarly to Vertex classes, PaLM classes weren't marked as serialisable. Should be working fine with LangSmith. --------- Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
parent
943e4f30d8
commit
db36a0ee99
@ -248,6 +248,14 @@ class ChatGooglePalm(BaseChatModel, BaseModel):
|
|||||||
"""Number of chat completions to generate for each prompt. Note that the API may
|
"""Number of chat completions to generate for each prompt. Note that the API may
|
||||||
not return the full n completions if duplicates are generated."""
|
not 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()
|
@root_validator()
|
||||||
def validate_environment(cls, values: Dict) -> Dict:
|
def validate_environment(cls, values: Dict) -> Dict:
|
||||||
"""Validate api key, python package exists, temperature, top_p, and top_k."""
|
"""Validate api key, python package exists, temperature, top_p, and top_k."""
|
||||||
|
@ -95,6 +95,14 @@ class GooglePalm(BaseLLM, BaseModel):
|
|||||||
"""Number of chat completions to generate for each prompt. Note that the API may
|
"""Number of chat completions to generate for each prompt. Note that the API may
|
||||||
not return the full n completions if duplicates are generated."""
|
not 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()
|
@root_validator()
|
||||||
def validate_environment(cls, values: Dict) -> Dict:
|
def validate_environment(cls, values: Dict) -> Dict:
|
||||||
"""Validate api key, python package exists."""
|
"""Validate api key, python package exists."""
|
||||||
|
Loading…
Reference in New Issue
Block a user