Releases: vxcontrol/langchaingo
v0.1.13-update.5
Highlights
- HTTP Record and Replay Testing: Added
httprr
package for deterministic HTTP testing that dramatically speeds up test execution - Enhanced Documentation: Completely restructured documentation site with improved search, architecture guides, and tutorials
- Comprehensive Test Coverage: Added extensive test coverage across all components using the new httprr system
Breaking Changes
- Google AI Model Update: Deprecated
textembedding-gecko
model replaced withtext-embedding-005
- Test Context Usage: Standardized context usage in tests from
t.Context()
tocontext.Background()
Major Features & Improvements
HTTP Record and Replay Testing (httprr)
- Added comprehensive
httprr
package for deterministic HTTP testing by @tmc in #1296 - Enables recording real HTTP interactions during development and replaying during CI/testing
- Built-in scrubbing automatically removes API keys, tokens, and sensitive headers
- Supports compressed
.httprr.gz
files for repository storage efficiency - Test flags:
-httprecord=<regexp>
for re-recording and-httpdebug
for HTTP logging - Supports env variables
HTTPRR_RECORD
,HTTPRR_DEBUG
,HTTPRR_HTTPDEBUG
,HTTPRR_RECORD_DELAY
in tests - Dramatically improves test execution speed and reliability
- Enables analysis of LLM response formats through recorded
.httprr
files
Documentation Overhaul
- Complete documentation site restructure by @tmc in #1311
- Added comprehensive architecture documentation and how-to guides
- New tutorials section with basic chat application examples
- Enhanced search functionality with Go-based indexing by @tmc in #1313
- Switched from npm to pnpm for package management
- Added Vale linting configuration for documentation consistency
- Fixed documentation typos and improved API consistency by @BowieHe in #1314
CI and Development Infrastructure
- Enhanced CI workflows with matrix testing and coverage reporting by @tmc in #1288
- Added Git hooks for pre-push quality checks
- Separated example builds into dedicated workflows
- Added race condition testing and automated PR coverage comments
- Added comprehensive linting for test patterns and architectural rules by @tmc in #1312
Provider Updates
Huggingface
- Updated embeddings to use
/models/
endpoint instead of deprecated/pipeline/
by @tmc in #1299 - Added inference provider support for router-based requests
- Improved token configuration with
HF_TOKEN
as primary environment variable - Added support for
HF_TOKEN_PATH
,HF_HOME
, andXDG_CACHE_HOME
- Updated default embedding model to
BAAI/bge-small-en-v1.5
Google AI
- Replaced deprecated
textembedding-gecko
withtext-embedding-005
by @alanrichman in #1292 - Updated to latest text embedding model version for improved performance
Azure AI Search
- Added
WithEndpoint
option for endpoint configuration by @thecoons in #1308 - Provides alternative to environment variable
AZURE_AI_SEARCH_ENDPOINT
OpenAI
- Fixed tool call handling in OpenAI functions agent by @tmc in #1288
- Addressed ID passing issue in tool calls
- Added support for both legacy and new tool calling APIs
Testing Infrastructure Improvements
- Added extensive httprr test coverage across all components by @tmc in #1299 and #1312
- Updated all HTTP-based tests to use httprr for consistent test execution
- Reorganized transport layer with structured logging via slog
- Added
testutil/testctr
helper to work around testcontainers-go+colima bug - Enhanced test execution speed and reliability
Dependencies Updates
- Restructured and organized go.mod dependency declarations
- Updated examples with clean module declarations
- Updated testcontainers to new API where supported
- Switched from npm to pnpm for documentation package management
Bug Fixes
- Fixed OpenAI functions agent tool call ID passing issue by @tmc in #1288
- Removed redundant error checks in LLM chain tests by @tmc in #1299
- Fixed various linting issues across the codebase
- Fixed deprecated Google AI embedding model usage
Contributors
A huge thank you to all the contributors who made this release possible:
- @tmc - HTTP record/replay system, documentation overhaul, comprehensive test coverage
- @alanrichman - Google AI embedding model update
- @thecoons - Azure AI Search endpoint configuration
- @BowieHe - Documentation fixes and API consistency
- @jacobcode91 - Documentation contributions
Full Changelog: v0.1.13-update.4...v0.1.13-update.5
v0.1.13-update.4
Highlights
- Upstream Sync: Updated to the latest upstream version with critical bug fixes and new features
- Google AI Tool Handling: Fixed issue where Gemini models would ignore all but the first tool call
- AWS Bedrock Knowledge Bases: Added comprehensive vector store support for AWS Bedrock Knowledge Bases
- Anthropic Reasoning Enhancement: Added reasoning content support for function calling choices to maintain consistency with Claude Sonnet 4
Major Improvements
Upstream Integration
This release incorporates the latest changes from the upstream repository, bringing several important fixes and enhancements.
Google AI Provider Enhancements
- Fixed Multi-Tool Processing: Google AI provider now correctly handles multiple tool calls in a single request
- Improved Tool Consolidation: Changed from creating multiple tools with single function declarations to a single tool with multiple function declarations
- Better API Compatibility: Aligned tool handling with Google AI API expectations for more reliable function calling
AWS Bedrock Knowledge Bases Vector Store
- Complete Vector Store Implementation: Added full support for AWS Bedrock Knowledge Bases as a vector store backend
- Document Ingestion: Comprehensive document ingestion capabilities with support for various file formats
- S3 Integration: Native S3 bucket integration for document storage and retrieval
- Metadata Filtering: Advanced filtering capabilities for precise document retrieval
Anthropic Provider Improvements
- Reasoning Content for Function Calls: Added reasoning content support to function calling choices
- Claude Sonnet 4 Compatibility: Enhanced compatibility with the latest Claude Sonnet 4 model behavior
- Consistent API Behavior: Synchronized reasoning content handling with OpenAI provider for consistent cross-provider experience
Borrowed Upstream Pull Requests
This release incorporates code and improvements from the following upstream pull requests:
- Google AI Multi-Tool Fix from PR #1244 by @jpoz - Fixed issue where Gemini would ignore all but the first tool
- AWS Bedrock Knowledge Bases from PR #1200 by @lucaronca - Added comprehensive vector store support
- Additional Enhancements from PR #1135 by @lucaronca - Various improvements and bug fixes
- Provider Updates from PR #1260 by @laurence-nearform and @lmorg - Enhanced provider capabilities
Contributors
- @jpoz - Google AI multi-tool fix (upstream PR tmc#1244)
- @lucaronca - AWS Bedrock Knowledge Bases implementation (upstream PRs tmc#1200, tmc#1135)
- @laurence-nearform - Provider enhancements (upstream PR tmc#1260)
- @lmorg - Provider enhancements (upstream PR tmc#1260)
- @asdek - Anthropic reasoning enhancements
Full Changelog: v0.1.13-update.3...v0.1.13-update.4
v0.1.13-update.3
Highlights
- Better Reasoning: Improved step-by-step thinking support in AI models, including models through OpenRouter
- Stream Done Signal: Streaming API now clearly tells you when a response is finished
Major Improvements
Reasoning Capabilities
- Access to AI Thinking Process: Access the reasoning content (step-by-step thinking) from models that support this feature
- Cross-Provider Support: Works with multiple AI providers including OpenAI, Anthropic, and models available through OpenRouter
- Flexible Configuration: Use either a simple effort level or specific token budget to control reasoning behavior
- Multiple Format Support: Compatible with both modern and legacy reasoning formats across different providers
Streaming Enhancements
- Reliable Resource Management: New
ChunkTypeDone
notification ensures your application knows exactly when a stream is complete, allowing for predictable resource release - Simplified Error Handling: No more need for timeout workarounds or complex stream completion detection logic
Technical Details
- Added
ReasoningOptions
type withEffort
andMaxTokens
parameters - Extended necessary structures to support reasoning fields
reasoning_content
andreasoning
- Implemented
ChunkTypeDone
for reliable stream completion notification in all LLM implementations
Contributors
Full Changelog: v0.1.13-update.2...v0.1.13-update.3
v0.1.13-update.2
Highlights
This release introduces significant enhancements to the streaming capabilities, reasoning features, and tool calling functionality across multiple LLM providers. It focuses on improving both API consistency and the robustness of interactions with various AI models.
Breaking Changes
- Streaming API Interface: Changed the signature of
StreamingFunc
fromfunc(ctx context.Context, chunk []byte) error
tofunc(ctx context.Context, chunk streaming.Chunk) error
- Removed StreamingReasoningFunc: This function has been consolidated into the new streaming architecture
- Reasoning Configuration: Added explicit reasoning configuration options that may affect existing code using reasoning capabilities
- Tool Call IDs: Changed tool call ID format for better cross-provider compatibility
Major Improvements
New Packages
-
Streaming Package: Added a dedicated package for handling streaming responses from language models
- Unified interface for processing text, reasoning, and tool call chunks
- Type-safe chunk structures with proper content type discrimination
- Helper functions for properly invoking streaming callbacks by chunk type
- Support for handling tool call data in streaming mode with proper state tracking
-
Reasoning Package: Added support for extracting and processing step-by-step thinking from models
- Pattern-matching extraction for
<think>
and<thinking>
tags in model responses - Stateful
ChunkContentSplitter
for handling streaming reasoning content - Support for both incremental streaming and complete content processing
- Integration with all major LLM providers (OpenAI, Anthropic, Ollama)
- Pattern-matching extraction for
LLM Client Enhancements
Ollama Client
- Enhanced streaming support with proper chunk processing for text and tool calls
- Added reasoning content extraction for models with thinking capabilities
- Improved tool call handling with robust ID generation and argument parsing
- Better error handling during streaming operations with detailed error messages
- Support for concurrent tool calls with proper state tracking
Anthropic Client
- Added support for parallel tool calls with proper tool ID tracking
- Improved streaming API with sophisticated delta handling for various content types
- Enhanced support for the thinking capability through dedicated API parameters
- Better tool call state management during streaming with improved payload handling
- Improved error handling with retries for rate limit errors
OpenAI Client
- Added comprehensive test coverage for DeepSeek API and OpenRouter API, ensuring compatibility
- Added support for multiple models through the same client interface
- Improved handling of multi-tool call responses with better state management
- Enhanced streaming response processing with proper content type discrimination
- Added support for controlling reasoning effort with token budgeting
- Fixed streaming tool call processing to properly accumulate arguments
Improved API Consistency
- Standardized streaming interfaces across all LLM providers
- Unified reasoning content extraction and processing
- Consistent tool call format and handling across providers
- Better type safety for message processing and tool interactions
- Normalized effort levels for reasoning capabilities across providers
Comprehensive Testing
- Added extensive test matrix covering 20+ models across multiple providers
- Specific test cases for parallel tool calls functionality
- Tests for reasoning capabilities with various model configurations
- Cross-provider compatibility tests ensuring API consistency
- Tests for streaming functionality with all content types
Documentation Updates
- Added detailed package-level documentation for streaming and reasoning packages
- Updated examples to demonstrate the new streaming API
- Added examples for using the reasoning capabilities
- Updated tool call examples to show parallel tool usage
- Improved error messages and logging
Borrowed Upstream Pull Requests
This release incorporates code and ideas from the following upstream pull requests:
- Support for reasoning in Anthropic and OpenAI requests from #1228 by @ppipada
- Improved streaming API with proper content type discrimination from #950 by @diemus
Dependencies Updates
Same as in v0.1.13-update.1.
Contributors
Full Changelog: v0.1.13-update.1...v0.1.13-update.2
v0.1.13-update.1
Major Announcement
Important: This fork can now be used without replace
directives in go.mod. Simply run:
go get github.com/vxcontrol/langchaingo@v0.1.13-update.1
Highlights
This release builds on all improvements from v0.1.13-update.0, adding several enhancements to key components and improving overall code quality.
Major Improvements
Ollama Integration
- Refactored message processing and model handling for better maintainability
- Improved method organization with dedicated functions for conversions and request creation
- Enhanced error handling during chat request creation and response processing
- Optimized message conversion logic for text content and tool calls
OpenAI Functions Agent
- Added tool name support to ToolChatMessage for better tracking
- Enhanced tool call parsing with dedicated methods
- Improved message structure in the agent's scratchpad
- Added support for handling multiple choices and tool calls in responses
Tool Enhancements
- Web Scraper: Replaced traditional map and mutex with sync.Map for improved concurrency
- Implemented safe concurrent writes with a dedicated writeToBuffer function
- Streamlined the logic for checking and storing scraped links
- Enhanced error handling for streaming output
Anthropic Client
- Improved delta event handling in message processing
- Added dedicated functions for handling text and JSON deltas
- Enhanced error handling for streaming output
- Improved response content management
Dependencies Updates
- github.com/testcontainers/testcontainers-go v0.37.0
- github.com/testcontainers/testcontainers-go/modules/* v0.37.0
- github.com/stretchr/testify v1.10.0
- github.com/cpuguy83/dockercfg v0.3.2
- github.com/docker/docker v28.0.1+incompatible
- go.opentelemetry.io/otel/metric v1.32.0
- go.opentelemetry.io/otel/trace v1.32.0
- github.com/weaviate/weaviate v1.29.0
- github.com/weaviate/weaviate-go-client/v5 v5.0.2
Contributors
Full Changelog: v0.1.13-update.0...v0.1.13-update.1
v0.1.13-update.0
Highlights
- Official Ollama Client Integration: Added native tool support for Ollama using the official client
- In-Memory Vector Store: Added a new vector store implementation for quick prototyping and testing
- Advanced Retrievers: Added Merger Retriever and Multi Query Retriever for improved document retrieval
- MS Office Document Loaders: Added loaders for Word, Excel, and PowerPoint files
- OpenAI Text-to-Speech: Integrated the OpenAI TTS API
- Audio Transcription: Added support for transcribing audio files using the Whisper model
Breaking Changes
- Go 1.24 Requirement: Updated minimum supported Go version to 1.24
- Official Ollama Go Client: Replaced custom implementation with the official Ollama Go client
- Changed RecursiveCharacter Default Settings: Reduced chunk size from 4000 to 512 and overlap from 200 to 100
- Google AI Model Change: Updated default model from "gemini-pro" to "gemini-2.0-flash"
- Response Status Code Check: Changed DuckDuckGo API check from status != 200 to status > 299
- XML Formatting for Documents: Added XML tag formatting in map-reduce chains and document formatting
Major Features & Improvements
Tool Integrations
- Added arXiv tool for scientific paper searches by @longkeyy in #1042
- Fixed OpenAI agents by migrating from functions to tools by @nonchan7720 in #1240
- Added multi-tool call responses by @lonelycode in #1030
- Fixed status code check in DuckDuckGo tool by @kidandcat in #968
Retrievers & Vector Stores
- Added in-memory vector store implementation by @HatsuneMiku3939 in #613
- Added Merger Retriever to combine results from multiple retrievers by @Abirdcfly in #747
- Added Multi Query Retriever for improved search capabilities by @Abirdcfly in #650
- Improved vector store tests for Pinecone, Qdrant, Redis, and Weaviate
- Added HNSW indexing support for in-memory vector store
Document Loaders
- Added Microsoft Office document loaders for Word, Excel, and PowerPoint by @Struki84 in #1068
- Added Whisper OpenAI loader for audio transcription by @devalexandre in #696
Document Formatting
- Added XML tagging for document content in map-reduce chains
- Updated StuffDocuments chain with improved document formatting
- Added metadata filtering functionality in StuffDocuments
- Added template-based document joining with consistent formatting
Examples
- Added short-term memory to chatbots example by @ju4nv1e1r4 in #1194
- Added Ollama Retrieval Example by @hcmlinj in #1051
- Added document loading example by @AnthonyDasse in #954
- Added in-memory vector store example
Provider Updates
OpenAI
- Added text-to-speech API integration by @mazyaryousefinia in #1126
- Updated openaillm.go by @Arrowarcher in #1182
- Fixed migration from functions to tools by @nonchan7720 in #1240
- Added proper handling of ToolCallResponse in GenerateContent
- Added ReasoningContent support to ContentChoice
Anthropic
- Fixed streaming for tool calls by @rainu in #1193
- Added unit tests for anthropic tools by @lwlee2608 in #952
- Added improved handling for tool streaming by @rainu in #1193
- Added PartialJSONContent support for streaming tool responses
Google AI
- Added support for items and recursion in schema by @sami-sweng in #1234
- Changed default model from "gemini-pro" to "gemini-2.0-flash"
- Improved schema conversion and parameter handling
Ollama
- Added native tool support using the official Ollama client by @rainu in #1197
- Removed custom client implementation in favor of official API
- Added tool call functionality in Ollama integration
- Updated client options and parameters for better performance
DeepSeek
- Added base URL for DeepSeek examples by @ValeryVerkhoturov in #1207
Perplexity
- Updated model references from "llama-3.1-sonar-large-128k-online" to "sonar"
- Updated default model to ModelSonar
- Added support for new model variants with different context windows
Bug Fixes
- Fixed toolCall unmarshalling by @wangjiancn in #932
- Fixed incorrect comments about default values in NewRecursiveCharacter by @teddysupercuts in #1189
- Fixed Text Splitters conceptual link by @elkcityhazard in #1206
- Fixed case sensitivity in vector store metadata filters
- Fixed exact-match search in Serpapi tool to prevent errors
Output Parsers
- Added Markdown parser for extracting content from markdown code blocks
Dependencies Updates
- Bumped http-proxy-middleware from 2.0.7 to 2.0.9 in /docs by @dependabot in #1230
- Bumped @babel/helpers from 7.26.7 to 7.27.0 in /docs by @dependabot in #1224
- Bumped @babel/runtime from 7.26.7 to 7.27.0 in /docs by @dependabot in #1223
- Bumped @babel/runtime-corejs3 from 7.26.7 to 7.27.0 in /docs by @dependabot in #1222
- Bumped image-size from 1.2.0 to 1.2.1 in /docs by @dependabot in #1203
- Bumped prismjs from 1.29.0 to 1.30.0 in /docs by @dependabot in #1180
- Added new indirect dependencies: github.com/ollama/ollama, github.com/coder/hnsw, github.com/chewxy/math32, and more
Contributors
A huge thank you to all the contributors who made this release possible:
- @Abirdcfly
- @AnthonyDasse
- @Arrowarcher
- @devalexandre
- @elkcityhazard
- @hcmlinj
- @HatsuneMiku3939
- @ju4nv1e1r4
- @kidandcat
- @longkeyy
- @lonelycode
- @lwlee2608
- @mazyaryousefinia
- @nonchan7720
- @rainu
- @sami-sweng
- @Struki84
- @teddysupercuts
- @ValeryVerkhoturov
- @wangjiancn
Full Changelog: v0.1.13...v0.1.13-update.0