IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python function

retrieve_input_text

retrieve_input_text()โ€‹

max.pipelines.lib.request_text.retrieve_input_text(request)

source

Returns the prompt text carried by request.

Accepts the three input shapes the API allows: a bare string, a message list whose first message holds a string, or a message list whose first message holds content parts (whose text parts are joined with spaces).

Parameters:

request (OpenResponsesRequest) โ€“ The request to read the prompt from.

Returns:

The prompt text.

Raises:

ValueError โ€“ If the request carries no text to use as a prompt.

Return type:

str