-
Notifications
You must be signed in to change notification settings - Fork 3
[BOT ISSUE] Cohere TypeScript SDK (cohere-ai) not instrumented — no tracing for direct Cohere chat, embed, or rerank calls #1740
Description
Summary
The Cohere TypeScript SDK (cohere-ai) provides execution APIs for chat completions, embeddings, and reranking with a unique, non-OpenAI-compatible interface. This repository has zero instrumentation for any Cohere SDK surface — no wrapper, no channels, no plugin, no auto-instrumentation config. Users who call the Cohere SDK directly get no Braintrust spans.
What instrumentation is missing
The cohere-ai npm package (~270K–370K weekly downloads) exposes these execution surfaces, none of which are instrumented:
| SDK Method | Description |
|---|---|
client.chat() |
Text generation / chat completions |
client.chatStream() |
Streaming chat completions |
client.embed() |
Text and image embeddings |
client.rerank() |
Reranking documents by relevance |
The Cohere API is not OpenAI-compatible — it has its own request/response schemas, tool-calling format, citation/grounding system, and streaming protocol. Users cannot use wrapOpenAI() with a Cohere base URL.
No coverage in any instrumentation layer:
- No wrapper function (e.g.
wrapCohere()) - No diagnostics channels for Cohere methods
- No plugin handler in
js/src/instrumentation/plugins/ - No auto-instrumentation config in
js/src/auto-instrumentations/configs/ - No vendor SDK types in
js/src/vendor-sdk-types/ - No e2e test scenarios
A grep for cohere (case-insensitive) across js/src/ returns zero matches. The only references in the repo are @ai-sdk/cohere in an example project's package.json, which is a Vercel AI SDK provider adapter — not direct Cohere SDK instrumentation.
Indirect coverage exists but is limited:
Users can access Cohere models through the Vercel AI SDK (@ai-sdk/cohere) or LangChain (@langchain/cohere), both of which are instrumented. However, users who use the official cohere-ai SDK directly — which is the primary SDK documented by Cohere — get no tracing.
Context
This repo instruments 7 other AI provider SDKs directly: OpenAI, Anthropic, Google GenAI, Mistral, OpenRouter, Vercel AI SDK, and Claude Agent SDK. Cohere is a comparable provider with a stable, actively maintained official TypeScript SDK and a unique API surface.
Braintrust docs status
not_found — Cohere is not mentioned on the Braintrust tracing docs at https://www.braintrust.dev/docs/guides/tracing or the wrap-providers page at https://www.braintrust.dev/docs/instrument/wrap-providers.
Upstream references
- Cohere TypeScript SDK: https://github.com/cohere-ai/cohere-typescript
- npm package: https://www.npmjs.com/package/cohere-ai
- Cohere API v2 docs: https://docs.cohere.com/v2/reference/chat
- Cohere changelog: https://docs.cohere.com/changelog
Local files inspected
js/src/wrappers/— no Cohere wrapperjs/src/instrumentation/plugins/— no Cohere channels or pluginjs/src/auto-instrumentations/configs/— no Cohere configjs/src/vendor-sdk-types/— no Cohere typese2e/scenarios/— no Cohere test scenariosjs/examples/ai-sdk/next-openai-app/package.json— only reference is@ai-sdk/cohere(AI SDK adapter, not direct SDK)