ATRIUMsearch → argument graph
MechanismArticle

The Python API now supports a messages-based prompt parameter and structured streaming events, replacing the old single-string iterable approach to handle modern model outputs that include reasoning, tool calls, and attachments.

The old abstraction of sending messages one at a time to a conversation has been replaced with a direct messages list parameter, and string-only streaming has been superseded by typed stream_events that handle reasoning, text, tool calls, and attachments. ✦ AI generated

Simon Willison · Simon Willison's Weblog · 2026-08-04 · original ↗

LLM's Python API previously required you to create a conversation and then send messages to it one at a time. This was an abstraction over the true nature of LLMs, where each request carries a complete history of the messages that came before it. That abstraction started to get in the way for some more advanced cases, so the new release introduces a model.prompt(messages=[]) parameter... LLM previously returned an iterable sequence of strings from each prompt. This worked great when models returned a string response, but failed to predict the weird shape that models would evolve towards. Today many models return a mix of reasoning text, output strings, tool calls, and even image attachments. With LLM 0.32 you can do this instead: for event in model.prompt("Explain cats").stream_events(): if event.type == "reasoning": print(f"[thinking] {event.chunk}", end="", flush=True) elif event.type == "text": print(event.chunk, end="", flush=True) else: print(f"Other event: {event}")

Read full article ↗excerpt · fair-use quotation

Around this claim