Skip to content

Commit ad61c71

Browse files
Fix Cohere response (#86)
* Fix Cohere response * Remove Adobe pdfservice from dependency kotaemon doesn't rely more pdfservice for its core functionality, and pdfservice uses very out-dated dependency that causes conflict. --------- Co-authored-by: trducng <trungduc1992@gmail.com>
1 parent 620b81d commit ad61c71

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libs/kotaemon/kotaemon/indices/rankings/cohere.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def run(self, documents: list[Document], query: str) -> list[Document]:
2929
return compressed_docs
3030

3131
_docs = [d.content for d in documents]
32-
results = cohere_client.rerank(
32+
response = cohere_client.rerank(
3333
model=self.model_name, query=query, documents=_docs, top_n=self.top_k
3434
)
35-
for r in results:
35+
for r in response.results:
3636
doc = documents[r.index]
3737
doc.metadata["relevance_score"] = r.relevance_score
3838
compressed_docs.append(doc)

libs/kotaemon/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ adv = [
6666
"unstructured[pdf]==0.13.4",
6767
"sentence_transformers==2.7.0",
6868
"elasticsearch>=8.13.0,<8.14",
69-
"pdfservices-sdk @ git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements",
7069
"beautifulsoup4>=4.12.3,<4.13",
7170
]
7271
dev = [

0 commit comments

Comments
 (0)