Install & Compatibility
Where this runs
tested against v2.3.0.post1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✕ build_error
py 3.9
✕ build_error
✕ build_error
25MB installed
● package 25MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CreateResponseBody
✓ from openresponses_types import CreateResponseBody
✗ from openresponses_types import OpenResponse
This quickstart demonstrates how to create an `AgentResponse` containing a `ChatMLMessage`, embed it within an `OpenResponse`, and then serialize and deserialize the entire structure using Pydantic's V2 methods.
from openresponses.types import AgentResponse, OpenResponse
from openresponses.types.model import ChatMLMessage
# Create an AgentResponse
agent_msg = ChatMLMessage(role="assistant", content="Hello, how can I help you?")
agent_response = AgentResponse(
model_name="gpt-4",
messages=[agent_msg]
)
# Create an OpenResponse containing the agent's response
open_response = OpenResponse(
response=agent_response,
prompt_hash="example_hash_123"
)
# Print the OpenResponse object (serialized to JSON)
print("OpenResponse object created:")
print(open_response.model_dump_json(indent=2))
# Example of deserialization from JSON string
json_data = open_response.model_dump_json()
reconstructed_response = OpenResponse.model_validate_json(json_data)
print("\nOpenResponse object deserialized:")
print(reconstructed_response.model_dump_json(indent=2))
Debug
Known issues
gotchaThe PyPI package name (`openresponses-types`) is different from the top-level Python package name you import (`openresponses`). Always use `from openresponses.types import ...`.fixEnsure your imports start with `from openresponses.types` or `from openresponses.types.model` etc., not `openresponses_types`.
affects: All versions
breakingThis library explicitly requires Pydantic V2. Projects using Pydantic V1 will encounter conflicts and `pydantic.ValidationError` or `AttributeError` if Pydantic V1 methods are used.fixUpgrade Pydantic to version 2 or greater (`pip install 'pydantic>=2.0.0'`) and update your Pydantic model usage (e.g., `model_dump_json()` instead of `json()`, `model_validate()` instead of direct class instantiation from dict).
affects: All versions (>=1.0.0)
gotchaThe `OpenResponse` specification is strict. Any data provided that does not conform to the defined schemas will result in `pydantic.ValidationError`.fixConsult the OpenResponses specification and ensure all fields, types, and constraints (e.g., enum values, regex patterns) are strictly followed when constructing objects or deserializing data.
affects: All versions
Upgrade
Version history
2.3.0.post1latest on PyPI · released Jan 22, 2026
Audit
Dependencies
openresponses-pythonrequired`openresponses-types` is a meta-package that depends on `openresponses-python` for the actual implementation.
pydantic>=2.0.0requiredCore dependency for data modeling, validation, and serialization. Requires Pydantic V2.