Skip to content

Commit

Permalink
add file links and note about wait_for_extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
rishiraj authored May 26, 2024
1 parent 229ae62 commit 36bffe4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@ client.create_extraction_graph(extraction_graph)

#### Upload an Audio
```python
content_id = client.upload_file("audiosummary", "file.mp3")
with open("sample.mp3", 'wb') as file:
file.write((requests.get("https://extractor-files.diptanu-6d5.workers.dev/sample-000009.mp3")).content)
content_id = client.upload_file("audiosummary", "sample.mp3")
```

Adding Texts and Files can be a time consuming process and by default we allow asynchronous ingestion for parallel operations. However the following codes might fail until the extraction has been completed. To make it a blocking call, use 'client.wait_for_extraction(content_id)' after getting the content_id from above.

#### Retrieve Summary
```python
client.get_extracted_content(content_id)
Expand Down Expand Up @@ -148,7 +152,9 @@ client.create_extraction_graph(extraction_graph)

#### Upload Images
```python
content_id = client.upload_file("imageknowledgebase", "file.jpg")
with open("sample.jpg", 'wb') as file:
file.write((requests.get("https://extractor-files.diptanu-6d5.workers.dev/people-standing.jpg")).content)
content_id = client.upload_file("imageknowledgebase", "sample.jpg")
```

#### Retrieve Features of an Image
Expand Down Expand Up @@ -183,7 +189,9 @@ client.create_extraction_graph(extraction_graph)

#### Upload a Document
```python
content_id = client.upload_file("pdfqa", "file.pdf")
with open("sample.pdf", 'wb') as file:
file.write((requests.get("https://extractor-files.diptanu-6d5.workers.dev/scientific-paper-example.pdf")).content)
content_id = client.upload_file("pdfqa", "sample.pdf")
```

#### Get Text, Image and Tables
Expand Down

0 comments on commit 36bffe4

Please sign in to comment.