Learn how to log inputs and outputs to Quotient.
app_name
(string): Name of your application. Core parameter used to identify the source of logs in the Quotient dashboard.environment
(string): Environment where your application is running (e.g., “dev”, “staging”, “prod”). Core parameter used to help segregate logs by deployment environment.tags
(object): Key-value pairs for categorizing and filtering logs. Useful for slicing analytics by dimensions like customer, feature, model version, etc. Example: {"model": "gpt-4", "feature": "customer-support"}
sample_rate
(float): Value that determines what percent of logs to persist. Valid range of 0.0 to 1.0. Defaults to 1.0.detections
(array): List of detection types to run. Available options:
DetectionType.HALLUCINATION
- Detects potential hallucinations in model outputsDetectionType.DOCUMENT_RELEVANCY
- Evaluates how relevant retrieved documents are to the user querydetection_sample_rate
(float): Value that determines what percent of logs to run detections on. Valid range of 0.0 to 1.0. Defaults to 0.0.user_query
(string): The input query or prompt sent to the model. Required when hallucination or document relevancy detection is enabled.model_output
(string): The response generated by the model. Required when hallucination detection is enabled.documents
(array): List of document contents used as context for the model. Can be strings or dictionaries with page_content
and optional metadata
. Used in hallucination detection and attribution analysis. Required when document relevancy detection is enabled. If a dictionary is passed, it must have the key page_content
, containing the document text, and optionally metadata
, containing any document metadata you want to capture about the document. Example:
documents
, message_history
, or instructions
is required when hallucination detection is enabled.message_history
(array): Previous messages in the conversation, following the OpenAI message format with role
and content
keys. Used in hallucination detection and attribution analysis. Example:
documents
, message_history
, or instructions
is required when hallucination detection is enabled.instructions
(array): List of instructions provided to the model. Used in hallucination detection and attribution analysis. Example:
documents
, message_history
, or instructions
is required.tags
(object): Additional tags to associate with each log entry. Example: {"model": "gpt-4", "feature": "customer-support"}
log_id
(string): A UUID representing the unique identifier for the logged event.logs
(array): An array of Log
objects containing the following fields:
id
(string): Unique identifier for the log entry.app_name
(string): Name of the application that generated the log.environment
(string): Environment where the log was generated (e.g., “dev”, “prod”).hallucination_detection
(boolean): Whether hallucination detection was enabled for this log.user_query
(string): The original user query or prompt that was logged.model_output
(string): The model’s response that was logged.documents
(array): List of documents used as context for the model. Can be strings or LogDocument objects.message_history
(array): Previous messages in the conversation, following the OpenAI message format.instructions
(array): List of instructions provided to the model.tags
(object): Dictionary of tags associated with the log entry.created_at
(datetime): Timestamp when the log was created.status
(string): Current status of the log entry.updated_at
(datetime): Timestamp when the log was last updated.has_hallucination
(boolean): Whether the model output was detected to contain hallucinations.hallucination_detection_sample_rate
(float): Sample rate used for hallucination detection.evaluations
(array): List of evaluation results for the log entry.