Skip to main content

Module handler

Module handler 

Source
Expand description

Shared HTTP request/response handling logic

Structs§

BodyTooLarge
The request body exceeded MAX_REQUEST_BODY_BYTES (or could not be read).
RequestData
Extracted request data common to HTTP and HTTP/2
RequestFilter
A per-server request allowlist parsed from startup_params.

Constants§

MAX_REQUEST_BODY_BYTES
How much of a request body is read before the request is refused with 413.

Functions§

build_error_response
Build error response for LLM failures.
build_payload_too_large_response
The 413 answer for a request whose body exceeded MAX_REQUEST_BODY_BYTES.
build_response
Build HTTP response from LLM execution results
build_safe_response
Build a hyper Response from parts that came from the LLM or from server startup params, without ever panicking.
extract_request_data
Extract request data from hyper Request.
produced_http_response
Did the model produce a usable send_http_response?
request_handling_startup_parameters
Startup parameters describing the request filter, for get_startup_parameters(). Shared by HTTP/1.1 and HTTP/2 so the LLM sees the same schema and examples.