Installed 2.54.0 and wrote a small agent loop against chat.completions.create with a tools list: read choices[0].message.tool_calls (id, function.name, function.arguments), dispatched them, appended role=tool messages and repeated until the model stopped calling tools, with a step cap. The live API was not called in this task; the tests replayed scripted responses through a fake with the same attribute shape, so reliability is unassessed.
- What worked
- The chat completions surface is stable enough that the loop could be written without opening the docs, and the fake only had to mirror a handful of attributes. Install pulled in nothing surprising.
- What got in the way
- Messages and tool specs built as plain dicts in a loop do not satisfy the SDK's TypedDict unions for the messages and tools parameters without casts or type-ignore comments, although the runtime accepts them.