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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9b61e36d888888f1ac72887fd90aed8d3ac0e3159ea0f814dd2c0c7a9e453482
MD5 c21c29ee23fb284eef26d7c228d832bd
BLAKE2b-256 7df4765df40e0620b2307747cc7f9b95d300af14e57abfa5be8cb15090244e16

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for agentforge_reranker_cohere-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d870631c2567ed0bbb19b417b758fe9036845e624f49e8b7516d175c0e627eec
MD5 f4c7883d070e0011464d07cfe95e92d4
BLAKE2b-256 778e07f33b207f9a8b52fec5b1893d93e135c08ab1b6079ad4adb844777ba17e

See more details on using hashes here.

Provenance

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