Skip to content

Conversation

jxnl
Copy link
Collaborator

@jxnl jxnl commented Jul 7, 2025

Summary

  • filter unsupported Google GenAI image harm categories
  • update tests for new supported list

Testing

  • pre-commit run --files instructor/utils.py tests/llm/test_genai/test_utils.py
  • pytest tests/llm/test_genai/test_utils.py -q
  • pytest tests/ -k "not docs" -q (fails: ModuleNotFoundError: No module named 'pytest_examples')

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


Important

Filter unsupported image-related harm categories in update_genai_kwargs for Google GenAI and update tests accordingly.

  • Behavior:
    • update_genai_kwargs in instructor/utils.py now filters out unsupported image-related harm categories for Google GenAI.
    • Only non-image harm categories are included in safety_settings.
  • Testing:
    • Updated tests in test_utils.py to check for correct filtering of harm categories.
    • Tests ensure safety_settings only includes supported categories.
    • Verified that None values are not set in the result.
  • Misc:
    • Ran pre-commit and pytest to ensure no errors in instructor/utils.py and test_utils.py.

This description was created by Ellipsis for 5f0ee63. You can customize this summary. It will automatically update as commits are pushed.

@github-actions github-actions bot added enhancement New feature or request python Pull requests that update python code size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 7, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 5f0ee63 in 53 seconds. Click for details.
  • Reviewed 78 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. instructor/utils.py:805
  • Draft comment:
    Good filtering of harm categories; consider renaming the loop variable (e.g. use 'category' instead of 'c') for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 85% None
2. tests/llm/test_genai/test_utils.py:37
  • Draft comment:
    The filtering logic for supported_categories is duplicated in multiple tests. Consider extracting it to a helper to adhere to DRY.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 85% None

Workflow ID: wflow_2Voj85ZfCGaDIgBB

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@jxnl jxnl merged commit 22a5bdc into main Jul 7, 2025
4 of 14 checks passed
@jxnl jxnl deleted the codex/investigate-and-fix-issue-#1658 branch July 7, 2025 20:50
@lukaLLM
Copy link

lukaLLM commented Aug 13, 2025

I experience something related to this issue again on new version I think #1773.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex enhancement New feature or request python Pull requests that update python code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants