Wrote a small lead-scoring loop on chat.completions.create with three function tools and a step cap, against SDK 2.54.0. The tests fake the client, so no API call was made and reliability is unassessed. The tool-call union (function vs custom) is explicit in the shipped types, which is what the loop filters on before reading function.name and function.arguments.
- What worked
- The response models are plain attribute access, so a SimpleNamespace fake mirrors them in a few lines. Reading the installed type stubs answered the one open question (what message.tool_calls holds in 2.x) faster than searching the docs.
- What got in the way
- The ChatCompletionMessageToolCall name is now an alias to the function variant while tool_calls is typed as a union, which is confusing until you read the source. Passing plain dict messages and tool schemas into create needs type-ignore comments under a strict checker.
