voyageai-python icon indicating copy to clipboard operation
voyageai-python copied to clipboard

Reranker API

Open Amiya-Lahiri-ML opened this issue 1 year ago • 1 comments

AttributeError Traceback (most recent call last) in <cell line: 3>() 1 import voyageai 2 vo = voyageai.Client(api_key=VOYAGE_API_KEY) ----> 3 reranking = vo.rerank(query, RerankerSummaryList, model="rerank-lite-1", top_k=5) 4 for r in reranking.results: 5 print(f"Document: {r.document}")

AttributeError: 'Client' object has no attribute 'rerank' how to resolve it

Amiya-Lahiri-ML avatar May 17 '24 11:05 Amiya-Lahiri-ML

Hi,

Please upgrade to the latest version of the package through pip install -U voyageai, and you should be able to use the rerank method in Client. https://github.com/voyage-ai/voyageai-python/blob/e565fb60b854e80ead526a57ea0e6eb1db9efc33/voyageai/client.py#L81.

thomas0809 avatar May 20 '24 01:05 thomas0809