Expand description
Shared HTTP request/response handling logic
Structs§
- Body
TooLarge - The request body exceeded
MAX_REQUEST_BODY_BYTES(or could not be read). - Request
Data - Extracted request data common to HTTP and HTTP/2
- Request
Filter - 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
Responsefrom 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.