From c25b174db5720979c6e2834fde5be97f8761a35a Mon Sep 17 00:00:00 2001 From: David Duong Date: Wed, 25 Oct 2023 12:41:33 +0200 Subject: [PATCH] Add serialisation props to Fireworks and ChatFireworks (#12255) --- libs/langchain/langchain/chat_models/fireworks.py | 8 ++++++++ libs/langchain/langchain/llms/fireworks.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/libs/langchain/langchain/chat_models/fireworks.py b/libs/langchain/langchain/chat_models/fireworks.py index 841ee8a0d84f4..0da316a96889d 100644 --- a/libs/langchain/langchain/chat_models/fireworks.py +++ b/libs/langchain/langchain/chat_models/fireworks.py @@ -90,6 +90,14 @@ class ChatFireworks(BaseChatModel): fireworks_api_key: Optional[str] = None max_retries: int = 20 + @property + def lc_secrets(self) -> Dict[str, str]: + return {"fireworks_api_key": "FIREWORKS_API_KEY"} + + @classmethod + def is_lc_serializable(cls) -> bool: + return True + @root_validator() def validate_environment(cls, values: Dict) -> Dict: """Validate that api key in environment.""" diff --git a/libs/langchain/langchain/llms/fireworks.py b/libs/langchain/langchain/llms/fireworks.py index 73f4a96aa9785..51ebb8800998e 100644 --- a/libs/langchain/langchain/llms/fireworks.py +++ b/libs/langchain/langchain/llms/fireworks.py @@ -37,6 +37,14 @@ class Fireworks(LLM): fireworks_api_key: Optional[str] = None max_retries: int = 20 + @property + def lc_secrets(self) -> Dict[str, str]: + return {"fireworks_api_key": "FIREWORKS_API_KEY"} + + @classmethod + def is_lc_serializable(cls) -> bool: + return True + @root_validator() def validate_environment(cls, values: Dict) -> Dict: """Validate that api key in environment."""