getsentry / getsentry/sentry-python

feat(cohere): Instrument `rerank` method

Aberta
#5,842 1 comentário 0 reações 0 responsáveis Ver no GitHub
Improvement Python Spans
Linguagem predominante
Python
Estrelas
2.2k
Forks
669
Merge médio
1d 40min
PRs com merge (30d)
212

Descrição

The Cohere SDK's `rerank` method (ranks documents by relevance to a query) is not instrumented. This is a significant AI operation with token costs that should be tracked.

Needs a new span operation — no existing `gen_ai.*` OP constant covers reranking.

**Acceptance criteria:**

* `rerank` calls emit spans with model, token usage, and input/output data
* Follows `gen_ai.*` attribute conventions (not deprecated `ai.*`)
* Sets `gen_ai.system = "cohere"`

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.