企业级 RAG 优化大模型,Embeddings 和 Rerank 业界最佳。
注册 dashboard.cohere.com 获取 API Keypip install cohereimport cohere; co = cohere.ClientV2(api_key='...')response = co.chat(model='command-r-plus', messages=[{'role':'user','content':'Hello'}])Embed API: co.embed(texts=['text1','text2'], model='embed-multilingual-v3.0')pip install langchain-coherefrom langchain_cohere import CohereEmbeddings, CohereRerankembeddings = CohereEmbeddings(model='embed-multilingual-v3.0')rerank = CohereRerank(model='rerank-multilingual-v3.0')配合向量数据库构建 RAG 搜索系统