Spaces:
Sleeping
Sleeping
GPT35_PRICING = { | |
"input":0.0015, | |
"output":0.002 | |
} | |
########################### Entity extraction | |
ENTITY_EXTRACTION_PROMPT = f""" | |
Being a german insurance document reviewing expert, your task is to perform a step by step review of the insurance provided to ease job of clients. | |
It is crucial to avoid hallucinations or adding any information not present in the document. | |
The data has personal data masked with the entity type followed by a number to make sure the | |
confidential data is preserved. | |
--------------------------------- | |
Rules on data extraction :: | |
Make sure the data and entities extracted are as from the document with same language and no information | |
to be added that is not present in the document. | |
I know you’ll do great! | |
""" | |
ENTITY_EXTRACTION_FUNCTION = [ | |
{ | |
'name': 'extract_insurance_info', | |
'description': 'Extract insurance information from the document. Make sure to extract \ | |
only if data is present and not to generate data not present in the document. I know you’ll do great!', | |
'parameters': { | |
'type': 'object', | |
'properties': { | |
'sum_insured': { | |
'type': 'string', | |
'description': 'The maximum amount that will be paid in event of claim' | |
}, | |
'scope_of_cover':{ | |
'type':'array', | |
'description':'All relevant scope of insurance cover related information present in the document. ', | |
'items': { | |
'type':'object', | |
'properties':{ | |
'scope': { 'type': "string", 'description': "Scope of insurance cover related information found in the document" }, | |
} | |
}}, | |
'special_conditions':{ | |
'type':'array', | |
'description':'All special conditions related information present in the document. exclusions, special agreements,conditions, etc.', | |
'items': { | |
'type':'object', | |
'properties':{ | |
'condition': { 'type': "string", 'description': "exclusions, special condition or terms provided in the document" }, | |
} | |
}}, | |
'notice_period_to_terminate_insurace':{ | |
'type':'number', | |
'description': 'Date or time period a party has to give prior intimation/notice to terminate the insurance. Eg:30 days' | |
}, | |
'contract_term':{ | |
'type':'string', | |
'description': 'Time period for which the insurace will be valid. Eg. 1year, 3years' | |
}, | |
'excess_amount': { | |
'type': 'string', | |
'description': 'amount that the insured person is responsible in the event of claim.' | |
}, | |
'total_premium_amount': { | |
'type': 'string', | |
'description': 'total amount of insurance premium to be paid over the contract period' | |
}, | |
'premium_amount': { | |
'type': 'string', | |
'description': 'amount of insurance premium to be paid at a specific interval' | |
}, | |
'premium_interval': { | |
'type': 'string', | |
'description': 'interval over which the insurance premium has to be paid' | |
}, | |
} | |
} | |
} | |
] | |
########################### Claim rejection | |
CLAUSE_REJECTION_SYSTEM_PROMPT = f""" | |
From the given details of insurance document, explain with good reasoning skills based on the \ | |
query why the claim was rejected. | |
""" | |
CLAUSE_REJECTION_FUNCTION = [ | |
{ | |
'name': 'clause_rejection_reason', | |
'description': 'given the insurance details and the query explain the reason for rejection', | |
'parameters': { | |
'type': 'object', | |
'properties': { | |
'reason': { | |
'type': 'string', | |
'description': 'reason to the provided query for claim rejection based on the insurance details' | |
} | |
}, | |
'required': ['answer'], | |
} | |
} | |
] | |
########################### Insurance document FAQ | |
DOCUMENT_FAQ_SYSTEM_PROMPT = f""" | |
From the given document, answer the question asked. | |
""" | |
DOCUMENT_FAQ_FUNCTION = [ | |
{ | |
'name': 'document_faq', | |
'description': 'answer the question given the insurance document details.', | |
'parameters': { | |
'type': 'object', | |
'properties': { | |
'answer': { | |
'type': 'string', | |
'description': 'answer to the provided question based on the document' | |
} | |
}, | |
'required': ['answer'], | |
} | |
} | |
] | |
########################### Intent classification | |
INTENT_CLASSIFICATION_PROMPT = f""" | |
You are in charge of identifying the chatbot intent or the category of the question asked to a chatbot provided the given intents. | |
""" | |
INTENT_CLASSIFICATION_FUNCTION = [ | |
{ | |
'name': 'intent_classification', | |
'description': 'classify the chatbot intent given the question asked by a user', | |
'parameters': { | |
'type': 'object', | |
'properties': { | |
'intent': { | |
'type': 'string', | |
"enum": ["document faq", "claim rejection"], | |
'description': 'answer to the provided question based on the document' | |
} | |
}, | |
'required': ['intent'], | |
} | |
} | |
] | |