Skip to content

cohere: capture rerank relevant_spans #1004

Closed

Description

Sub-issue of #1001 (follow-ups from the 2026-10-26 dependency update, #998).

  • v2 rerank gained a relevant_spans request option (Rerank v5+ models only), and each result can carry relevant_spans: [{start, end, score}].
  • We drop both: the option isn't in _RERANK_METADATA_KEYS (integrations/cohere/tracing.py:81), and _rerank_output (:337) keeps only index and relevance_score.
  • Fix: add the key to the metadata list and include relevant_spans per result when present. Needs one re-recorded rerank test with a v5 model.

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions