nemo_gym.responses_converter
nemo_gym.responses_converter
Shared Responses API ↔ Chat Completions converter.
This module contains the translation logic between OpenAI’s Responses API format and the Chat Completions API format. It is used by model servers that need to convert between the two formats (e.g. vllm_model, inference_provider).
Module Contents
Classes
Functions
Data
VLLMConverterResponsesToChatCompletionsState
_RESPONSE_OUTPUT_BOUNDARY_TYPES
API
Bases: BaseModel
Converts between OpenAI Responses API and Chat Completions API formats.
Collects text from ‘reasoning’ messages in responses api and appends it to a buffer.
This is done to group together one (or multiple) reasoning message(s) into a single, cohesive block, later prepending it to a subsequent assistant message. See: https://docs.nvidia.com/nemo/gym/main/infrastructure/engineering-notes/responses-api-evolution for background on reasoning in the Responses API.
Bases: BaseModel
Plain text of a chat message content (a string, or a list of text parts).
Return a provider-reported token count without coercing missing/invalid values to zero.
Return validated token metadata when the mapping contains it.
Read one canonical nested token detail, then named provider aliases.