nemoguardrails.http.transport
HTTPX transport adapter for the transport-neutral HTTP client contract.
Module Contents
Classes
Functions
Data
API
Adapt an HTTPX asynchronous client to the neutral HTTP contract.
A client created by this adapter is owned and closed by the adapter. An injected client remains owned by its caller. The configured timeout covers the complete request rather than each HTTPX timeout phase independently.
Return this client from an asynchronous context manager.
Close owned resources when leaving an asynchronous context.
Close the owned HTTPX client at most once.
Send one request and materialize the HTTPX response.
Parameters:
HTTP method.
Absolute request URL.
Optional request headers.
Optional query parameters.
Optional JSON-serializable request body.
Optional raw request body.
Optional per-request total timeout in seconds.
Returns: HTTPResponse
A neutral response containing copied headers and body bytes.
Raises:
HTTPTimeoutError: If the request exceeds its total timeout.HTTPConnectionError: If HTTPX reports a request failure.ValueError: If the per-request timeout is not positive.