Skip to content

Conversation

@cbornet
Copy link
Collaborator

@cbornet cbornet commented Mar 17, 2025

This pull request introduces several key changes to the CI workflows and the VectorizeRetriever class, as well as updates to the test suite to accommodate new functionality. The most important changes include the addition of linting and testing workflows, enhancement of the VectorizeRetriever class to support different environments, and updates to the test cases to ensure they work with the new environment settings.

CI Workflow Enhancements:

  • Added a new GitHub Actions workflow for Python linting with support for Python versions 3.9 and 3.13. This workflow includes steps for setting up the environment, restoring cache, and running lint checks using ruff. (.github/workflows/lint.yml)
  • Added a new GitHub Actions workflow for running Python tests with support for multiple Python versions (3.9 to 3.13). This workflow includes steps for setting up the environment, restoring cache, and running unit tests using pytest. (.github/workflows/python_test.yml)

VectorizeRetriever Enhancements:

  • Introduced an environment attribute to the VectorizeRetriever class, allowing it to operate in different environments such as "prod", "dev", "local", and "staging". (langchain/langchain_vectorize/retrievers.py)
  • Updated the model_post_init method to configure the API client based on the specified environment, including setting custom headers for local development. (langchain/langchain_vectorize/retrievers.py)

Test Suite Updates:

  • Added an environment fixture to the test suite to provide the environment setting for tests. Updated the api_client fixture to use this environment setting. (langchain/tests/test_retrievers.py)
  • Modified test cases to include the environment parameter and added a retry mechanism to ensure documents are retrieved within a specified time frame. (langchain/tests/test_retrievers.py)

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 continuous integration workflows for linting and testing, and updates configuration in the Vectorize retriever along with corresponding tests.

  • Adds GitHub Action workflows for Python linting (.github/workflows/lint.yml) and testing (.github/workflows/python_test.yml).
  • Updates the VectorizeRetriever class to support an "environment" attribute and modifies its API client initialization.
  • Adjusts tests to incorporate the new "environment" parameter and implements a retry loop for document retrieval.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/lint.yml Introduces a linting workflow for the LangChain project.
.github/workflows/python_test.yml Adds a testing workflow for executing Python tests across versions.
langchain/langchain_vectorize/retrievers.py Updates the retriever to support an environment setting.
langchain/tests/test_retrievers.py Modifies tests to utilize the new environment parameter and wait for expected results.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

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

LGTM

@nicoloboschi nicoloboschi merged commit 17ef1a3 into main Mar 18, 2025
7 checks passed
@cbornet cbornet deleted the ci branch March 18, 2025 09:39
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.

3 participants