Skip to content

Remove to_openai and from_openai from InstructRequest#251

Merged
juliendenize merged 1 commit into
mainfrom
chore/remove-instructrequest-openai
Jun 25, 2026
Merged

Remove to_openai and from_openai from InstructRequest#251
juliendenize merged 1 commit into
mainfrom
chore/remove-instructrequest-openai

Conversation

@juliendenize

Copy link
Copy Markdown
Contributor

Summary

InstructRequest is an internal class used by tokenizers; the OpenAI conversion helpers belong on the public ChatCompletionRequest. This removes the redundant to_openai / from_openai from InstructRequest and documents that the class is internal.

Changes

  • Delete InstructRequest.to_openai and InstructRequest.from_openai (ChatCompletionRequest versions are untouched).
  • Add a note to the InstructRequest docstring: it is for internal use only; external users should use ChatCompletionRequest to build requests and convert to/from the OpenAI format.
  • Update tests/test_converters.py to drop the InstructRequest OpenAI-conversion cases.

Verification

  • ruff check + format: pass
  • mypy (src + tests): pass
  • pytest tests/test_converters.py: 99 passed
  • doctests for request.py: 5 passed

@juliendenize juliendenize merged commit 25a49da into main Jun 25, 2026
12 checks passed
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.

2 participants