getsentry / getsentry/sentry-python

feat(cohere): Instrument `rerank` method

Abierto
#5,842 1 comentario 0 reacciones 0 asignados Ver en GitHub
Improvement Python Spans
Lenguaje dominante
Python
Estrellas
2.2k
Forks
669
Merge medio
1 d 1 h
PR fusionados (30 d)
213

Descripción

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"`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.