46 Commits

Author SHA1 Message Date
Travis Cline 450c02a722 examples: update to v0.1.14-pre.4 (#1401)
chore: update all examples to use v0.1.14-pre.4

- Remove replace directives from 5 examples that had local path references
- Update all 75 example go.mod files to use the latest pre-release version
- Ensures examples work correctly for users who clone the repository
2025-09-14 20:54:54 +02:00
Travis Cline 827a36f321 examples: update examples to v0.1.14-pre.3
Update all example project go.mod files to reference v0.1.14-pre.3
instead of v0.1.14-pre.2. This ensures examples use the latest pre-release
version with recent fixes and improvements.
2025-08-23 19:17:47 +02:00
Travis Cline 6d75f33614 examples: update examples to v0.1.14-pre.2 (#1373)
Update all example project go.mod files to reference v0.1.14-pre.2
instead of v0.1.14-pre.1. This ensures examples use the latest pre-release
version with recent fixes and improvements.
2025-08-19 20:36:29 +02: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 57a517b279 examples: update to use v0.1.14-pre.0 (#1353) 2025-08-08 22:27:43 +02:00
Travis Cline 6c81282073 examples: Fix examples and complete linting upgrade (#1288)
* examples: update examples, clean up module declarations

- Fix and relax lint rules (for now)
- Clean up and fix module declarations
- Add .gitattributes to mark go.sum as binary

* ci: separate and enhance CI workflows

- Split example builds into dedicated workflow
- Add comprehensive test coverage reporting
- Improve CI structure with matrix testing
- Add race condition testing
- Add automated PR coverage comments

* test: improve test reliability and agent message handling

- Simplify MRKL agent test to use basic math calculation
- Update OpenAI functions agent to use ToolChatMessage
- Add proper environment checks for Zep integration tests

* agents: fix issue in tool call handling for openai function agent
2025-06-03 07:52:03 -07:00
Travis Cline fce56ba86e examples: Update to v0.1.13-pre.1 (#1140) 2025-02-09 04:15:07 -08:00
Travis Cline 179400979a Update examples to v0.1.13-pre.0 (#1021)
* examples: Point examples to v0.1.13-pre.0

* examples: fix typo in o1
2024-09-12 22:05:12 -07:00
Eli Bendersky b508f9b08f examples: update go.mod to point to latest release (#937) 2024-06-27 07:12:54 -07:00
Travis Cline e6e3d8d08a examples: point to 0.1.12-pre.0 (#922) 2024-06-21 04:59:53 +00:00
Travis Cline d44ea4436a examples: Add example readmes (#916)
* examples: Add READMEs to each example
2024-06-20 23:47:52 -04:00
Travis Cline 766bd18a2e examples: Update to v0.1.11 (#897) 2024-06-17 11:41:27 +00:00
Travis Cline d9e644e511 examples: Update to v0.1.10 (#833) 2024-05-11 23:14:23 +00:00
Travis Cline 292be53214 examples: update langchaingo to v0.1.9 (#800)
examples: update langchaingo version
2024-04-21 07:41:30 +00:00
Travis Cline a47ef5033a examples: Update examples to v0.1.8 (#736) 2024-03-31 23:49:43 +00:00
Travis Cline dc3e6f6686 examples: Update to v0.1.7 (#694) 2024-03-19 23:01:51 +00:00
Travis Cline 014070ce46 examples: Update examples to v0.1.6 (#688) 2024-03-19 01:38:51 +00:00
Travis Cline 325d5343f8 examples: Point to v0.1.6-alpha.1 (#687) 2024-03-19 01:25:34 +00:00
Travis Cline 6cc64f8110 examples: Point to v0.1.5 2024-03-07 17:45:24 -08:00
Eli Bendersky e8498f5c2f Clean up sequential_chain_example to make it a bit more readable (#635) 2024-02-24 14:43:08 +00:00
Eli Bendersky 76fb641fdd Update comments, bump example dependencies and clarify chain example (#633)
Update comments, bump example dependencies and clarify chain example a bit
2024-02-24 05:52:30 -08:00
Eli Bendersky 85475d91ee bump examples dependency to v0.1.4-alpha.0 (#575) 2024-01-27 18:53:09 +00:00
Travis Cline 1bea996677 examples: Update to v0.1.3 2024-01-03 20:40:43 -08:00
Travis Cline a39989164e examples: update to v0.1.2 2023-12-28 16:24:36 -08:00
Travis Cline d8b25bd69e examples: Update to pre-release tag 2023-12-28 16:20:04 -08:00
Travis Cline 213b9dca74 examples: Update langchaingo to v0.1.1 (#445) 2023-12-20 21:40:03 +00:00
Travis Cline 1c8e491300 examples: Use v0.1.0 2023-12-12 20:42:59 -08:00
Travis Cline b0c827511c examples: Update langchaingo version in examples 2023-12-12 20:12:21 -08:00
Eli Bendersky 4bb28402cf embeddings: use NewEmbedder for Ernie embeddings (#392)
For #379

Updates examples go.mod because it's used in an example
2023-12-04 22:38:29 -08:00
Eli Bendersky 7dd3fd2a1c embeddings: new NewEmbedder for Ollama embeddings
The only use of Ollama embeddings is an example - update it too and
go.mod versions
2023-12-04 22:38:29 -08:00
Eli Bendersky fc033c3471 embeddings: use NewEmbedder for OpenAI embeddings (#385)
This is the first use of the refactoring made in #374 -- removing the
embeddings/openai directory entirely, since it can be now implemented
with NewEmbedder without duplicating code. The test was moved one
dir down and works with the new setup.

This is a model that can be used to similarly refactor the other
embeddings/* subdirs.

This is a large PR because it also updates example go.mods

For #379
2023-12-04 22:38:29 -08:00
Travis Cline cda53c9ed7 examples: fix milvus example to not ask to run ollama (#381) 2023-12-04 22:38:29 -08:00
Travis Cline fa74369a81 examples: update examples (#380) 2023-12-04 22:38:29 -08:00
Travis Cline 6d5ec4afec examples: Include full path in examples 2023-12-04 22:38:28 -08:00
Travis Cline d933d99f91 example: Sync 2023-12-04 22:38:28 -08:00
Travis Cline 2cafc2708d example: Sync 2023-12-04 22:38:28 -08:00
Travis Cline 8d9bb2c9e6 examples: Sync and update deps 2023-12-04 22:38:28 -08:00
Travis Cline bfa040eb1a examples: sync to main 2023-12-04 22:38:28 -08:00
Travis Cline dd671f1d64 examples: Sync langchaingo version 2023-09-24 15:35:38 -07:00
Travis Cline 4dac573d3b examples: Sync langchaingo version 2023-09-24 15:34:41 -07:00
Travis Cline c85d3967da examples: add streaming fn example, sync (#272)
* examples: add openai streaming function call example

* examples: Sync to latest
2023-08-29 03:27:28 +00:00
Travis Cline c5b84faa54 callbacks: Include context 2023-08-25 19:14:02 -07:00
Travis Cline acdd75c474 examples: Add anthropic example, sync examples 2023-07-29 16:24:26 -07:00
Travis Cline 3234c9d952 examples: Sync 2023-07-25 18:44:25 -07:00
Tobi def10baa35 examples: add go.mod, go.sum 2023-07-23 23:42:34 +01:00
Tobi 4373ca2336 examples: add simpleseq and seq chain examples 2023-07-23 23:39:02 +01:00