* vectorstores/milvus: complete migration to new SDK v2 client (#1397)
Complete the migration from the archived milvus-sdk-go/v2 to the new
github.com/milvus-io/milvus/client/v2 SDK as tracked in issue #1397.
**New Implementation**:
- Add complete vectorstores/milvus/v2/ package with new SDK client
- Implement all core vectorstore operations (Add, Search, Delete, etc.)
- Add comprehensive test suite with unit and integration tests
- Include migration example and documentation
**Key Changes**:
- New milvus.go with updated client initialization and operations
- Updated options.go with v2 SDK configuration patterns
- Added example_migration.go demonstrating upgrade path
- Comprehensive README.md with migration guide
- Updated go.mod/go.sum with new SDK dependencies
**Documentation**:
- Add docs/package-lock.json for documentation build dependencies
- Provide clear migration path from v1 to v2 implementation
- Maintain backward compatibility where possible
This completes the migration work started in earlier commits and provides
a full replacement for the deprecated SDK while maintaining the same
vectorstore interface.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* style: apply gofmt formatting to v2 package files
* fix: remove unused async field from v2 Store struct
---------
Co-authored-by: Claude <noreply@anthropic.com>
* docs: fix outdated API references and examples across documentation
Update documentation to reflect current API patterns and fix outdated code examples:
- Update Error struct definition with Provider and Details fields in architecture docs
- Fix code examples to use CallOptions (WithTemperature, WithMaxTokens) instead of constructor options
- Update chain execution pattern from chain.Run() to chains.Run()
- Add context parameter to memory interface methods
- Update Vertex AI examples to use new googleai/vertex package structure
- Change from vertexai.New() to vertex.New() with updated option names
- Fix import paths for Google AI and Vertex AI integration
- Update minimum Go version requirement from 1.21 to 1.23
These changes ensure documentation examples work with the current codebase and provide accurate guidance for developers.
* docs: expand integration documentation and fix remaining API references
- Add comprehensive examples to chat and embeddings integration pages
- Fix missing context imports in LLM provider configuration
- Update Vertex AI examples to use correct vertex.New() syntax
- Fix broken link in CloudSQL vectorstore README
- Transform placeholder pages into useful developer resources
* docs: fix relative link in embeddings integrations page
* vectorstores/milvus: update deprecation notice for archived SDK
The Milvus SDK at github.com/milvus-io/milvus-sdk-go/v2 has been archived.
Updated the deprecation notice to inform users and reference issue #1334
which tracks the migration to the new SDK at github.com/milvus-io/milvus/client/v2.
The migration will be done in a way that maintains backward compatibility
to avoid breaking existing users.
Updates #1334
* vectorstores/milvus: update deprecation notice with archival date and issue reference
Add specific archival date (March 21, 2025) to the deprecation notice and clarify
that migration to the new SDK will require breaking changes in a future version.
Update issue reference from #1334 to #1397 for migration tracking.
Updates #1397
test: fix race conditions in httprr and azureaisearch tests
Add thread-safe access to global record flag in httprr package and prevent
tests that modify global state from running in parallel. Fix race condition
in Azure AI Search tests by properly capturing request counter in a local
variable before use.
* embeddings/vertexai,memory: remove deprecated PaLM test and add recordings
Remove deprecated VertexAI PaLM embeddings test (PaLM API deprecated August 2024).
Add missing test recordings for memory/token buffer tests.
* vectorstores/redisvector: regenerate test recordings and compress
Regenerate test recordings for Docker container compatibility.
Compress large recordings (>50KB) with gzip for space efficiency.
* vectorstores/chroma: regenerate test recordings and compress
Regenerate test recordings for Docker container compatibility.
Compress large recordings (>50KB) with gzip for space efficiency.
* vectorstores/milvus: add deprecation notice and compress recordings
Add deprecation notice for Milvus vectorstore.
Compress test recordings with gzip for space efficiency.
* vectorstores/opensearch: regenerate test recordings and compress
Regenerate test recordings for Docker container compatibility.
Fix test to properly set up service_role for local tests.
Compress large recordings with gzip for space efficiency.
* vectorstores/weaviate: regenerate test recordings and compress
Regenerate test recordings for Docker container compatibility.
Compress large recordings (>50KB) with gzip for space efficiency.
* vectorstores/{pgvector,alloydb,cloudsql}: regenerate and compress recordings
Regenerate test recordings for Docker container compatibility.
Compress large recordings (>50KB) with gzip for space efficiency.
Covers pgvector, AlloyDB, and CloudSQL PostgreSQL vectorstores.
* tools/wikipedia: regenerate test recordings
Update test recordings with current Wikipedia API responses.
* build: add examples-updater tool and update examples to v0.1.14-pre.1
Add a new tool to automate updating langchaingo version references in example
projects and use it to update all examples to v0.1.14-pre.1. The tool also
removes temporary replace directives that are no longer needed.
- Add update-examples Makefile target that runs the new tool
- Create internal/devtools/examples-updater implementation
- Update all example go.mod files to reference v0.1.14-pre.1
- Remove replace directives in googleai and vertex examples
- Update dependencies in main go.mod/go.sum
* httprr: improve header normalization and test container setup
Add header normalization to make HTTP recordings more stable:
- Add normalizeGoogleAPIClientHeader and normalizeVersionHeader functions
- Normalize User-Agent, x-goog-api-client and other version headers
- Remove OpenAI-Project header for consistency
- Preserve body for both replay lookup and recording
- Add comprehensive tests for header normalization
Improve testcontainer environment detection:
- Better handling of non-standard Docker socket paths
- Disable Ryuk reaper by default for resource efficiency
- Add verbose logging option via environment variable
* httputil: add ApiKeyTransport for query parameter API keys
Add a reusable ApiKeyTransport that adds API keys to URL query parameters:
- Create ApiKeyTransport implementation in httputil package
- Add comprehensive tests for the new transport
- Refactor googleai_test.go to use the shared transport
- Update chains/llm_test.go to use ApiKeyTransport with proper key scrubbing
This improves how API keys are handled with client libraries that don't
properly set keys when using custom HTTP clients, particularly useful
with httprr for testing Google API integrations.
* openai: remove duplicate MaxTokens field assignment
Remove redundant assignment where both MaxTokens and MaxCompletionTokens
were being set to the same value. MaxCompletionTokens is the preferred
field name that reflects OpenAI's API changes, while MaxTokens was
previously kept for backward compatibility.
* vectorstores/maridadb: add test infrastructure for MariaDB vectorstore
Add TestMain function for MariaDB vectorstore tests that ensures the proper
test environment is set up using the testctr package. This enables consistent
test container setup and teardown for MariaDB integration tests.
* all: normalize all httprr recordings for consistency
Update test recordings across all packages to use normalized headers:
- Standardize User-Agent to 'langchaingo-httprr'
- Normalize version information in x-goog-api-client headers
- Remove OpenAI-Project headers for consistency
- Fix deprecated Anthropic completion API tests
- Update HuggingFace test recordings with valid responses
These changes make test recordings stable across dependency updates
and different environments, preventing test failures from version changes.
* devtools: add utility tool for normalizing httprr test recordings
Add a command-line tool that standardizes version information in httprr recordings:
- Normalizes x-goog-api-client headers to use placeholder versions
- Standardizes x-amz-user-agent headers for consistency
- Replaces Go version strings with generic placeholders
- Supports dry-run mode to preview changes without modifying files
- Includes verbose output option for detailed change reporting
This tool helps maintain consistent test recordings across different environments
and dependency versions, preventing test failures from version changes.
* llms/openai: update OpenAI embedding test to use text-embedding-3-small model
Update the embedding test to use the current text-embedding-3-small model:
- Change model from text-embedding-ada-002 to text-embedding-3-small
- Adjust dimensions parameter from 1234 to 256 to match model capabilities
- Update test recording with appropriate response data
This change ensures tests remain compatible with OpenAI's current embedding
models and prevents test failures from API version changes.
* vectorstores: add MariaDB and Dolt vector store implementations
Add new vector store implementations for MariaDB and Dolt databases.
Both support similarity search with metadata filtering and score thresholds.
From PR #1147
Co-authored-by: Dustin Brown <coffeegoddd@users.noreply.github.com>
* go.mod: update testcontainers for MariaDB vector store tests
Update testcontainers-go and testcontainers-go/modules/mariadb to v0.38.0
for MariaDB vector store test support.
* vectorstores: fix database handling in MariaDB and Dolt implementations
Change value receivers to pointer receivers for init() and createOrGetDatabase()
methods to ensure proper state updates. Refactor database creation logic to first
check if database exists before creating or updating, replacing the previous
INSERT ON DUPLICATE KEY approach with a more explicit flow.
---------
Co-authored-by: Dustin Brown <coffeegoddd@users.noreply.github.com>
* all: add broad httprr coverage, update dependencies, organize go.mod file, bump to 1.23
update go version to 1.23
add lots of test coverage via httprr recordings
update dependencies and organize go.mod
add testutil/testctr which helps work around a testcontainers-go+colima bug
expand the huggingface implementation and tests
expand capabilities of the ollama package
Fix drift in vectorstores/chroma README.md
Perhaps this worked before, but now if you omit the protocol in the URL, you'll get an error like this:
```
2024/05/21 10:15:43 new: Get "localhost:8000/api/v1/heartbeat": unsupported protocol scheme "localhost"
```
* feat(vectorstore): add redisvector
* feat(vectorstore): add redisvector unit test
* deps: go mod tidy
---------
Co-authored-by: Travis Cline <travis.cline@gmail.com>
This commit corrects an errors handling issue in the applyClientOptions
function within the opensearch options module.
Previously, when the opensearch client was missing, the function
erroneously returned ErrMissingEmbedded instead of
ErrMissingOpensearchClient.
This update ensures that the current error is returned.
Signed-off-by: Chen Bojun <bojun.cbj@gmail.com>
* feat: update qdrant image
* feat: add opts in test, because default model embedding not work
* feat: add opts in test, because default model embedding not work
* chore: removed 5 lines for lint