Skip to content

[bot] Perplexity TypeScript SDK (@perplexity-ai/perplexity_ai) not instrumented — no tracing for chat completions or search #2169

Description

@braintrust-bot

Summary

Perplexity publishes an official TypeScript SDK: @perplexity-ai/perplexity_ai on npm (v0.33.0, actively maintained). It is a Stainless-generated client with its own HTTP layer — it does not depend on the openai npm package. This repository has zero instrumentation for any @perplexity-ai/perplexity_ai surface — no wrapper, no channels, no plugin, no auto-instrumentation config. Users who call @perplexity-ai/perplexity_ai directly get no Braintrust spans.

What instrumentation is missing

The @perplexity-ai/perplexity_ai npm package exposes these execution surfaces, none of which are instrumented:

SDK Method Description
client.chat.completions.create({ model, messages }) Chat completions with real-time web search grounding
client.chat.completions.create({ ..., stream: true }) Streaming chat completions
client.search.create({ query, ... }) Ranked web search results (multi-query, domain/date filtering)
client.responses.create({ input, model }) Simpler response generation interface

The SDK has its own HTTP layer (custom undici/Bun/Deno client support) and is not patched by the existing openai auto-instrumentation.

No coverage in any instrumentation layer:

  • No wrapper function (e.g. wrapPerplexity())
  • No diagnostics channels for Perplexity methods
  • No plugin handler in js/src/instrumentation/plugins/
  • No auto-instrumentation config in js/src/auto-instrumentations/configs/
  • No e2e test scenarios
  • Grep for perplexity across js/src/ returns zero matches

Indirect coverage is insufficient:

Braintrust's Perplexity integration page documents a gateway/OpenAI SDK approach — pointing the openai npm client at https://gateway.braintrust.dev/v1 to route Perplexity model calls. Users who call @perplexity-ai/perplexity_ai directly — which is Perplexity's own official TypeScript client with its own HTTP layer — get no spans at all under that approach. The search.create() surface (web search with citations) has no equivalent in the gateway approach.

Braintrust docs status

not_found for direct SDK instrumentation. The Braintrust Perplexity integration page documents a gateway/OpenAI SDK approach only and does not reference @perplexity-ai/perplexity_ai.

Upstream references

Local files inspected

  • js/src/auto-instrumentations/configs/ — full config list: anthropic.ts, openai.ts, ai-sdk.ts, groq.ts, mistral.ts, cohere.ts, huggingface.ts, google-genai.ts, google-adk.ts, genkit.ts, openai-agents.ts, openrouter.ts, openrouter-agent.ts, claude-agent-sdk.ts, cursor-sdk.ts, github-copilot.ts, openai-codex.ts, flue.ts, strands-agent-sdk.ts, pi-coding-agent.ts, bedrock-runtime.ts — no Perplexity config present
  • js/src/instrumentation/plugins/ — no Perplexity channels or plugin file
  • js/src/wrappers/ — no perplexity.ts wrapper file
  • e2e/scenarios/ — no Perplexity test scenarios
  • Full repo grep for perplexity in js/src/ — zero matches

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions