Skip to content

Commit

Permalink
Add example of using MarkItDown with OpenAI to README
Browse files Browse the repository at this point in the history
Add an example of using MarkItDown with OpenAI integration to the `README.md`.

* Add a new section "Example with OpenAI Integration".
* Include code to import `MarkItDown` and `OpenAI`.
* Show initializing the `OpenAI` client.
* Demonstrate converting an image file using `MarkItDown` with the `OpenAI` client.
  • Loading branch information
gagb committed Dec 13, 2024
1 parent b401396 commit afca0a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ result = markitdown.convert("test.xlsx")
print(result.text_content)
```

## Example with OpenAI Integration

```python
from markitdown import MarkItDown
from openai import OpenAI

client = OpenAI()
md = MarkItDown(mlm_client=client, mlm_model="gpt-4o")
image_file = 'https://gagb.github.io/imgs/bansal-chi21.png'
result = md.convert(source=image_file)
print(result.text_content)
```

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand Down

0 comments on commit afca0a8

Please sign in to comment.