Skip to main content

Cohere managed-API reranker for AgentForge

Project description

agentforge-reranker-cohere

Cohere managed-API reranker for the AgentForge framework.

Implements the Reranker ABC from agentforge-core. Registers as agentforge.rerankers:cohere.

Installation

pip install agentforge-reranker-cohere[cohere]

Usage

from agentforge_reranker_cohere import CohereReranker

reranker = CohereReranker.from_config(
    api_key="...",
    model="rerank-english-v3.0",
)

Or via agentforge.yaml:

retrieval:
  reranker:
    name: cohere
    config:
      api_key: ${COHERE_API_KEY}
      model: rerank-english-v3.0

The reranker forwards (query, candidate_text) pairs to Cohere's Rerank API, normalises the returned scores to [0, 1] (Cohere already does this — the clamp is defensive), sorts descending, and truncates to top_k.

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentforge_reranker_cohere-0.2.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentforge_reranker_cohere-0.2.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file agentforge_reranker_cohere-0.2.4.tar.gz.

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.2.4.tar.gz
Algorithm Hash digest
SHA256 fb9537f1053659a3e1a0dee05b64bf4eda0531b43a751723e8bea436c858fee6
MD5 65ff28b95b0a9dd186b2ffb957c2a780
BLAKE2b-256 5025b10f6545a52e50973e52d46421b17b91f6cff1351d99c65599fc16526b71

See more details on using hashes here.

File details

Details for the file agentforge_reranker_cohere-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 56bf189391eaaff262380b6c188916547d9252095bc6822ca1cafb631325d2bb
MD5 860431968496c0608313ae2900788dc3
BLAKE2b-256 75c0e297149ef93a7ece39137418855e4155a00046ac0daf8173a2eaa70a5ab0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page