Skip to main content

Python module

max.pipelines.request

Request types for MAX API.

Base request types​

RequestProtocol representing a generic request within the MAX API.
RequestIDA unique immutable identifier for a request.
RequestTypeType variable.
DUMMY_REQUEST_IDA unique immutable identifier for a request.

Responses API request​

OpenResponsesRequestGeneral request container for OpenResponses API requests.
OpenResponsesRequestBodyRequest body for creating a response.
ResponseResourceThe response from the model.

Messages​

AssistantMessageA message from the assistant.
DeveloperMessageA message from the application developer.
InputMessageRepresent a PEP 604 union type
MessageA generic message in the conversation.
MessageRoleThe role of the message author.
MessageStatusThe status of the message.
SystemMessageA system message that guides the assistant's behavior.
UserMessageA message from the user.

Input content​

InputContentRepresent a PEP 604 union type
InputFileContentFile content in input messages.
InputImageContentImage content in input messages.
InputTextContentText content in input messages.
InputVideoContentVideo content in input messages.
ItemReferenceParamReference to an item in the conversation.
ImageDetailControls image processing detail level.

Output content​

OutputContentRuntime representation of an annotated type.
OutputImageContentImage content generated by the model in output messages.
OutputTextContentText content in output messages.
OutputTokensDetailsDetailed token count information for output.
OutputVideoContentVideo content generated by the model in output messages.
RefusalContentRefusal content when the model declines to respond.

Tools​

AllowedToolChoiceSpecifies a subset of allowed tools and selection mode.
FunctionCallA function call generated by the model.
FunctionCallOutputThe output from a function call.
FunctionCallStatusThe status of the function call.
FunctionToolA function tool definition in the response.
FunctionToolChoiceSpecifies a particular function to call.
FunctionToolParamA function tool definition in the request.
ToolChoiceRepresent a PEP 604 union type
ToolChoiceValueEnumControls which (if any) tool is called by the model.

Response format​

JsonObjectFieldJSON object response format.
JsonObjectParamConfiguration for JSON object responses.
JsonSchemaFieldJSON schema response format.
JsonSchemaParamConfiguration for JSON schema-constrained responses.
ResponseFormatRepresent a PEP 604 union type
ResponseFormatParamRepresent a PEP 604 union type
TextFieldText response format.
TextParamConfiguration for text generation.

Reasoning​

ReasoningBodyReasoning information in the response.
ReasoningEffortEnumThe effort level for extended reasoning.
ReasoningParamConfiguration for extended reasoning.
ReasoningReferenceReference to reasoning in the response.
ReasoningReferenceParamReference to previous reasoning content.
ReasoningSummaryContentSummary of the model's reasoning process.
ReasoningSummaryEnumThe level of detail for reasoning summaries.

Usage and tokens​

ErrorError information.
IncludeEnumAdditional data to include in the response.
IncompleteDetailsDetails about why a generation was incomplete.
InputTokensDetailsDetailed token count information for input.
LogProbLog probability information for output tokens.
ServiceTierEnumThe service tier for request processing.
StreamOptionsParamOptions for streaming responses.
TopLogProbLog probability information for a token.
TruncationEnumControls message truncation behavior.
UrlCitationBodyURL citation in response.
UrlCitationParamURL citation in request.
UsageToken usage statistics.
VerbosityEnumThe verbosity level for responses.

Protocols​

FastAPIRequestProtocolMinimal protocol for FastAPI/Starlette Request objects.