geekan / MetaGPT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
https://deepwisdom.ai/
MIT License
45.06k stars 5.35k forks source link

Set custom LLM Rerank like as voyage #1401

Closed tuanlv14 closed 1 month ago

tuanlv14 commented 3 months ago

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 commented 3 months ago

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

seehi commented 3 months ago

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")]