104 Commits

Author SHA1 Message Date
Travis Cline 334f4c3689 vectorstores/milvus: complete migration to new SDK v2 client (#1403)
* 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>
2025-10-15 14:45:48 -07:00
Travis Cline 99951bca92 httprr: improve test recording stability and add utilities (#1368)
* 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.
2025-08-18 19:41:52 +02:00
Travis Cline aba0732988 vectorstores: add MariaDB and Dolt vector store implementations (#1363)
* 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>
2025-08-16 19:43:17 +02:00
Travis Cline a11d14e541 deps: update Go version to 1.23.8 and toolchain to 1.24.6 (#1352) 2025-08-08 20:02:35 +02:00
Travis Cline 080815432a deps: update dependencies (#1319)
* deps: update base go and docs dependencies
* googleai: update test to match text-embedding-005 model name
2025-06-28 22:40:45 +02:00
Travis Cline 77504b877f all: expand test coverage (#1312)
* scripts: cleanup test scripts
* lint: add test pattern and architectural linting
* internal/httprr: expand httprr testing
* test: add comprehensive unit test coverage
* docs: add comprehensive testing guide to CONTRIBUTING.md
* examples: standardize module versions and cleanup dependencies
* all: re-record several httprr recordings
2025-06-16 18:14:02 +02:00
Travis Cline c544fb77bd all: add broad httprr coverage, update dependencies, organize go.mod file, bump to 1.23 (#1299)
* 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
2025-06-04 11:41:45 -07:00
Luca Ronca d89fe333df vectorstores: add Bedrock Knowledge Bases vectorstore support (#1200)
* feat: add Aws Bedrock Knowledge Bases vectorstore support

* doc: add comments to Filter exported symbol
2025-05-13 03:39:22 -07:00
Averi Kitsch 017409785d vectorstore: Add interfaces for Google AlloyDB and Cloud SQL (#1204)
* feat(google): Add Google AlloyDB and Cloud SQL vectorstore and chat history

* vectorstore: Add interfaces for Google AlloyDB and Cloud SQL
2025-04-17 13:03:52 -07:00
Travis Cline 1774cd28c6 Merge branch 'main' into GODRIVER-3347 2025-01-29 01:29:44 -08:00
Mathias Bergqvist f5ce2417e1 updated package name in go.mod files and go mod tidy to be ready for PR 2024-12-28 09:38:17 +01:00
Preston Vasquez 6edba4dffe Run mod tidy 2024-12-16 10:41:53 -07:00
Preston Vasquez af4edc2b0f Upgrade to mongodb v2.0.0 2024-12-10 16:30:07 -05:00
Mathias Bergqvist 81ac143ea4 Embedding for Mistral and an example with Mistral Embed and PGVector 2024-12-09 22:09:07 +01:00
Preston Vasquez 66d7710b63 vectorstores: add mongovector (#1005)
* mongovector: Add mongo vectorstore implementation

---------

Co-authored-by: Travis Cline <travis.cline@gmail.com>
2024-09-13 03:01:07 +00:00
Eli Bendersky 4fc43db4fb googleai: update dependency version (#939)
bump more
2024-06-28 08:02:15 -07:00
Eli Bendersky c2c382e113 googleai: add support for system instructions in vertex too (#930)
Also add shared tests for system instructions
2024-06-26 15:24:31 -07:00
Robby ee59e553c7 llms/watsonx: update module (#902)
Update Watsonx Package

Co-authored-by: Robby <h0rv@users.noreply.github.com>
2024-06-20 10:33:18 -04:00
Travis Cline af4a4b6e1d llms/googleai: Fix usage population tests, max token test, update dpep (#910)
googleai: Fix usage population tests, max token test, update generative-ai-go
2024-06-20 14:29:34 +00:00
Travis Cline 4ff4b21c80 deps: clean up direct dep on zerolog (#886) 2024-06-15 03:58:01 +00:00
Travis Cline 4c89af684b Fix up weaviate tests (#885)
* weaviate: Fix weaviate tests, openai embedding model threading

* testcontainers: Update to 0.31
2024-06-15 03:52:42 +00:00
Pavlo Paliychuk 89195f8554 memory: Add Zep Cloud integration (#746)
* memory: Add Zep Cloud integration
2024-06-14 23:19:11 -04:00
Travis Cline 68acaf31e8 llms: Tidy up marshaling (#884) 2024-06-15 02:47:48 +00:00
Augustinas Malinauskas afcdc4bdef httputil: debug transport layer (#845)
* feat: debug transport body
2024-06-14 18:04:44 -04:00
Eli Bendersky 078e88b77d llms/googleai: upgrade genai SDKs and fix build issue vs. new version (#854) 2024-05-23 10:01:43 -07:00
Johan Brandhorst-Satzkorn 151ba20587 llms/googleai: batch embedding calls (#825)
* mod: update Google AI dependency

This update allows the use of Gemini 1.5 Pro and batching of embeddings

* llms/googleai: batch embedding calls

The new Batch API significantly speeds up embedding
2024-05-12 20:48:48 -04:00
Robby c0a4ea652d llms: add watsonx (#577)
* Add `go-watsonx` support
---------

Co-authored-by: Robby <h0rv@users.noreply.github.com>
Co-authored-by: Travis Cline <travis.cline@gmail.com>
2024-05-10 17:49:59 -04:00
wei 08132f9598 vectorstores: add redisvector implementation (#777)
* feat(vectorstore): add redisvector

* feat(vectorstore): add redisvector unit test

* deps: go mod tidy

---------

Co-authored-by: Travis Cline <travis.cline@gmail.com>
2024-05-07 00:43:17 -04:00
Joey Chilson e1e409249d vectorstores/pgvector: support both pgx and pgxpool. (#802) 2024-05-07 00:26:01 -04:00
wei fe22d8ecd3 memory: Add mongodb memory implementation (#810)
* feat(internal): add mongodb client

* feat(memory): add mongodb memory
2024-05-04 19:39:05 -04:00
Eli Bendersky 7653b67913 googleai: implement tool support (#794)
Updates #748
2024-04-19 06:54:05 -07:00
andrewyang17 f7f9c028d7 vectorstores/pinecone: update to latest v0.4.1 (#789)
* vectorstores/pinecone: update to latest v0.4.1

* check if filter is available

* refactor code

* use pointer structpb.Struct
2024-04-18 13:58:11 -07:00
Eli Bendersky 97e36445b3 googleai: vertex - upgrade dep version and increase default max tokens (#742) 2024-04-01 06:20:24 -07:00
Eli Bendersky 319b863049 all: set explicit 1.22 version in go.mod (#727) 2024-03-31 16:32:19 -07:00
Travis Cline b6ba6693d3 tooling: Update minimum go version to 1.22, update golangci-lint (#722)
* go: Update to go 1.22, update golangci-lint config

* lint: Address various lint issues

* chains: fix lint complaint in TestApplyWithCanceledContext

* lint: Address addtional lint issues

* lint: Address addtional lint issues

* tools: update golangci-lint to 1.57
2024-03-26 20:31:20 +00:00
Aan Niraj Patel 8d90359935 llms: Add mistral hosted inference llm implementation (#717)
* llms: added mistral
2024-03-25 02:34:08 -07:00
Daniel Bos 5635461b4f llms: add caching functionality for Models (#564) 2024-03-19 21:10:35 -07:00
Travis Cline 325d5343f8 examples: Point to v0.1.6-alpha.1 (#687) 2024-03-19 01:25:34 +00:00
Marcus Olsson 0218733d9b documentloaders: add AssemblyAI document loader (#668)
* documentloaders: added assemblyai document loader
2024-03-18 16:30:23 -07:00
Trayan Azarov e9fbf3cb74 chore: Chroma dependency update (#676)
* feat: Bumping to latest chroma-go version

Refs: https://github.com/amikos-tech/chroma-go/releases/tag/v0.1.2
2024-03-15 16:22:17 -07:00
Sylvain Cau f67b1962b4 vectorstores: Add support for OpenAI Organization ID header in Chroma
* Update `chroma-go` to the latest version
* Add error handling to NewOpenAIEmbeddingFunction
* Add a new property to the store (`openaiOrganization`) and pass it to `chroma-go`
2024-03-06 16:41:16 -07:00
Souyama a51062f84b embeddings: Add Amazon Bedrock embeddings (#643)
* Add bedrock embedding provider

* Add bedrock tests

---------

Co-authored-by: Travis Cline <travis.cline@gmail.com>
2024-03-06 23:03:19 +00:00
Manuel de la Peña 3320490573 feat: run integration tests for vector databases using testcontainers-go modules 2024-03-06 17:54:36 +01:00
Manuel de la Peña 6982b8dcbc Merge branch 'main' into testcontainers-go 2024-02-20 19:46:02 +01:00
Ryan Currie 3a62d22be4 chroma-go version update 2024-02-09 23:29:02 -08:00
Travis Cline 14871d2323 Merge branch 'main' into testcontainers-go 2024-02-03 16:43:12 -08:00
Eli Bendersky e5e2fa5563 googleai: add codegen tool to generate vertex.go from googleai.go (#553)
Fixes #410
2024-01-25 15:44:28 +00:00
Manuel de la Peña 863cff7185 Merge branch 'main' into testcontainers-go
* main:
  googleai: refactor to better separate generated code (#547)
  googleai: add embeddings to vertex (#546)
  embeddings: add cybertron local embeddings
  googleai: move the PaLM provider into googleai (#541)
2024-01-24 11:42:38 +01:00
Daniel Bos 6982a619f2 embeddings: add cybertron local embeddings
Added a new package 'cybertron' under 'embeddings' to run embedding
models locally. This includes the main 'cybertron.go' file, a test
file 'cybertron_test.go', and an 'options.go' file for providing
various options for the client.

Resolves #494
2024-01-23 10:06:22 +08:00
Manuel de la Peña 10b58fc2b1 Merge branch 'main' into testcontainers-go
* main:
  googleai: add initial Vertex (GCP) implementation of Model (#540)
  docs: add pgvector page
2024-01-22 17:44:56 +01:00