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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentforge_reranker_cohere-0.2.3.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentforge_reranker_cohere-0.2.3.tar.gz
Algorithm Hash digest
SHA256 05d43f1ea4e4f246bf6dcd3794824474d4ed5d6ab820874f0e026463ef9a03ed
MD5 8d995acecd855d7d8f17a5561269b8ae
BLAKE2b-256 d2a57006d7021e3ea898ab04cde4326feb60b2faf4c9e6348af2aebbe98548d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentforge_reranker_cohere-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentforge_reranker_cohere-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4fc2b223dbbfea1404762ed34c4e61fb86df223027674f75ffe7f8de2c8691ea
MD5 8c927e3ba6ed6e46d92d265b5746bd85
BLAKE2b-256 64b2e068d9413227686a25f28dceac865d5c10c85d4ee6b8a87ff6124836bc3c

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