LaunchLLM / domain_templates /legal_advisor.py
Bmccloud22's picture
Deploy LaunchLLM - Production AI Training Platform
ec8f374 verified
"""
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"
}
]