mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix: move AssemblyAI transcript_id validation before try/except so ValueError propagates
This commit is contained in:
parent
60e368e704
commit
1f8373d29c
1 changed files with 8 additions and 8 deletions
|
|
@ -204,15 +204,15 @@ class AssemblyAIPassthroughLoggingHandler:
|
|||
)
|
||||
if _api_key is None:
|
||||
raise ValueError("AssemblyAI API key not found")
|
||||
if (
|
||||
any(c in transcript_id for c in ("/", "\\", "#", "?"))
|
||||
or ".." in transcript_id
|
||||
):
|
||||
raise ValueError(
|
||||
f"Invalid transcript_id {transcript_id!r}: contains disallowed characters"
|
||||
)
|
||||
safe_transcript_id = urllib.parse.quote(transcript_id, safe="")
|
||||
try:
|
||||
if (
|
||||
any(c in transcript_id for c in ("/", "\\", "#", "?"))
|
||||
or ".." in transcript_id
|
||||
):
|
||||
raise ValueError(
|
||||
f"Invalid transcript_id {transcript_id!r}: contains disallowed characters"
|
||||
)
|
||||
safe_transcript_id = urllib.parse.quote(transcript_id, safe="")
|
||||
url = f"{_base_url}/v2/transcript/{safe_transcript_id}"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {_api_key}",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue