Skip to content

Conversation

@Cirilla-zmh
Copy link
Collaborator

Change-Id: Iaafae7e5f7ad99f0df0cec5652415aa0231b9e25
Co-developed-by: Cursor noreply@cursor.com

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Fix unit tests

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Change-Id: Iaafae7e5f7ad99f0df0cec5652415aa0231b9e25
Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I50db0082ded6ae85b5d29e1237e8b817b964cd33
Co-developed-by: Cursor <noreply@cursor.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes MIME type inference logic for speech synthesis instrumentation by dynamically determining the correct MIME type based on the audio format parameter, rather than using hardcoded values. Additionally, it removes support for the V2 streaming_call functionality and improves time-to-first-token calculation safety.

Changes:

  • Added _convert_speech_format_to_mime_type() helper function to dynamically map DashScope audio format strings (wav, mp3, pcm, opus) to their corresponding MIME types
  • Changed from Base64Blob to Blob type for audio content storage, now using raw bytes instead of base64-encoded strings
  • Removed instrumentation for SpeechSynthesizerV2.streaming_call method (no longer supported)
  • Added guard condition to prevent negative time-to-first-token calculations in span_utils.py

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
util/opentelemetry-util-genai/src/opentelemetry/util/genai/span_utils.py Added guard condition to prevent negative TTFT calculations when first token time precedes start time
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/tests/test_speech_synthesis.py Disabled streaming_call test as functionality is no longer supported
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/utils/multimodal.py Added MIME type converter, changed from Base64Blob to Blob, added mime_type parameters to response handlers
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/utils/init.py Exported new _convert_speech_format_to_mime_type function
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/patch/speech_synthesis.py Integrated MIME type inference, removed streaming_call wrapper
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/patch/init.py Removed streaming_call wrapper export
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/src/opentelemetry/instrumentation/dashscope/init.py Removed streaming_call instrumentation and uninstrumentation
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/README.rst Added Speech Synthesis V1 and V2 to supported APIs documentation
instrumentation-loongsuite/loongsuite-instrumentation-dashscope/CHANGELOG.md Added changelog entry for MIME type fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Change-Id: I8d74564458c878afabd60da2109ab2e04c428721
Co-developed-by: Cursor <noreply@cursor.com>
@Cirilla-zmh Cirilla-zmh merged commit 4d7ef48 into alibaba:main Feb 9, 2026
685 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants