Skip to content

feat: add support for OpenAI 1.78 distribution #2911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Support for OpenAI 1.78 distribution

This PR adds support for OpenAI 1.78 distribution by updating the dependency constraints to allow compatible versions of litellm.

Changes

  • Update litellm dependency from ==1.68.0 to >=1.68.0,<1.72.0 to allow newer versions that support OpenAI 1.78
  • Add test to verify OpenAI 1.78 compatibility with multi-image input support

Testing

  • Verified that existing multimodal functionality still works with the updated dependencies
  • Added a specific test for OpenAI 1.78 compatibility with multi-image input support
  • Ran the full test suite to ensure no regressions

Related Issues

Resolves #2910

Link to Devin run

https://app.devin.ai/sessions/394ebba1c76843f1b67083d0d9e3e3b0

Requested by: Joe Moura (joao@crewai.com)

- Update litellm dependency to allow >=1.68.0,<1.72.0 for OpenAI 1.78 compatibility
- Add test to verify OpenAI 1.78 compatibility with multi-image input support
- Resolves #2910

Co-Authored-By: Joe Moura <joao@crewai.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@joaomdmoura
Copy link
Collaborator

Disclaimer: This review was made by a crew of AI Agents.

Code Review Comment for PR #2911 - OpenAI 1.78 Support

Overall Assessment

This pull request introduces necessary updates to the litellm dependency version and implements compatibility tests for OpenAI 1.78, particularly focusing on multi-image input support. Generally, the changes are well-structured, but a few areas require attention to enhance clarity, maintainability, and test reliability.

1. Dependencies Update (pyproject.toml)

Code Improvement Suggestions:

  • Rationale Documentation:
    It's good practice to provide a clear rationale for version constraints. Consider adding inline comments to explain why the minimum version requirement and upper bound are specific.
    Example:
    dependencies = [
        # litellm: v1.68.0+ required for OpenAI 1.78 compatibility
        # Upper bound <1.72.0 to ensure stability and prevent issues with breaking changes
        "litellm>=1.68.0,<1.72.0",
    ]

2. New Test File (test_openai_178_compatibility.py)

Strengths:

  • Well-documented tests that reference relevant issues.
  • Clear purpose and proper setup using pytest decorators.

Areas for Improvement:

  1. Environment Variable Handling:

    • Use pytest markers for tests that rely on external API keys. This enhances maintainability and clarity.
    • Suggested Implementation:
    @pytest.mark.requires_api_key
    def test_openai_178_compatibility_with_multimodal():
        """Test CrewAI compatibility with OpenAI 1.78.0 multi-image support."""
        if not os.getenv("OPENAI_API_KEY"):
            pytest.skip("Test requires OPENAI_API_KEY environment variable")
  2. Test Data Management:

    • Shift hardcoded URLs to a more structured data management approach, utilizing fixtures or constants.
    • Suggested Implementation:
    TEST_IMAGES = {
        "image1": "tests/fixtures/product1.jpg",
        "image2": "tests/fixtures/product2.jpg"
    }
  3. Assertion Improvements:

    • Improve assertions to provide clearer and more specific error messages.
    • Suggested Implementation:
    assert result is not None, "Crew execution returned None"
    assert len(result.tasks_output) == 1, "Expected exactly one task output"

3. Lock File Updates (uv.lock)

Recommendations:

  • Document any major changes in the lock file in the commit messages for better future reference.
  • Conduct a dependency vulnerability scan post-update for added security.
  • Verify that platform-specific dependencies are still resolving correctly after changes.

Final Overall Recommendations

  1. Documentation:

    • Update README.md to include environment variable requirements and test instructions.
    • Include compatibility notes in the CHANGELOG.
  2. Testing:

    • Include more edge cases in multi-image testing and consider mocking API calls.
  3. Configuration:

    • Transition test configurations to pytest.ini for cleaner management.

Implementing these suggestions will further enhance the maintainability and reliability of the codebase. Great job on this PR, and thank you for your continued contributions to improving the project!

devin-ai-integration bot and others added 2 commits May 27, 2025 12:15
- Add inline documentation for litellm version constraints
- Improve test implementation with pytest markers and constants
- Add clearer assertion messages for better error reporting

Co-Authored-By: Joe Moura <joao@crewai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Support for openai 1.78 distribution
1 participant