Download services/legalsync_agent.py from AnthropicallyHuggingFaces/legalsync: direct link, hf CLI and curl.
- Browser
- Download file 1.78 kB
-
https://huggingface.co/spaces/AnthropicallyHuggingFaces/legalsync/resolve/main/services/legalsync_agent.py
- Command line
-
hf download hf://spaces/AnthropicallyHuggingFaces/legalsync/services/legalsync_agent.py
-
curl -L -o legalsync_agent.py https://huggingface.co/spaces/AnthropicallyHuggingFaces/legalsync/resolve/main/services/legalsync_agent.py
1.78 kB
| """ | |
| LegalSync Orchestrator Agent — main entry point. | |
| Validated against the DataRobot Agentic AI framework (`MyAgent.invoke` | |
| pattern): the agent wires the sub-processors and exposes a workflow router | |
| consumed by workload_app.py. Runs over the DataRobot Workload API (any HTTP | |
| container) with Groq / DataRobot LLM Gateway for any model calls (00-core). | |
| """ | |
| from services.omnipay_payment_processor import OmniPayProcessor | |
| from services.oracle_trust_fund_processor import TrustFundProcessor | |
| from services.whisper_bodycam_transcriber import BodycamTranscriber | |
| from services.discovery_assembler import DiscoveryAssembler | |
| from services.bond_recommendation_agent import BondRecommendationAgent | |
| class LegalSyncAgent: | |
| def __init__(self): | |
| self.payments = OmniPayProcessor() | |
| self.trust = TrustFundProcessor() | |
| self.transcriber = BodycamTranscriber() | |
| self.discovery = DiscoveryAssembler() | |
| self.bond = BondRecommendationAgent() | |
| def run_workflow(self, workflow_type, payload): | |
| """Workflow router (MyAgent.invoke pattern).""" | |
| if workflow_type == "payment": | |
| return self.payments.process(**payload) | |
| elif workflow_type == "trust-fund": | |
| return self.trust.get_balance(payload.get("inmate_id")) | |
| elif workflow_type == "transcription": | |
| return self.transcriber.transcribe(payload.get("video_path")) | |
| elif workflow_type == "discovery": | |
| return self.discovery.assemble(payload.get("case_id"), payload.get("transcripts", []), payload.get("bodycams", [])) | |
| elif workflow_type == "bond": | |
| return self.bond.recommend(payload) | |
| return {"status": "unknown workflow", "supported": ["payment", "trust-fund", "transcription", "discovery", "bond"]} | |