LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
from rest_framework import status
from rest_framework.exceptions import APIException
class SearchUnavailable(APIException):
"""Search cannot answer because of database errors a retry may clear
(unreachable, timed out, locked) or an unusable connection. The client
may retry; never "no matches".
"""
status_code = status.HTTP_503_SERVICE_UNAVAILABLE
default_detail = "Search is temporarily unavailable."
default_code = "search_unavailable"
class SearchFailed(APIException):
"""Every searched type failed, and not all with retryable database
errors -- most likely a bug, so retrying will not help.
"""
status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
default_detail = "Search failed."
default_code = "search_failed"