[Feature] Add support for GPTCache (#1065)

This commit is contained in:
Deven Patel
2023-12-30 14:51:48 +05:30
committed by GitHub
parent a7e1520d08
commit 04daa1b206
10 changed files with 157 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
from typing import Optional
from embedchain.config.base_config import BaseConfig
from embedchain.helpers.json_serializable import register_deserializable
@register_deserializable
class CacheConfig(BaseConfig):
def __init__(
self,
similarity_threshold: Optional[float] = 0.5,
):
if similarity_threshold < 0 or similarity_threshold > 1:
raise ValueError(f"similarity_threshold {similarity_threshold} should be between 0 and 1")
self.similarity_threshold = similarity_threshold