getsentry / getsentry/sentry-python

feat(cohere): Instrument `rerank` method

オープン
#5,842 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Improvement Python Spans
主要言語
Python
スター
2.2k
フォーク
669
平均マージ
1日 1時間
マージ済み PR(30日)
213

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。