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.3.1.tar.gz (9.5 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.3.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5977dfd650bd395efe0496ad514cb446512f070b8fcb04a3881add8e8d18960d
MD5 22de50206ffc7d26c0f712b5bdd71561
BLAKE2b-256 a6aeb6ba01961f7ba49d95c5e4b9d3176f2ba5f0bda6d500a39e9b7cabfee374

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_reranker_cohere-0.3.1.tar.gz:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d84adf53a6198647ac13ff23a8e6f91344cc6d4cf42f5f32a5d5f27cca3ee6c
MD5 4cdfce3e11820a27845c5a95c2231c23
BLAKE2b-256 44a408204d30b6806f565fa20236ea15acd9e3bcca312b01b67d6d31154a318d

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_reranker_cohere-0.3.1-py3-none-any.whl:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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