@memberjunction/ai-cohere
Cohere AI provider for MemberJunction. Currently provides reranking capabilities using Cohere's Rerank API.
Supported models:
API Key: Set via environment variable: AI_VENDOR_API_KEY__COHERELLM
Usage:
import { CohereReranker } from '@memberjunction/ai-cohere';// Create instance via ClassFactoryconst reranker = ClassFactory.CreateInstance<BaseReranker>( BaseReranker, 'CohereLLM', apiKey, 'rerank-v3.5');const response = await reranker.Rerank({ query: 'What is the capital of France?', documents: [ { id: '1', text: 'Paris is the capital of France.' }, { id: '2', text: 'London is in England.' } ], topK: 5}); Copy
import { CohereReranker } from '@memberjunction/ai-cohere';// Create instance via ClassFactoryconst reranker = ClassFactory.CreateInstance<BaseReranker>( BaseReranker, 'CohereLLM', apiKey, 'rerank-v3.5');const response = await reranker.Rerank({ query: 'What is the capital of France?', documents: [ { id: '1', text: 'Paris is the capital of France.' }, { id: '2', text: 'London is in England.' } ], topK: 5});
Factory function to create a CohereReranker with default model. Convenience function for simple usage.
Optional
@memberjunction/ai-cohere
Cohere AI provider for MemberJunction. Currently provides reranking capabilities using Cohere's Rerank API.
Supported models:
API Key: Set via environment variable: AI_VENDOR_API_KEY__COHERELLM
Usage: