Skip to content

Conversation

@ultmaster
Copy link
Contributor

Summary

  • add tests covering dict, pydantic, openai_chat, and langchain outputs when poml renders image content

Testing

  • npm run build-webview
  • npm run build-cli
  • npm run lint
  • npm test
  • python -m pytest python/tests

https://chatgpt.com/codex/tasks/task_e_689160949998832e8036fdadbc483dc0

Copilot AI review requested due to automatic review settings August 5, 2025 05:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive test coverage for the POML (Prompt Markup Language) format functionality when rendering image content across different output formats. The tests verify that image content is correctly handled and formatted when converting POML markup to various API-specific formats.

  • Adds tests for four output formats: dict, pydantic, openai_chat, and langchain
  • Verifies correct image handling including base64 encoding, MIME type detection, and metadata preservation
  • Ensures proper data structure formatting for each target API format

Comment on lines +19 to +22

def test_poml_format_dict(tmp_path: Path):
img_path = _create_image(tmp_path)
markup = f'<p>Image <img src="{img_path}" alt="tiny" syntax="multimedia"/></p>'
Copy link

Copilot AI Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markup string is duplicated across all four test functions. Consider extracting this to a shared helper function or fixture to reduce code duplication and make the tests easier to maintain.

Suggested change
def test_poml_format_dict(tmp_path: Path):
img_path = _create_image(tmp_path)
markup = f'<p>Image <img src="{img_path}" alt="tiny" syntax="multimedia"/></p>'
def _make_markup(img_path: Path) -> str:
return f'<p>Image <img src="{img_path}" alt="tiny" syntax="multimedia"/></p>'
def test_poml_format_dict(tmp_path: Path):
img_path = _create_image(tmp_path)
markup = _make_markup(img_path)

Copilot uses AI. Check for mistakes.
@ultmaster ultmaster merged commit 0ba1ac2 into main Aug 5, 2025
3 checks passed
@ultmaster ultmaster deleted the codex/add-tests-for-poml.poml-formats branch August 27, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants