Add serialisable support for Replicate (#8525)

This commit is contained in:
David Duong 2023-08-11 20:35:21 +02:00 committed by GitHub
parent 16af5f8690
commit 6d03f8b5d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,14 @@ class Replicate(LLM):
extra = Extra.forbid
@property
def lc_secrets(self) -> Dict[str, str]:
return {"replicate_api_token": "REPLICATE_API_TOKEN"}
@property
def lc_serializable(self) -> bool:
return True
@root_validator(pre=True)
def build_extra(cls, values: Dict[str, Any]) -> Dict[str, Any]:
"""Build extra kwargs from additional params that were passed in."""