Implementation:Openai Openai python Easy Input Message Param
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for parameterizing an easy input message in a request provided by the openai-python SDK.
Description
EasyInputMessageParam is a TypedDict that defines the parameter structure for constructing a message input to the model with a role indicating instruction-following hierarchy. It requires a content field (either a plain string or a ResponseInputMessageContentListParam for multimodal input) and a role field restricted to "user", "assistant", "system", or "developer". An optional type field can be set to "message". Instructions given with the "developer" or "system" role take precedence over those given with the "user" role.
Usage
Import this type when constructing message inputs for a Responses API request. This is the request parameter counterpart to the EasyInputMessage response model.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/easy_input_message_param.py
Signature
class EasyInputMessageParam(TypedDict, total=False):
"""A message input to the model with a role indicating
instruction following hierarchy."""
content: Required[Union[str, ResponseInputMessageContentListParam]]
role: Required[Literal["user", "assistant", "system", "developer"]]
type: Literal["message"]
Import
from openai.types.responses import EasyInputMessageParam
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| content | Union[str, ResponseInputMessageContentListParam] | Yes | Text, image, or audio input to the model. Can also contain previous assistant responses. |
| role | Literal["user", "assistant", "system", "developer"] | Yes | The role of the message input. Developer/system roles take precedence over user. |
| type | Literal["message"] | No | The type of the message input. Always "message" when present. |
Usage Examples
from openai.types.responses import EasyInputMessageParam
# Construct message params for a request
messages: list[EasyInputMessageParam] = [
{
"role": "developer",
"content": "You are a helpful assistant.",
},
{
"role": "user",
"content": "What is the capital of France?",
},
]
response = client.responses.create(
model="gpt-4o",
input=messages,
)