Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cohere[minor]: Add cohere rerank #4380

Merged
merged 9 commits into from
Feb 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: lint files
  • Loading branch information
bracesproul committed Feb 13, 2024
commit a9e6e5cbdf27dd01458d63bfd0f8e6a97e86b005
6 changes: 3 additions & 3 deletions libs/langchain-cohere/src/rerank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export class CohereRerank {

/**
* Returns an ordered list of documents ordered by their relevance to the provided query.
*
*
* @param {Array<DocumentInterface | string | Record<string, string>>} documents A list of documents as strings, DocumentInterfaces or objects with a `pageContent` key.
* @param {string} query The query to use for reranking the documents.
* @param options
* @param options
* @param {string} options.model The name of the model to use.
* @param {number} options.topN How many documents to return.
* @param {number} options.maxChunksPerDoc The maximum number of chunks per document.
*
*
* @returns {Promise<Array<{ index: number; relevanceScore: number }>>} An ordered list of documents with relevance scores.
*/
async rerank(
Expand Down
Loading