MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Set custom LLM Rerank like as voyage

Open tuanlv14 opened this issue 1 year ago • 2 comments

Feature description I see embedding Configuration but I did not see any instruction to set Reranker.

Request. --> If setting ranker was not avaiable, pls add this one. Pls consider voyage, Cohere and Jina If setting ranker was avaiable, pls help me with an instructtion like as embedding Configuration.

tuanlv14 avatar Jul 16 '24 17:07 tuanlv14

Hi all, anyone can help me to config ranker in metaGPT ? Thanks.

tuanlv14 avatar Jul 17 '24 09:07 tuanlv14

Currently, Cohere is available and can be configured, but you need to install llama-index-postprocessor-colbert-rerank first.

engine = SimpleEngine.from_docs(input_files=input_files, ranker_configs=[CohereRerankConfig(api_key="YOUR_API_KEY")])

Others can also be customized, such as voyage.

from llama_index.postprocessor.voyageai_rerank import VoyageAIRerank

engine = SimpleEngine.from_docs(input_files=input_files)
engine._node_postprocessors = [VoyageAIRerank(api_key="YOUR_API_KEY")]

seehi avatar Jul 17 '24 12:07 seehi