Spaces:
Sleeping
Sleeping
| # services/agents/signature_verification_agent.py | |
| """ | |
| Signature Verification Agent - Wraps utilities/signature_verification.py | |
| """ | |
| from typing import Dict, Any | |
| from services.agents.base_agent import BaseUtilityAgent | |
| from utilities.signature_verification import signature_verification_remote | |
| class SignatureVerificationAgent(BaseUtilityAgent): | |
| """ | |
| Autonomous agent for signature detection and verification. | |
| """ | |
| def __init__(self): | |
| super().__init__( | |
| name="signature_verification", | |
| role="Signature Verification Specialist", | |
| goal="Detect and verify signatures in documents with high accuracy", | |
| backstory="""You are an expert in signature detection and document authentication. | |
| You can identify handwritten signatures, distinguish them from printed text, | |
| and assess signature presence and characteristics. You validate verification | |
| results for accuracy and completeness.""", | |
| utility_function=signature_verification_remote | |
| ) | |
| def _prepare_task_description(self, input_data: Dict[str, Any]) -> str: | |
| """Prepare task description for the agent.""" | |
| filename = input_data.get("filename", "document") | |
| start_page = input_data.get("start_page", 1) | |
| end_page = input_data.get("end_page", 1) | |
| return f"""Validate signature verification results from {filename} (pages {start_page}-{end_page}). | |
| Assess verification quality: | |
| - Detection: Were all signatures identified? | |
| - Accuracy: Are detections true signatures (not false positives)? | |
| - Completeness: Are signature locations and characteristics captured? | |
| - Verification indicators: Are authenticity indicators reliable? | |
| Provide confidence score (0.0-1.0).""" | |