Skip to content

Commit

Permalink
Test for PPTX conversion with OpenAI client
Browse files Browse the repository at this point in the history
Signed-off-by: Hankyeol Kyung <[email protected]>
  • Loading branch information
keenranger committed Dec 27, 2024
1 parent 9449d5b commit 06ccea5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file modified tests/test_files/test.pptx
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/test_markitdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,26 @@ def test_markitdown_llm() -> None:
assert test_string in result.text_content.lower()


@pytest.mark.skipif(
skip_llm,
reason="do not run llm tests without a key",
)
def test_markitdown_pptx_llm() -> None:
client = openai.OpenAI()
markitdown = MarkItDown(llm_client=client, llm_model="gpt-4o-mini")

result = markitdown.convert(os.path.join(TEST_FILES_DIR, "test.pptx"))

# like test_markitdown_llm, this should be improved
for test_string in ["red", "blue"]:
assert test_string in result.text_content.lower()


if __name__ == "__main__":
"""Runs this file's tests from the command line."""
test_markitdown_remote()
test_markitdown_local()
test_markitdown_exiftool()
test_markitdown_deprecation()
test_markitdown_llm()
test_markitdown_pptx_llm()

0 comments on commit 06ccea5

Please sign in to comment.