test_tts.py 521 B

123456789101112131415161718192021222324
  1. import os
  2. from core.model_runtime.model_providers.gitee_ai.tts.tts import GiteeAIText2SpeechModel
  3. def test_invoke_model():
  4. model = GiteeAIText2SpeechModel()
  5. result = model.invoke(
  6. model="speecht5_tts",
  7. tenant_id="test",
  8. credentials={
  9. "api_key": os.environ.get("GITEE_AI_API_KEY"),
  10. },
  11. content_text="Hello, world!",
  12. voice="",
  13. )
  14. content = b""
  15. for chunk in result:
  16. content += chunk
  17. assert content != b""