Skip to content

Commit ec1f6ab

Browse files
authored
fix: typo lancedb (#760)
1 parent ffe766f commit ec1f6ab

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

libs/kotaemon/kotaemon/rerankings/cohere.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import os
4+
45
from decouple import config
56

67
from kotaemon.base import Document, Param
@@ -25,7 +26,9 @@ class CohereReranking(BaseReranking):
2526
required=True,
2627
)
2728
base_url: str = Param(
28-
None, help="Rerank API base url. Default is https://api.cohere.com", required=False
29+
None,
30+
help="Rerank API base url. Default is https://api.cohere.com",
31+
required=False,
2932
)
3033

3134
def run(self, documents: list[Document], query: str) -> list[Document]:
@@ -42,7 +45,9 @@ def run(self, documents: list[Document], query: str) -> list[Document]:
4245
print("Cohere API key not found. Skipping rerankings.")
4346
return documents
4447

45-
cohere_client = cohere.Client(self.cohere_api_key, base_url=self.base_url or os.getenv("CO_API_URL"))
48+
cohere_client = cohere.Client(
49+
self.cohere_api_key, base_url=self.base_url or os.getenv("CO_API_URL")
50+
)
4651
compressed_docs: list[Document] = []
4752

4853
if not documents: # to avoid empty api call

libs/kotaemon/kotaemon/storages/docstores/lancedb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ def get(self, ids: Union[List[str], str]) -> List[Document]:
114114
except (ValueError, FileNotFoundError):
115115
docs = []
116116

117-
# return the documents using the order of original ids (which were ordered by score)
117+
# return the documents using the order of original
118+
# ids (which were ordered by score)
118119
doc_dict = {
119120
doc["id"]: Document(
120-
d_=doc["id"],
121+
id_=doc["id"],
121122
text=doc["text"] if doc["text"] else "<empty>",
122123
metadata=json.loads(doc["attributes"]),
123124
)

0 commit comments

Comments
 (0)