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.4.0.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.4.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e5cd835431237a8582c5111e50ca2defed94025c59675a0dcca4168187c33a99
MD5 388d1f893d4cf00450d900005818aca2
BLAKE2b-256 c07a57520457a529d4e6675635670c128213750023089daa471b7e0f5c7066ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_reranker_cohere-0.4.0.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.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abfcd59d3db8200341924e086b5eb88333d5e78b2197a758027a212961461155
MD5 e0c3496b22e22cbceb642d20426b61ca
BLAKE2b-256 67acf6a9899d5b94bc43c4c769b17db7fb19e4036c8b85161ba42a258b678dd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_reranker_cohere-0.4.0-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