You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Cohere Classify API (client.classify()) is not instrumented. Calls to client.classify() (sync and async) produce zero Braintrust tracing. This is an active, GA inference endpoint that accepts text inputs with example text+label pairs and returns classification predictions with confidence scores.
The Cohere integration currently instruments chat, chat_stream, embed, and rerank (V1 and V2), but has no handling for the classify() surface. This gap was explicitly noted as a follow-up when the Cohere integration was implemented (see #260).
This repo already instruments analogous classification/moderation endpoints for other providers:
OpenAI: client.moderations.create() via ModerationsPatcher
The existing Cohere patchers (ChatPatcher, EmbedPatcher, RerankPatcher) in py/src/braintrust/integrations/cohere/patchers.py provide the exact pattern to follow: FunctionWrapperPatcher targeting BaseCohere.classify and AsyncBaseCohere.classify
Braintrust docs status
not_found — Cohere is not listed on the Braintrust integrations page. No dedicated Cohere integration docs page mentions classify.
Cohere Python SDK on PyPI (v6.1.0): client.classify() on BaseCohere and AsyncBaseCohere
The classify endpoint is listed in the main Cohere API reference alongside chat, embed, and rerank — it is not deprecated
Local files inspected
py/src/braintrust/integrations/cohere/patchers.py — defines patchers for Chat, ChatStream, Embed, Rerank (V1 and V2, sync and async); zero references to classify
py/src/braintrust/integrations/cohere/tracing.py — wrapper functions for chat, embed, rerank; no classify wrappers
py/src/braintrust/integrations/cohere/integration.py — integration class registers 4 composite patchers; no ClassifyPatcher
py/src/braintrust/integrations/cohere/test_cohere.py — no classify test cases
py/pyproject.toml — Cohere version matrix: latest pinned to cohere==6.1.0, older pin at 5.0.0
Summary
The Cohere Classify API (
client.classify()) is not instrumented. Calls toclient.classify()(sync and async) produce zero Braintrust tracing. This is an active, GA inference endpoint that accepts text inputs with example text+label pairs and returns classification predictions with confidence scores.The Cohere integration currently instruments
chat,chat_stream,embed, andrerank(V1 and V2), but has no handling for theclassify()surface. This gap was explicitly noted as a follow-up when the Cohere integration was implemented (see #260).This repo already instruments analogous classification/moderation endpoints for other providers:
client.moderations.create()viaModerationsPatcherclient.classifiers.moderate()/classify()tracked in [bot] Mistral: Classifiers API (client.classifiers.moderate()/classify()) not instrumented #326What is missing
client.chat()/client.v2.chat()client.chat_stream()/client.v2.chat_stream()client.embed()/client.v2.embed()client.rerank()/client.v2.rerank()client.classify()client.classify()AsyncBaseCohere)API details
POST /v1/classifyinputs,examples,model,preset,truncateClassifyResponsewithclassificationsarray containingid,input,predictions,prediction,confidence,confidences,labelsMinimum instrumentation
At minimum, both sync and async
classify()methods should create spans capturing:inputs(texts being classified),examples(reference text+label pairs)classificationsarray with predictions and confidence scoresprovider: "cohere", model, preset, truncate setting, number of unique labelsPrecedent in this repo
ModerationsPatcherinstruments the equivalentclient.moderations.create()endpointclient.classifiers.moderate()/classify()) not instrumented #326) tracks the same pattern: accept input text, run a classifier/moderation model, return inference resultsChatPatcher,EmbedPatcher,RerankPatcher) inpy/src/braintrust/integrations/cohere/patchers.pyprovide the exact pattern to follow:FunctionWrapperPatchertargetingBaseCohere.classifyandAsyncBaseCohere.classifyBraintrust docs status
not_found — Cohere is not listed on the Braintrust integrations page. No dedicated Cohere integration docs page mentions classify.
Upstream sources
client.classify()onBaseCohereandAsyncBaseCohereLocal files inspected
py/src/braintrust/integrations/cohere/patchers.py— defines patchers forChat,ChatStream,Embed,Rerank(V1 and V2, sync and async); zero references toclassifypy/src/braintrust/integrations/cohere/tracing.py— wrapper functions for chat, embed, rerank; no classify wrapperspy/src/braintrust/integrations/cohere/integration.py— integration class registers 4 composite patchers; no ClassifyPatcherpy/src/braintrust/integrations/cohere/test_cohere.py— no classify test casespy/pyproject.toml— Cohere version matrix: latest pinned tocohere==6.1.0, older pin at5.0.0Relationship to existing issues
client.classify()as needing a follow-up issueclient.audio.transcriptions.create()) not instrumented #327 tracks Cohere Audio Transcription API (separate surface)client.classifiers.moderate()/classify()) not instrumented #326 tracks the analogous Mistral Classifiers API gap