Skip to content

partial implementation from release/2.8.0#1237

Merged
chakravarthik27 merged 16 commits intomainfrom
release/2.8.0
Apr 22, 2026
Merged

partial implementation from release/2.8.0#1237
chakravarthik27 merged 16 commits intomainfrom
release/2.8.0

Conversation

@chakravarthik27
Copy link
Copy Markdown
Collaborator

This pull request introduces several important updates across the codebase, focusing on compatibility with newer Python versions, refactoring type definitions for configuration, and updating dependencies to match evolving external APIs. The main changes include upgrading CI pipelines to Python 3.12 and 3.13, refactoring TypedDict usages for test configurations, updating the OpenAI embeddings integration, and switching from the deprecated langchain package to langchain_classic.

Python Version and CI Pipeline Updates:

  • Updated all GitHub Actions workflows (build_and_test.yml, llm_tests_build.yml, release.yaml) to test and build against Python 3.12 and 3.13, removing support for older versions. [1] [2] [3]

Configuration Type Refactoring:

  • Refactored all TypedDict usages for test configuration classes (e.g., BaseAccuracy, LLMEval, BaseBias, BaseClinical, DisinformationTestFactory, FactualityTestFactory, BaseFairness, MinGenderF1Score, MaxGenderF1Score, MinGenderRougeScore, MaxGenderRougeScore, MinGenderLLMEval, MaxGenderLLMEval, BaseGrammar, LegalTestFactory, BasePerformance) to use dictionary-style syntax for field definitions, improving compatibility and clarity. Introduced a new GenderedConfig type for gender-related fairness tests. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

Dependency and API Updates:

  • Updated the OpenAI embeddings integration in langtest/embeddings/openai.py to use the new openai.Client API and default to the text-embedding-3-small model. Removed deprecated API key assignment. [1] [2]
  • Replaced all imports of the deprecated langchain package with langchain_classic throughout the codebase, including in model handler modules, to ensure ongoing compatibility. [1] [2] [3]

General Code Quality Improvements:

  • Replaced type(x) == y checks with isinstance(x, y) for more robust type checking in several locations. [1] [2] [3] [4]
  • Refactored prompt construction logic in build_prompt to use more readable string concatenation.

These changes collectively modernize the codebase, improve maintainability, and ensure compatibility with the latest versions of Python and key dependencies.

Copy link
Copy Markdown

@blidiselalin blidiselalin left a comment

Choose a reason for hiding this comment

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

Lot of works and changes, looks good on working on the new python versions and libraries updated

@chakravarthik27 chakravarthik27 merged commit 45a32bd into main Apr 22, 2026
2 checks passed
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.

2 participants