• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

scope3data / scope3ai-py / 12680309189

08 Jan 2025 10:40PM UTC coverage: 94.312% (+13.8%) from 80.557%
12680309189

Pull #57

github

5d8466
tito
feat(openai): add support for speech translation
Pull Request #57: feat(openai): add support for speech translation

67 of 73 new or added lines in 4 files covered. (91.78%)

36 existing lines in 7 files now uncovered.

1741 of 1846 relevant lines covered (94.31%)

3.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/scope3ai/tracers/openai/utils.py
1
import logging
4✔
2
from typing import Optional
4✔
3

4
import openai
4✔
5

6
logger = logging.getLogger("scope3.tracers.openai")
4✔
7

8

9
def _get_file_audio_duration(
4✔
10
    file: openai._types.FileTypes,
11
) -> Optional[float]:
12
    try:
4✔
13
        from mutagen import File
4✔
14

15
        if isinstance(file, (list, tuple)):
4✔
16
            file = file[1]
4✔
17

18
        audio = File(file)
4✔
19
        if audio is not None and audio.info is not None:
4✔
20
            return audio.info.length
4✔
NEW
21
    except Exception as e:
×
NEW
22
        logger.exception(f"Failed to get audio duration: {e}")
×
NEW
23
    return None
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc