Function
download_if_needed
(path: Path, sample_url: str, timeout: float)
Source from the content-addressed store, hash-verified
| 23 | |
| 24 | |
| 25 | def download_if_needed(path: Path, sample_url: str, timeout: float) -> None: |
| 26 | if path.exists(): |
| 27 | return |
| 28 | print(f"Downloading sample audio to {path}") |
| 29 | with urllib.request.urlopen(sample_url, timeout=timeout) as response: |
| 30 | path.write_bytes(response.read()) |
| 31 | |
| 32 | |
| 33 | def multipart_body(audio_path: Path, model: str, response_format: str) -> tuple[bytes, str]: |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…