chore(backend): save remaining API and deployment changes
Expose frozen factual review policy, update API descriptions and Swagger settings, and adjust local deployment and embedding connectivity. Include the requested extraction candidates and review-policy regression coverage. Validation: 31 OCR policy tests passed; staged diff whitespace checks passed.
This commit is contained in:
@@ -9,7 +9,7 @@ from app.infrastructure.intake_repository import administrator, document_status
|
||||
from app.infrastructure.worker_repository import SqlWorkerRepository
|
||||
from app.modules.documents.errors import IntakeError
|
||||
from app.modules.documents.review import pending_review, reviews_approved
|
||||
from app.modules.documents.extraction_artifacts import ocr_review_required
|
||||
from app.modules.documents.extraction_artifacts import ocr_review_required, factual_review_required
|
||||
|
||||
|
||||
def encode_cursor(document):
|
||||
@@ -57,6 +57,7 @@ class DocumentQueries:
|
||||
review_required=pending_review(state), review_state=review_state,
|
||||
extraction_quality_decision=quality,
|
||||
ocr_review_required=ocr_review_required(row['processing_profile']),
|
||||
factual_review_required=factual_review_required(row['processing_profile']),
|
||||
job=dict(id=job['id'], status=job['status'], stage=job['stage'],
|
||||
attempt_count=job['attempt_count'], retry_generation=job['retry_generation'],
|
||||
can_retry=can_retry, error=(dict(code=job['error_code'],
|
||||
|
||||
@@ -193,7 +193,11 @@ class OpenAICompatibleEmbeddings:
|
||||
body = dict(model=identity.model, input=texts, encoding_format="float")
|
||||
if self.send_dimensions:
|
||||
body["dimensions"] = identity.dimensions
|
||||
request = Request(identity.endpoint.rstrip("/") + "/embeddings",
|
||||
endpoint = identity.endpoint
|
||||
from pathlib import Path
|
||||
if Path("/.dockerenv").exists():
|
||||
endpoint = endpoint.replace("://localhost:", "://host.docker.internal:").replace("://127.0.0.1:", "://host.docker.internal:")
|
||||
request = Request(endpoint.rstrip("/") + "/embeddings",
|
||||
data=json.dumps(body, allow_nan=False).encode("utf-8"),
|
||||
headers={"Authorization": "Bearer " + self._key, "Content-Type": "application/json"})
|
||||
content = self._request_once(request)
|
||||
|
||||
Reference in New Issue
Block a user