From c168703d5e32d1e920945c1e3dda3a0c0f76eb27 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 16 Dec 2024 11:41:39 +0800 Subject: [PATCH 1/2] Pass the kwargs to _convert method when converting an url file --- src/markitdown/_markitdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.py index 96997cf..0866dac 100644 --- a/src/markitdown/_markitdown.py +++ b/src/markitdown/_markitdown.py @@ -1003,7 +1003,7 @@ class MarkItDown: self._append_ext(extensions, g) # Convert - result = self._convert(temp_path, extensions, url=response.url) + result = self._convert(temp_path, extensions, url=response.url, **kwargs) # Clean up finally: try: From d66ef5fccaa49b9a1b95e5e043ebc44f8a88f5a4 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 16 Dec 2024 12:08:51 +0800 Subject: [PATCH 2/2] Update README to introduce the customized mlm_prompt --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index df7189d..3eac77b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ result = markitdown.convert("test.xlsx") print(result.text_content) ``` -You can also configure markitdown to use Large Language Models to describe images. To do so you must provide mlm_client and mlm_model parameters to MarkItDown object, according to your specific client. +You can also configure markitdown to use Large Language Models to describe images. To do so you must provide `mlm_client` and `mlm_model` parameters to MarkItDown object, according to your specific client. ```python from markitdown import MarkItDown @@ -51,6 +51,13 @@ result = md.convert("example.jpg") print(result.text_content) ``` +The prompt of describing images can be customized by providing `mlm_prompt` parameter. + +```python +# ... +result = md.convert("example.jpg", mlm_prompt="Customized prompt") +``` + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a