MCPcopy
hub / github.com/openai/openai-python / assert_is_file_content

Function assert_is_file_content

src/openai/_files.py:35–40  ·  view source on GitHub ↗
(obj: object, *, key: str | None = None)

Source from the content-addressed store, hash-verified

33
34
35def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
36 if not is_file_content(obj):
37 prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
38 raise RuntimeError(
39 f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/openai/openai-python/tree/main#file-uploads"
40 ) from None
41
42
43@overload

Callers 1

_extract_itemsFunction · 0.85

Calls 1

is_file_contentFunction · 0.85

Tested by

no test coverage detected