usage
with_logging
Wrap a local model callable with logging of the queries.
Arguments:
model_fn
- The model callable to wrap logging around.endpoint
- The endpoint name to give to this local callable.tags
- Tags for later filtering.timestamp
- A timestamp (if not set, will be the time of sending).log_query_body
- Whether or not to log the query body.log_response_body
- Whether or not to log the response body.api_key
- If specified, unify API key to be used. Defaults to the value in theUNIFY_KEY
environment variable.
Returns:
A new callable, but with logging added every time the function is called.
Raises:
requests.HTTPError
: If the API request fails.