openai.internal._chat_prune_nulls

(internal) Drop every null-valued map entry, recursively. Typed request classes declare their optional fields, and this is what keeps an unset one off the wire instead of sending `"seed": null`. Runs BEFORE the passthrough merge, so a user's explicit `null` override still deletes a key the client did set. `_chat_is_opaque_key` subtrees are copied verbatim (the aws/google rule).

Reference version

Signature

function openai.internal._chat_prune_nulls(j: baml.json.json) -> baml.json.json

(internal) Drop every null-valued map entry, recursively. Typed request classes declare their optional fields, and this is what keeps an unset one off the wire instead of sending "seed": null. Runs BEFORE the passthrough merge, so a user's explicit null override still deletes a key the client did set. _chat_is_opaque_key subtrees are copied verbatim (the aws/google rule).

Source:<builtin>/openai/ns_internal/chat.bamlbytes 3550836442