Skip to content

Conversation

@IBJunior
Copy link
Member

  • Implemented compressLangChainHistory
  • Moved messagesToKeep in TrimConfig interface

Copilot AI review requested due to automatic review settings August 27, 2025 15:04

This comment was marked as outdated.

@IBJunior IBJunior requested a review from Copilot August 28, 2025 04:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a LangChain adapter for the slimcontext library, adding convenient integration with LangChain's message format and chat models. The main purpose is to provide a seamless way to compress LangChain message histories using slimcontext's compression strategies without requiring manual conversion between message formats.

Key changes include:

  • Added a comprehensive LangChain adapter with message conversion utilities and a high-level compression function
  • Introduced a TrimConfig interface to formalize the configuration structure for trim compression
  • Added optional peer dependency support for @langchain/core with proper package exports

Reviewed Changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/adapters/langchain.ts New adapter module with message conversion utilities and compressLangChainHistory function
tests/langchain.test.ts Comprehensive test suite for the LangChain adapter functionality
src/strategies/trim.ts Extracted TrimConfig interface and updated constructor to use it
src/index.ts Added export for the langchain adapter module
package.json Added LangChain peer dependency, package exports, and version bump
examples/LANGCHAIN_COMPRESS_HISTORY.md New example demonstrating one-call history compression
README.md Updated documentation with LangChain adapter section
CHANGELOG.md Added release notes for version 2.1.0
.github/copilot-instructions.md Added comprehensive repository documentation
.eslintignore Added locales directory to ignore list
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@IBJunior IBJunior merged commit bcc1cdb into main Aug 28, 2025
2 checks passed
@IBJunior IBJunior deleted the feat/adapters branch August 28, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants