Skip to content

[bot] Instrument DashScope Python SDK (285,123 weekly downloads) #743

Description

@braintrust-bot

Summary

dashscope is Alibaba Cloud's official Python SDK for Model Studio (Bailian), providing direct execution access to Qwen models: text generation, multimodal understanding, embeddings, reranking, and image/video generation. This repo has zero native instrumentation for the dashscope package's own client surface — no integration directory, wrapper, matrix pin, or nox session.

Note: this repo does patch agentscope.model.DashScopeChatModel.__call__ inside the existing AgentScope integration (py/src/braintrust/integrations/agentscope/patchers.py:86-90), but that only covers calls made through AgentScope's own wrapper class. It does not instrument the dashscope SDK's own entrypoints (dashscope.Generation.call(), dashscope.TextEmbedding.call(), etc.), which any user calling DashScope directly (not via AgentScope) would use — that surface is completely untraced.

What needs to be instrumented

  • dashscope.Generation.call(model, messages/prompt, ...) — chat/text generation execution, sync and streaming (stream=True generator)
  • dashscope.aigc.generation.AioGeneration / async generation variants
  • dashscope.TextEmbedding.call(model, input, ...) — embeddings execution
  • dashscope.MultiModalConversation.call(...) — multimodal (vision) generation execution
  • Response objects expose output, usage (input_tokens, output_tokens) suitable for span metrics; request_id for correlation

Weekly downloads

Weekly downloads: 285,123 (as of 2026-09-07; https://pypistats.org/packages/dashscope)

Braintrust docs status

not_found — checked https://www.braintrust.dev/docs/integrations and https://www.braintrust.dev/docs/guides/tracing/integrations; neither lists dashscope/DashScope/Qwen as a supported AI provider or SDK integration.

Upstream sources

Local repo files inspected

  • py/src/braintrust/integrations/ — no dashscope/ directory
  • py/src/braintrust/integrations/agentscope/patchers.py:86-90 — patches agentscope.model.DashScopeChatModel, not the dashscope SDK directly
  • py/src/braintrust/integrations/agentscope/tracing.py:36 — maps "DashScopeChatModel" to provider label "dashscope", again only within the AgentScope wrapper path
  • py/pyproject.toml [tool.braintrust.matrix] — no dashscope entry
  • py/noxfile.py — no test_dashscope session
  • py/src/braintrust/integrations/versioning.py — no mention

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions