Python module
max.pipelines.request
Request types for MAX API.
Base request typesβ
Request | Protocol representing a generic request within the MAX API. |
|---|---|
RequestID | A unique immutable identifier for a request. |
RequestType | Type variable. |
DUMMY_REQUEST_ID | A unique immutable identifier for a request. |
|---|
Responses API requestβ
OpenResponsesRequest | General request container for OpenResponses API requests. |
|---|---|
OpenResponsesRequestBody | Request body for creating a response. |
ResponseResource | The response from the model. |
Messagesβ
AssistantMessage | A message from the assistant. |
|---|---|
DeveloperMessage | A message from the application developer. |
InputMessage | Represent a PEP 604 union type |
Message | A generic message in the conversation. |
MessageRole | The role of the message author. |
MessageStatus | The status of the message. |
SystemMessage | A system message that guides the assistant's behavior. |
UserMessage | A message from the user. |
Input contentβ
InputContent | Represent a PEP 604 union type |
|---|---|
InputFileContent | File content in input messages. |
InputImageContent | Image content in input messages. |
InputTextContent | Text content in input messages. |
InputVideoContent | Video content in input messages. |
ItemReferenceParam | Reference to an item in the conversation. |
ImageDetail | Controls image processing detail level. |
Output contentβ
OutputContent | Runtime representation of an annotated type. |
|---|---|
OutputImageContent | Image content generated by the model in output messages. |
OutputTextContent | Text content in output messages. |
OutputTokensDetails | Detailed token count information for output. |
OutputVideoContent | Video content generated by the model in output messages. |
RefusalContent | Refusal content when the model declines to respond. |
Toolsβ
AllowedToolChoice | Specifies a subset of allowed tools and selection mode. |
|---|---|
FunctionCall | A function call generated by the model. |
FunctionCallOutput | The output from a function call. |
FunctionCallStatus | The status of the function call. |
FunctionTool | A function tool definition in the response. |
FunctionToolChoice | Specifies a particular function to call. |
FunctionToolParam | A function tool definition in the request. |
ToolChoice | Represent a PEP 604 union type |
ToolChoiceValueEnum | Controls which (if any) tool is called by the model. |
Response formatβ
JsonObjectField | JSON object response format. |
|---|---|
JsonObjectParam | Configuration for JSON object responses. |
JsonSchemaField | JSON schema response format. |
JsonSchemaParam | Configuration for JSON schema-constrained responses. |
ResponseFormat | Represent a PEP 604 union type |
ResponseFormatParam | Represent a PEP 604 union type |
TextField | Text response format. |
TextParam | Configuration for text generation. |
Reasoningβ
ReasoningBody | Reasoning information in the response. |
|---|---|
ReasoningEffortEnum | The effort level for extended reasoning. |
ReasoningParam | Configuration for extended reasoning. |
ReasoningReference | Reference to reasoning in the response. |
ReasoningReferenceParam | Reference to previous reasoning content. |
ReasoningSummaryContent | Summary of the model's reasoning process. |
ReasoningSummaryEnum | The level of detail for reasoning summaries. |
Usage and tokensβ
Error | Error information. |
|---|---|
IncludeEnum | Additional data to include in the response. |
IncompleteDetails | Details about why a generation was incomplete. |
InputTokensDetails | Detailed token count information for input. |
LogProb | Log probability information for output tokens. |
ServiceTierEnum | The service tier for request processing. |
StreamOptionsParam | Options for streaming responses. |
TopLogProb | Log probability information for a token. |
TruncationEnum | Controls message truncation behavior. |
UrlCitationBody | URL citation in response. |
UrlCitationParam | URL citation in request. |
Usage | Token usage statistics. |
VerbosityEnum | The verbosity level for responses. |
Protocolsβ
FastAPIRequestProtocol | Minimal protocol for FastAPI/Starlette Request objects. |
|---|
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!