diff --git a/semantic_router/splitters/cumulative_sim.py b/semantic_router/splitters/cumulative_sim.py index b45ebc37d498513f58d48d6e5153034888975fce..f832ca7542ebcefa2967fdbf05fe5d8c411c940b 100644 --- a/semantic_router/splitters/cumulative_sim.py +++ b/semantic_router/splitters/cumulative_sim.py @@ -3,10 +3,6 @@ from semantic_router.splitters.base import BaseSplitter import numpy as np from semantic_router.schema import DocumentSplit from semantic_router.encoders import BaseEncoder -# DEBUGGING: Start. -import time -# DEBUGGING: End. - class CumulativeSimSplitter(BaseSplitter): @@ -36,7 +32,6 @@ class CumulativeSimSplitter(BaseSplitter): if idx + 1 < total_docs: curr_split_docs = "\n".join(docs[curr_split_start_idx : idx + 1]) next_doc = docs[idx + 1] - time.sleep(30) curr_split_docs_embed = self.encoder([curr_split_docs])[0] next_doc_embed = self.encoder([next_doc])[0] diff --git a/semantic_router/text.py b/semantic_router/text.py index 0847b7398c0e72b3ebb824bdda11e549ba96baad..002600baf6859f37518fde65cbbc1a9d24b86603 100644 --- a/semantic_router/text.py +++ b/semantic_router/text.py @@ -42,28 +42,9 @@ class Conversation(BaseModel): if self.splitter is None: raise ValueError("Splitter is not configured. Please call configure_splitter first.") new_topics = [] - # DEBUGGING: Start. - print('#'*50) - print('self.topics') - print(self.topics) - print('#'*50) - # DEBUGGING: End. - # DEBUGGING: Start. - print('#'*50) - print('self.messages') - print(self.messages) - print('#'*50) - # DEBUGGING: End. # Get the messages that haven't been clustered into topics yet unclustered_messages = self.messages[len(self.topics):] - - # DEBUGGING: Start. - print('#'*50) - print('unclustered_messages') - print(unclustered_messages) - print('#'*50) - # DEBUGGING: End. # If there are no unclustered messages, return early if not unclustered_messages: @@ -81,30 +62,14 @@ class Conversation(BaseModel): # Add the unclustered messages to the docs docs.extend([f"{m.role}: {m.content}" for m in unclustered_messages]) - - # DEBUGGING: Start. - print('#'*50) - print('docs') - print(docs) - print('#'*50) - # DEBUGGING: End. # Use the splitter to split the documents new_topics = self.splitter(docs) - # DEBUGGING: Start. - print('#'*50) - print('new_topics') - print(new_topics) - print('#'*50) - # DEBUGGING: End. - - # Ensure there are new topics before proceeding if not new_topics: return self.topics, [] - # Check if there are any previously assigned topics if self.topics and new_topics: # Check if the first new topic includes the last message that was assigned a topic in the previous splitting.