File size: 2,073 Bytes
038a93b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Generate sample drafted agreements for demonstration.
"""

from drafting_engine import ContractDraftingEngine, DraftingContext
from clause_retriever import ClauseRetriever


def main():
    retriever = ClauseRetriever(use_bm25=True, use_embeddings=False)
    engine = ContractDraftingEngine(retriever=retriever)

    samples = [
        DraftingContext(
            contract_type="saas_agreement",
            party_position="pro_company",
            deal_context="Enterprise SaaS for financial analytics. Customer is a mid-size bank.",
            business_constraints=["SOC 2 Type II", "annual billing", "99.9% uptime"],
            governing_law="Delaware",
            company_name="FinAnalytics Inc",
            counterparty_name="MidSize Bank",
        ),
        DraftingContext(
            contract_type="nda",
            party_position="balanced",
            deal_context="Mutual NDA for M&A discussions between two tech companies.",
            business_constraints=["3 year term", "mutual obligations", "return of information"],
            governing_law="California",
            company_name="TechCorp A",
            counterparty_name="TechCorp B",
        ),
        DraftingContext(
            contract_type="consulting_agreement",
            party_position="balanced",
            deal_context="Strategy consulting engagement for market entry.",
            business_constraints=["hourly billing", "work for hire", "non-solicitation"],
            governing_law="Delaware",
            company_name="Strategy Partners",
            counterparty_name="StartupCo",
        ),
    ]

    for ctx in samples:
        print(f"\n{'='*60}")
        print(f"SAMPLE: {ctx.contract_type} | {ctx.party_position}")
        print(f"{'='*60}")
        contract = engine.draft(ctx)
        md = engine.export(contract, fmt="markdown")
        print(md)
        fname = f"sample_{ctx.contract_type}_{ctx.party_position}.md"
        with open(fname, "w") as f:
            f.write(md)
        print(f"\nSaved to {fname}")


if __name__ == "__main__":
    main()