Add example of using MarkItDown with OpenAI to README
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.
This commit is contained in:
parent
b40139652b
commit
afca0a8a87
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue