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

Function _array_suffix

src/openai/_utils/_utils.py:65–76  ·  view source on GitHub ↗
(array_format: ArrayFormat, array_index: int)

Source from the content-addressed store, hash-verified

63
64
65def _array_suffix(array_format: ArrayFormat, array_index: int) -> str:
66 if array_format == "brackets":
67 return "[]"
68 if array_format == "indices":
69 return f"[{array_index}]"
70 if array_format == "repeat" or array_format == "comma":
71 # Both repeat the bare field name for each file part; there is no
72 # meaningful way to comma-join binary parts.
73 return ""
74 raise NotImplementedError(
75 f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}"
76 )
77
78
79def _extract_items(

Callers 1

_extract_itemsFunction · 0.85

Calls 1

get_argsFunction · 0.70

Tested by

no test coverage detected