LLM 0.32a0 Alpha Adds Message Arrays and Streaming Parts
Upgrade to LLM 0.32a0 and refactor code to use message arrays and streaming parts.
Upgrade to 0.32a0 and refactor your code to use the new message array API.
Summary
LLM 0.32a0 alpha introduces two major changes: prompts are now represented as a sequence of messages, and responses can stream mixed‑type parts. The new message format mirrors OpenAI’s chat completions API, allowing developers to pass a list of user and assistant turns. The library now provides helper functions llm.user() and llm.assistant() to build these message arrays. The previous prompt= option still works, but it is internally converted to a single‑item messages array.
LLM also adds a reply() method on responses, enabling developers to continue a conversation without building a new conversation object. Streaming parts now support multiple content types, such as text, JSON, images, and tool calls, reflecting the capabilities of modern models.
These changes make it easier to emulate OpenAI’s chat API, support tool execution, and handle multimodal outputs. The alpha release is a stepping stone toward a more flexible, future‑proof interface.
Key points: - Prompt input is now a list of messages. - llm.user() and llm.assistant() helper functions. - reply() method on responses. - Streaming parts support mixed content types. - Previous prompt= still works but is converted to messages.
Developers should upgrade to 0.32a0 to take advantage of these new features and prepare for upcoming releases.
Key changes
- Prompts now a sequence of messages
- llm.user() and llm.assistant() builder functions
- reply() method on responses
- Streaming parts support mixed content types
- Previous prompt= option still works via conversion
- Alpha release aligns with OpenAI chat API