mirror of
https://github.com/langchain-ai/langchain-pinecone.git
synced 2026-07-19 22:03:33 -04:00
[PR #61] [MERGED] fix: async perf #75
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langchain-ai/langchain-pinecone/pull/61
Author: @jamescalam
Created: 7/23/2025
Status: ✅ Merged
Merged: 7/23/2025
Merged by: @jamescalam
Base:
main← Head:james/async-perf📝 Commits (4)
44de3d2Fix Pinecone Async Performance Issue with Host Configuration (#49)9030690fix: rely solely on constructor3eb095echore: lint0fe5acdfix: host📊 Changes
5 files changed (+264 additions, -9 deletions)
View changed files
📝
libs/pinecone/README.md(+30 -0)📝
libs/pinecone/langchain_pinecone/vectorstores.py(+27 -6)📝
libs/pinecone/langchain_pinecone/vectorstores_sparse.py(+2 -0)📝
libs/pinecone/tests/integration_tests/test_embeddings.py(+33 -3)📝
libs/pinecone/tests/unit_tests/test_vectorstores.py(+172 -0)📄 Description
This pull request introduces several updates to enhance the functionality and testing of the Pinecone integration in the
langchain_pineconelibrary. The changes include adding support for specifying a host parameter, improving environment variable handling, and expanding the test suite with both unit and integration tests. Below is a summary of the most important changes:Enhancements to Pinecone Integration
Added a new
hostparameter to thePineconeVectorStoreandPineconeSparseVectorStoreclasses, allowing users to specify a custom host for Pinecone indices. If no host is provided, it defaults to thePINECONE_HOSTenvironment variable. (libs/pinecone/langchain_pinecone/vectorstores.py: [1] [2] [3] [4] [5];libs/pinecone/langchain_pinecone/vectorstores_sparse.py: [6] [7]Improved error handling by ensuring that either an
index_nameor ahostmust be provided during initialization. If neither is available, aValueErroris raised. (libs/pinecone/langchain_pinecone/vectorstores.py: libs/pinecone/langchain_pinecone/vectorstores.pyR236-R254)Expanded Test Suite
Added integration tests for Pinecone embeddings, ensuring that required environment variables (
PINECONE_API_KEYand optionallyOPENAI_API_KEY) are checked before running tests. Tests are skipped if these variables are not set. (libs/pinecone/tests/integration_tests/test_embeddings.py: [1] [2] [3] [4]Enhanced unit tests for
PineconeVectorStoreto validate host caching, host-based initialization, and behavior when both a host and an index are provided. Mocked clients (PineconeClientandPineconeAsyncioClient) were introduced to simulate Pinecone behavior. (libs/pinecone/tests/unit_tests/test_vectorstores.py: [1] [2]Documentation Updates
README.mdfile to include instructions for running unit and integration tests, along with details on required environment variables. This improves developer onboarding and testing clarity. (libs/pinecone/README.md: libs/pinecone/README.mdR16-R45)These changes collectively improve the flexibility, robustness, and test coverage of the Pinecone integration, making it easier for developers to configure, use, and validate the library.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.