This API provides legal assistance by allowing users to upload PDF documents and submit queries for various legal services, including legal advisory, report generation, and case outcome prediction.
https://navilaw-ai.onrender.com/legal-assistance/
POST
/legal-assistance/
Parameter | Type | Required | Description |
---|---|---|---|
query |
string |
Yes | A string representing the legal query the user wishes to ask. |
option |
string |
Yes | A string indicating the type of legal assistance required. Possible values are "Legal Advisory", "Legal Report Generation", and "Case Outcome Prediction". |
files |
List[UploadFile] |
Yes | A list of PDF files containing legal documents to be analyzed. |
POST /legal-assistance/ HTTP/1.1
Host: https://navilaw-ai.onrender.com/
Content-Type: multipart/form-data
--boundary
Content-Disposition: form-data; name="query"
What are the possible outcomes of my case?
--boundary
Content-Disposition: form-data; name="option"
Case Outcome Prediction
--boundary
Content-Disposition: form-data; name="files"; filename="legal_case.pdf"
Content-Type: application/pdf
<PDF file content>
--boundary--
- Status Code:
200 OK
- Content-Type:
application/json
- For Legal Advisory:
{
"result": "Based on the provided documents and the legal query, here are the considerations to keep in mind regarding your case..."
}
- For Legal Report Generation:
{
"report": "Legal Report:\n\n1. Introduction\n2. Case Details\n3. Analysis\n4. Conclusion"
}
- For Case Outcome Prediction:
{
"prediction": "Based on the analysis of the legal precedents and the court's decision in a similar case, there is a 70% chance of a favorable outcome for Fast Retail in their lawsuit against Tech Solutions. The court ruled in favor of Fast Retail, ordering Tech Solutions to pay damages of ₹60,00,000. The uncertainty lies in the court's consideration of not all claimed damages were directly attributable to Tech Solutions' breach. It's crucial to consider this when predicting the outcome."
}
- Status Code:
400 Bad Request
- Content-Type:
application/json
{
"detail": "Please upload at least one PDF file."
}
- If no files are uploaded:
{
"detail": "Please upload at least one PDF file."
}
- If no query is provided:
{
"detail": "Please enter a query."
}
- If an invalid option is selected:
{
"detail": "Invalid option selected."
}
POST /legal-assistance/
With the following form data:
- query: "What are the implications of the new law on my case?"
- option: "Legal Advisory"
- files: (Upload PDF:
law_document.pdf
)
{
"result": "The new law may affect your case in several ways, particularly regarding..."
}
POST /legal-assistance/
With the following form data:
- query: "Generate a report on the recent legal changes."
- option: "Legal Report Generation"
- files: (Upload PDF:
legal_changes.pdf
)
{
"report": "Legal Report:\n\n1. Introduction\n2. Summary of Changes\n3. Implications\n4. Conclusion"
}
POST /legal-assistance/
With the following form data:
- query: "What is the likelihood of winning my case based on previous rulings?"
- option: "Case Outcome Prediction"
- files: (Upload PDF:
previous_rulings.pdf
)
{
"prediction": "Based on the analysis of the legal precedents and the court's decision in a similar case, there is a 70% chance of a favorable outcome for Fast Retail in their lawsuit against Tech Solutions..."
}