Skip to content

Commit e7889aa

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents e2b4c99 + 2c7b355 commit e7889aa

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To have multiple tasks runing at once - for concurrent processing please run the
8787
celery -A main.celery worker --loglevel=info --pool=solo & # to scale by concurrent processing please run this line as many times as many concurrent processess you want to have running
8888
```
8989

90-
## Free online demo
90+
## Online demo
9191

9292
To try out the application with our hosted version you can skip the Getting started and try out the CLI tool against our cloud:
9393

@@ -105,6 +105,8 @@ export RESULT_URL=https://doctractor:Aekie2ao@api.doctractor.com/ocr/result/
105105
python client/cli.py ocr_upload --file examples/example-mri.pdf --ocr_cache --prompt_file=examples/example-mri-remove-pii.txt
106106
```
107107

108+
[Demo Source code](https://github.com/CatchTheTornado/pdf-extract-api-demo)
109+
108110
**Note:** In the free demo we don't guarantee any processing times. The API is Open so please do **not send any secret documents neither any documents containing personal information**, If you do - you're doing it on your own risk and responsiblity.
109111

110112
<img src="screenshots/demo.png" alt="Demo screenshot" />
@@ -312,6 +314,35 @@ python client/cli.py clear_cache
312314
python llm_generate --prompt "Your prompt here"
313315
```
314316

317+
## API Clients
318+
319+
You might want to use the decdicated API clients to use `pdf-extract-api`
320+
321+
### Typescript
322+
323+
There's a dedicated API client for Typescript - [pdf-extract-api-client](https://github.com/CatchTheTornado/pdf-extract-api-client) and the `npm` package by the same name:
324+
325+
```bash
326+
npm install pdf-extract-api-client
327+
```
328+
329+
Usage:
330+
331+
```js
332+
import { ApiClient, OcrRequest } from 'pdf-extract-api-client';
333+
const apiClient = new ApiClient('https://api.doctractor.com/', 'doctractor', 'Aekie2ao');
334+
const formData = new FormData();
335+
formData.append('file', fileInput.files[0]);
336+
formData.append('prompt', 'Convert file to JSON and return only JSON'); // if not provided, no LLM transformation will gonna happen - just the OCR
337+
formData.append('strategy', 'marker');
338+
formData.append('model', 'llama3.1')
339+
formData.append('ocr_cache', 'true');
340+
341+
apiClient.uploadFile(formData).then(response => {
342+
console.log(response);
343+
});
344+
```
345+
315346
## Endpoints
316347

317348
### OCR Endpoint via File Upload / multiform data

0 commit comments

Comments
 (0)