queries
log_query
Log a query (and optionally response) for a locally deployed (non-Unify-registered) model, with tagging (default None) and timestamp (default datetime.now() also optionally writeable.
Arguments:
endpoint
- Endpoint to log query for.query_body
- A dict containing the body of the request.response_body
- An optional dict containing the response to the request.tags
- Custom tags for later filtering.timestamp
- A timestamp (if not set, will be the time of sending).api_key
- If specified, unify API key to be used. Defaults to the value in theUNIFY_KEY
environment variable.
Returns:
A dictionary containing the response message if successful.
Raises:
requests.HTTPError
: If the API request fails.