getsentry / getsentry/sentry-python
feat(cohere): Instrument `rerank` method
Aperta
Improvement
Python
Spans
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 669
- Merge medio
- 1g 1h
- PR unite (30g)
- 213
Descrizione
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"`
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.