MCPcopy Create free account
hub / github.com/PaddlePaddle/PaddleOCR / submit_url

Method submit_url

paddleocr/_api_client/_async_http.py:80–106  ·  view source on GitHub ↗
(
        self,
        model: str,
        file_url: str,
        optional_payload: dict,
        page_ranges: Optional[str] = None,
        batch_id: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

78 return headers
79
80 async def submit_url(
81 self,
82 model: str,
83 file_url: str,
84 optional_payload: dict,
85 page_ranges: Optional[str] = None,
86 batch_id: Optional[str] = None,
87 ) -> str:
88 body = {
89 "fileUrl": file_url,
90 "model": model,
91 "optionalPayload": optional_payload,
92 }
93 if page_ranges is not None:
94 body["pageRanges"] = page_ranges
95 if batch_id is not None:
96 body["batchId"] = batch_id
97
98 await self._ensure_session()
99 async with self._session.post(
100 self._jobs_url,
101 json=body,
102 headers={"Content-Type": "application/json"},
103 ) as resp:
104 await self._raise_for_response(resp)
105 data = await self._response_data(resp)
106 return extract_job_id(data)
107
108 async def submit_file(
109 self,

Callers

nothing calls this directly

Calls 5

_ensure_sessionMethod · 0.95
_raise_for_responseMethod · 0.95
_response_dataMethod · 0.95
extract_job_idFunction · 0.85
postMethod · 0.45

Tested by

no test coverage detected