Spaces:
Runtime error
Runtime error
File size: 7,539 Bytes
ec8f374 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
"""
Legal Advisor domain template.
"""
from typing import List
from .base_domain import BaseDomain
class LegalAdvisorDomain(BaseDomain):
"""
Legal information assistant domain for legal education,
document understanding, and general legal guidance.
"""
def __init__(self):
super().__init__()
self._name = "Legal Advisor"
self._description = "Legal information assistant for legal education, document understanding, rights explanation, and general legal guidance. NOT a replacement for licensed legal counsel."
self._icon = "#"
def get_topics(self) -> List[str]:
"""Get legal advisor topics"""
return [
"Contract Law",
"Employment Law",
"Real Estate Law",
"Family Law",
"Estate Planning",
"Business Formation",
"Intellectual Property",
"Criminal Law Basics",
"Consumer Rights",
"Landlord-Tenant Law",
"Personal Injury",
"Bankruptcy",
"Immigration Law",
"Tax Law Basics",
"Nonprofit Law",
"Civil Rights",
"Privacy Law",
"Data Protection",
"Terms of Service",
"Privacy Policies",
"Non-Disclosure Agreements (NDA)",
"Employment Contracts",
"Lease Agreements",
"Purchase Agreements",
"Wills and Trusts",
"Power of Attorney",
"Healthcare Directives",
"Small Claims Court",
"Mediation and Arbitration",
"Trademark and Copyright",
"Patents",
"Trade Secrets",
"LLC vs Corporation",
"Sole Proprietorship",
"Partnership Agreements",
"Shareholder Agreements",
"Operating Agreements",
"Divorce and Custody",
"Adoption",
"Prenuptial Agreements"
]
def get_system_prompt(self) -> str:
"""Get legal advisor system prompt"""
return """You are a knowledgeable legal information assistant with understanding of:
- Contract law and agreement interpretation
- Business law and entity formation
- Employment law and workplace rights
- Real estate transactions and landlord-tenant issues
- Family law matters (divorce, custody, adoption)
- Estate planning (wills, trusts, powers of attorney)
- Intellectual property basics (copyright, trademark, patent)
- Consumer rights and protections
- Civil procedure and court processes
- Legal terminology and document structure
Your role is to:
1. Provide general legal information and education
2. Explain legal concepts in plain language
3. Help users understand their rights and obligations
4. Clarify legal terminology and document provisions
5. Outline general legal processes and procedures
6. Identify when professional legal help is necessary
CRITICAL LIMITATIONS:
- You are NOT a licensed attorney
- You do NOT provide legal advice specific to individual situations
- You do NOT create binding legal documents
- You do NOT represent clients in legal matters
- You CANNOT substitute for consultation with a licensed attorney
- Laws vary by jurisdiction - always verify local laws
Guidelines:
- Provide educational information, not legal advice
- Explain general legal principles and processes
- Clarify when laws vary by state/jurisdiction
- Emphasize the importance of consulting licensed attorneys
- Recommend seeking legal counsel for specific situations
- Explain the difference between legal information and legal advice
- Never guarantee legal outcomes
- Acknowledge complexity and nuance in law
LEGAL DISCLAIMER: This assistant provides general legal information only and does not constitute legal advice. Laws vary significantly by jurisdiction, and every legal situation has unique factors. For specific legal advice tailored to your situation, always consult with a licensed attorney in your jurisdiction. No attorney-client relationship is formed through this interaction."""
def get_example_questions(self) -> List[str]:
"""Get example legal questions"""
return [
"What's the difference between an LLC and a corporation?",
"What should be included in an employment contract?",
"How does a non-disclosure agreement (NDA) work?",
"What are my rights as a tenant?",
"What's the difference between a will and a trust?",
"How do I protect my intellectual property?",
"What happens if I breach a contract?",
"What are the basic steps in a civil lawsuit?",
"What should I know before signing a lease?",
"How do I apply for a trademark?"
]
def get_specialized_tools(self) -> List[dict]:
"""Get legal advisor tools"""
return [
{
"name": "analyze_contract_clause",
"description": "Analyze and explain contract clauses",
"parameters": {
"clause_text": "string",
"contract_type": "string (employment, lease, purchase, etc.)"
},
"returns": "Plain language explanation and key considerations"
},
{
"name": "check_statute_of_limitations",
"description": "Check statute of limitations for legal claims",
"parameters": {
"claim_type": "string (personal_injury, contract_breach, etc.)",
"jurisdiction": "string (state)",
"incident_date": "date (optional)"
},
"returns": "Time limit information and deadline calculation"
},
{
"name": "lookup_legal_term",
"description": "Define legal terminology",
"parameters": {
"term": "string"
},
"returns": "Plain language definition with examples"
},
{
"name": "compare_business_entities",
"description": "Compare different business entity types",
"parameters": {
"entity_types": "list (LLC, C-Corp, S-Corp, Partnership, etc.)",
"comparison_factors": "list (taxation, liability, formation, etc.)"
},
"returns": "Comparison table with pros and cons"
},
{
"name": "get_court_filing_requirements",
"description": "Get court filing requirements and procedures",
"parameters": {
"case_type": "string (small_claims, civil, family, etc.)",
"jurisdiction": "string (state and county)",
"action_type": "string (file_complaint, respond, appeal, etc.)"
},
"returns": "Filing requirements, fees, and procedures"
},
{
"name": "check_ip_availability",
"description": "Check trademark/business name availability",
"parameters": {
"name": "string",
"ip_type": "string (trademark, business_name, domain)",
"category": "string (industry/goods category)"
},
"returns": "Availability status and similar existing registrations"
}
]
|