nemo_gym.openai_utils
nemo_gym.openai_utils
Module Contents
Classes
Functions
Data
NeMoGymChatCompletionContentPartParam
NeMoGymChatCompletionMessageParam
NeMoGymChatCompletionMessageToolCallUnion
NeMoGymChatCompletionMessageToolCallUnionParam
NeMoGymChatCompletionOutputMessage
NeMoGymChatCompletionToolUnionParam
_REQUIRED_TOKEN_METADATA_FIELDS
API
Bases: BaseModel
This is just a stub class that wraps around aiohttp
Bases: ChatCompletion
Bases: typing.TypedDict
Bases: ChatCompletionAssistantMessageParam
Bases: ChatCompletionContentPartFileParam
Bases: ChatCompletionContentPartImageParam
Bases: ChatCompletionContentPartInputAudioParam
Bases: ChatCompletionContentPartTextParam
Bases: BaseModel
Bases: ChatCompletionCustomToolParam
Bases: ChatCompletionDeveloperMessageParam
Bases: ChatCompletionMessage
Bases: ChatCompletionMessageCustomToolCall
Bases: ChatCompletionMessageCustomToolCallParam
Bases: ChatCompletionMessageToolCall
Bases: typing.TypedDict
Bases: ChatCompletionMessageToolCallParam
Bases: ChatCompletionSystemMessageParam
Bases: ChatCompletionToolMessageParam
Bases: ChatCompletionToolParam
Bases: ChatCompletionUserMessageParam
Bases: Choice
Bases: ComputerCallOutput
The client’s result of a computer-use action (computer_call_output item).
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
We copy openai.types.responses.response_input_param.FunctionCallOutput, originally a TypedDict, as a BaseModel here so that we can use it in the NeMoGymResponseOutputItem below and be consistent with the other ResponseOutputItem types.
Bases: FunctionDefinition
Bases: FunctionToolParam
Bases: ImageGenerationCall
A hosted image-generation call (OpenAI Responses image_generation_call output item).
Bases: LocalShellCall
A local-shell command for the client to execute (local_shell_call output item).
Bases: LocalShellCallOutput
The client’s result of a local shell command (local_shell_call_output item).
Bases: McpApprovalResponse
The client’s answer to a hosted-MCP approval request (mcp_approval_response item).
Bases: BaseModel
Bases: NeMoGymMessage, TokenIDLogProbMixin
Bases: Response
Bases: ResponseCodeInterpreterToolCall
A hosted code-interpreter call (OpenAI Responses code_interpreter_call output item).
Bases: ResponseComputerToolCall
A computer-use action for the client to execute (computer_call output item).
Bases: BaseModel
This class is a copy of openai.types.responses.response_create_params.ResponseCreateParamsNonStreaming We make a copy of it here since ResponseCreateParamsNonStreaming is a TypedDict with no strict validation. We need to do server side validation here.
Bases: ResponseCustomToolCall
A client-executed custom tool call (OpenAI Responses custom_tool_call output item).
Bases: ResponseCustomToolCallOutput
The client’s result of a custom tool call (custom_tool_call_output item).
Bases: ResponseFileSearchToolCall
A hosted file-search call (OpenAI Responses file_search_call output item).
The provider executes the search and returns the call in response.output.
Inherits the upstream typing unchanged.
Bases: BaseModel
Bases: ResponseFunctionWebSearch
A hosted web-search call (OpenAI Responses web_search_call output item).
Bases: ResponseInputTextParam
Bases: ResponseInputTokensDetails
Bases: McpApprovalRequest
A hosted-MCP approval request (OpenAI Responses mcp_approval_request item).
Inherits the upstream McpApprovalRequest typing; id/server_label
are relaxed to optional to tolerate endpoints that omit them.
Bases: McpCall
A hosted-MCP tool call (OpenAI Responses mcp_call output item).
Emitted when the upstream endpoint executes a tool server-side (e.g.
NVIDIA-hosted gpt-oss surfacing its built-in python tool as MCP) instead of
returning a client-executed function_call. The output/error
fields are already populated by the server, so the agent parses and passes
it through; there is no client-side execution and hence no training variant.
Inherits the upstream McpCall typing and only relaxes the fields
NVIDIA-hosted endpoints may omit or widen: id/server_label are made
optional and status accepts any string (upstream pins it to a Literal).
Bases: McpListTools
A hosted-MCP tool listing (OpenAI Responses mcp_list_tools output item).
Inherits the upstream McpListTools typing; only id/server_label
are relaxed to optional (NVIDIA-hosted endpoints may omit them) and tools
is widened to List[Any] so raw tool entries pass through without being
coerced into the upstream McpListToolsTool schema.
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Bases: ResponseOutputTokensDetails
Bases: BaseModel
Bases: ResponseUsage
Bases: Summary
Bases: BaseModel
Bases: typing.TypedDict
Prevent an untagged output item from being coerced into the wrong union member.
Require complete token metadata when any token field is present.
Accumulate top-level and detailed response token counts.
Return the ForTraining subclass that carries token IDs for item_cls.
Raises NotImplementedError rather than KeyError, so the message can name the class and the fix. Either register the pair in RESPONSES_TO_TRAIN, or stop attaching token IDs to that item.