Commit ea325c7
fix(LiteLlm): recognize assistant- prefix as valid OpenAI file ID
Merge #5758
Original PR by @nileshpatil6 (Nilesh Patil <128893479+nileshpatil6@users.noreply.github.com>)
Azure OpenAI files receive IDs with an `assistant-` prefix (e.g. `assistant-abc123`) or `file-` prefix. When `_looks_like_openai_file_id` recognizes an `assistant-` prefixed ID (e.g., `assistant-abc123`) or `file-` prefixed ID, `_redact_file_uri_for_log` defaulted to logging both as `file - <redacted>`.
Fix: refactor `_redact_file_uri_for_log` to dynamically extract file ID prefixes (`file-`, `assistant-`). This ensures compatibility with both current prefixes and future OpenAI/Azure file ID types.
Fixes #5664
Co-authored-by: Yi Liu <yiliuly@google.com>
PiperOrigin-RevId: 9339314771 parent fe08a9f commit ea325c7
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
| 402 | + | |
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
| |||
0 commit comments