A message is one unit of conversation between a person and a language model. In an API prompt, messages are dictionaries with role and content: the user message contains the instruction the model should answer, while system messages provide behavior or context. section 9.2.3
A focused user request
A system message can establish the assistant’s behavior, while the user message asks, “Explain what Streamlit is in 10 words or fewer.” The message list is then passed to the chat completions endpoint. section 9.2.3
Messages also form conversation history. A backend can return its messages list, and a Streamlit frontend can display each message with its type and content, allowing users to follow the complete exchange rather than only the latest reply. section 10.3.2
>>> messages = [
... {'role': 'system', 'content': 'You are a helpful programming assistant'},
... {'role': 'user', 'content': 'Explain what Streamlit is in 10 words or fewer'}
... ]
Inspect the message-list structure used to send system context and a user instruction together. section 9.2.3






