Skip to content

Commit 41ee145

Browse files
committed
Update the timeout; update the params in the db method;
1 parent 1415f07 commit 41ee145

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

chatbotcore/custom_embeddings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __post_init__(self):
2727
if not (self.url and self.model_name and self.base_url):
2828
raise Exception("Url or base_url or both are not provided.")
2929

30-
def embed_query(self, text: str, timeout: int = 240) -> List[float]:
30+
def embed_query(self, text: str, timeout: int = 45) -> List[float]:
3131
"""
3232
Sends the request to Embedding module to
3333
embed the query to the vector representation
@@ -39,7 +39,7 @@ def embed_query(self, text: str, timeout: int = 240) -> List[float]:
3939
raise Exception(e)
4040
return response.json()
4141

42-
def embed_documents(self, texts: List[str], timeout: int = 30) -> List[List[float]]:
42+
def embed_documents(self, texts: List[str], timeout: int = 45) -> List[List[float]]:
4343
"""
4444
Sends the request to Embedding module to
4545
embed multiple queries to the vector representation

chatbotcore/database.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ def data_search(
9898
# Note the results shall contain score key; sort the results using score key and get top 5 among them.
9999
return results
100100

101-
def delete_data_by_src_uuid(self, collection_name: str, key: str, value: Any) -> bool:
101+
def delete_data_by_src_uuid(self, key: str, value: Any) -> bool:
102102
"""
103103
Delete data by source uuid
104104
Note that the document source key should be doc_uuid
105105
"""
106106
points_selector = FilterSelector(filter=Filter(must=[FieldCondition(key=key, match=MatchValue(value=value))]))
107-
result = self.db_client.delete(collection_name=collection_name, points_selector=points_selector)
107+
result = self.db_client.delete(collection_name=self.collection_name, points_selector=points_selector)
108108

109109
return result.status == q_models.UpdateStatus.COMPLETED
110110

chatbotcore/doc_loaders.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def create_document_chunks(self):
7878
Creates multiple documents from the input texts
7979
"""
8080
documents = [Document(page_content=self.text)]
81+
# Note that the token based splitting can be used as shown below.
8182
# doc_chunks = self._get_split_documents_using_token_based(documents=documents)
8283
doc_chunks = self._get_split_documents_with_recursive_char(documents=documents)
8384
contextualized_chunks = self.context_retrieval.generate_contextualized_chunks(document=self.text, chunks=doc_chunks)

0 commit comments

Comments
 (0)