Skip to content

Conversation

@majiayu000
Copy link

Summary

  • Export ChatCompletion, Response, ResponseUsage from openai.types

Fixes

Closes #2680

Problem

Users cannot import major types directly from openai.types:

# This didn't work
from openai.types import ChatCompletion  # Not available

Solution

Added re-exports to openai/types/__init__.py:

from openai.types import ChatCompletion, Response, ResponseUsage

Test

Added tests/test_type_exports.py to verify the types are correctly exported.

Fixes openai#2680

Added exports for major types from openai.types module for easier access:
- ChatCompletion (from openai.types.chat)
- Response (from openai.types.responses)
- ResponseUsage (from openai.types.responses)

This allows users to import these commonly used types directly:
    from openai.types import ChatCompletion, Response, ResponseUsage
@majiayu000 majiayu000 requested a review from a team as a code owner December 17, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Major types are not exposed in openai.types ChatCompletion, Response, ResponseUsage

1 participant