Skip to content

Observability of the audio model #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

inlines10
Copy link
Contributor

@inlines10 inlines10 commented May 10, 2025

为 DashScope 语音合成模型添加可观测性支持

描述

本次PR为DashScope语音合成模型添加了可观测性支持,通过实现Spring AI的观测框架,使模型运行状态可监控、可追踪。主要改进包括:

  • 新增 SpeechSynthesisContext 用于追踪合成指标
  • 实现 DashScopeAudioObservationConvention 自定义观测约定
  • 在同步和异步合成方法中集成观测支持
  • 新增以下指标监控:
    • 输入文本长度
    • 输出音频大小
    • 模型名称
    • 响应格式
    • 采样率
    • 错误追踪

改动内容

  • 新增观测上下文类 SpeechSynthesisContext
  • 新增观测约定类 DashScopeAudioObservationConvention
  • 修改 DashScopeSpeechSynthesisModel 以支持观测
  • call()stream() 方法添加观测支持

测试计划

  • 添加观测上下文的单元测试
  • 验证同步和异步场景下的指标收集
  • 测试错误追踪和报告功能

@myeyestore
Copy link

Great implementation of this feature. I particularly like the approach to error handling.

Copy link
Collaborator

@yuluo-yx yuluo-yx left a comment

Choose a reason for hiding this comment

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

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