| """ |
| 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() |
|
|