diff --git a/semantic_router/splitters/consecutive_sim.py b/semantic_router/splitters/consecutive_sim.py index 2994d7ff68f78bb52567109b8ea3e0675298bee8..6bd08845e0d3a45706bc99dd0740ab1355ae3840 100644 --- a/semantic_router/splitters/consecutive_sim.py +++ b/semantic_router/splitters/consecutive_sim.py @@ -18,6 +18,7 @@ class ConsecutiveSimSplitter(BaseSplitter): score_threshold: float = 0.45, ): super().__init__(name=name, score_threshold=score_threshold, encoder=encoder) + encoder.score_threshold = score_threshold def __call__(self, docs: List[str]): # Check if there's only a single document diff --git a/semantic_router/splitters/cumulative_sim.py b/semantic_router/splitters/cumulative_sim.py index 960eeb290980688d9bee20df34891a58c8af5615..ba8f4bd31faa15d268acb729aaedb4147d9c97e0 100644 --- a/semantic_router/splitters/cumulative_sim.py +++ b/semantic_router/splitters/cumulative_sim.py @@ -18,6 +18,7 @@ class CumulativeSimSplitter(BaseSplitter): score_threshold: float = 0.45, ): super().__init__(name=name, score_threshold=score_threshold, encoder=encoder) + encoder.score_threshold = score_threshold def __call__(self, docs: List[str]): total_docs = len(docs) diff --git a/semantic_router/text.py b/semantic_router/text.py index dfa0ecf7b2d99cfec6508f5331be4e79d8fd1dea..3d56e37468283bad86c48d7fc9eea22598ea6dd8 100644 --- a/semantic_router/text.py +++ b/semantic_router/text.py @@ -50,6 +50,11 @@ class Conversation(BaseModel): def add_new_messages(self, new_messages: List[Message]): + """Adds new messages to the conversation. + + :param messages: The new messages to be added to the conversation. + :type messages: List[Message] + """ self.messages.extend(new_messages) def remove_topics(self):