Authorize the provided request.
Represents an authorization request.
Attributes: conversation_id (Optional[str]): The unique identifier for the conversation. This is the parent for all the prompts and replies in the thread. request_id (str): The unique identifier for the request. Both prompts and responses have unique requestIds and in a conversation, they will share the same conversationId. thread_id (str): If this is a reply or enriched_prompts, then threadId is the requestId of the prompt. This helps in associating the enriched_prompt and replies with the prompt. sequence_number (int): Sequence number of the messages within the request. E.g., user prompt might lead to multiple enriched prompts. Sequence starts from 1. application_key (str): AI application key. This is mandatory for all requests. Ideally, this should come from the plugin. client_application_key (str): Client application key. If not sent, unknown will be used. enforce (bool): Whether the actions are enforced or not. Defaults to True. user_id (str): The unique identifier for the user. request_type (str): The type of request. Valid values are: prompt, reply, enriched_prompt. traits (List[str]): List of traits. context (Optional[Dict[str, Any]]): Additional context as list of key-value pairs. request_date_time (datetime): Date and time of the request. If not sent by client, server will generate one and return in the response.
Successful Response
Represents an authorization response.
Attributes: authorized (bool): Whether the request is authorized or not. enforce (bool): Whether to enforce the request or not. request_id (str): Id of the request. request_date_time (datetime): Date and time of the request. user_id (str): Id of the user. application_name (str): Name of the AI application. masked_traits (Optional[Dict[str, str]]): Traits to be masked. context (Optional[Dict[str, Any]]): Additional context as list of key-value pairs. status_code (int): Request status code. Zero means success. Non-zero means failure. status_message (str): Message associated with the status code. reason (str): Reason for the status code. paig_policy_ids (List[int]): List of Paig audit ids.