Skip to content

v2: Reranking function interface and providers #107

@oss-amikos

Description

@oss-amikos

Context

The Go client has a RerankingFunction interface with multiple provider implementations. The Java client has no reranking support at all.

Missing API

Interface

public interface RerankingFunction {
    String id();
    List<RankedResult> rerank(String query, List<String> documents);
    QueryResult rerankResults(List<String> queryTexts, QueryResult results);
}

public final class RankedResult {
    private final int index;
    private final double score;
    private final String document;
}

Providers

Provider Description
Cohere Cohere Reranker API
Jina Jina AI Reranker
HuggingFace HuggingFace HFEI Server Reranker
Together Together AI Reranker

Reference

  • Go client: RerankingFunction interface
  • Go packages: rerankings/cohere, rerankings/jina, rerankings/hf, rerankings/together

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv2v2 API support

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions