Skip to content

Commit

Permalink
Add serialisation props to Fireworks and ChatFireworks (langchain-ai#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd authored Oct 25, 2023
1 parent fd5f549 commit c25b174
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libs/langchain/langchain/chat_models/fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
8 changes: 8 additions & 0 deletions libs/langchain/langchain/llms/fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit c25b174

Please sign in to comment.