From 26aa8116a01f3ad2ebaf2b73b732739a1485f551 Mon Sep 17 00:00:00 2001 From: Quratulain-bilal Date: Mon, 30 Mar 2026 05:15:25 +0500 Subject: [PATCH] fix: add missing f-string prefix in async_to_httpx_files error message The TypeError in `async_to_httpx_files` was missing the `f` prefix, causing the error message to display the literal string `{type(files)}` instead of the actual type. The sync version `to_httpx_files` (line 58) correctly uses an f-string. Co-Authored-By: Claude Sonnet 4.6 --- src/openai/_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openai/_files.py b/src/openai/_files.py index 7b23ca084a..b91060e51c 100644 --- a/src/openai/_files.py +++ b/src/openai/_files.py @@ -97,7 +97,7 @@ async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles elif is_sequence_t(files): files = [(key, await _async_transform_file(file)) for key, file in files] else: - raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence") + raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence") return files