Skip to content

Comments

feat: complete langchain test script#2665

Merged
hayescode merged 6 commits intoChainlit:mainfrom
codomposer:feat/langchain-test
Nov 20, 2025
Merged

feat: complete langchain test script#2665
hayescode merged 6 commits intoChainlit:mainfrom
codomposer:feat/langchain-test

Conversation

@codomposer
Copy link
Contributor

@codomposer codomposer commented Nov 19, 2025

Add LangChain Integration Tests

Summary

Added essential test coverage for the Chainlit LangChain integration.

Changes

  • Added 18 tests across 3 test files
  • Tests cover core LangChain callback functionality
  • All tests passing ✅

Test Files Added

  • backend/tests/langchain/__init__.py - Package initialization
  • backend/tests/langchain/test_async_callback.py - 6 async callback tests
  • backend/tests/langchain/test_sync_callback.py - 8 helper class tests
  • backend/tests/langchain/test_chain_types.py - 4 chain type tests
  • backend/tests/langchain/README.md - Test documentation

Test Coverage

  • ✅ Tracer initialization and configuration
  • ✅ LLM callbacks (start, token streaming)
  • ✅ Step creation and management
  • ✅ Error handling
  • ✅ Helper classes (FinalStreamHelper, GenerationHelper)
  • ✅ Run filtering and parent ID management
  • ✅ Chain types and nested hierarchies

Running Tests

pytest tests/langchain/ -v

Dependencies

All dependencies already in pyproject.toml:

  • langchain>=0.2.4,<0.3.0
  • pytest>=8.3.2
  • pytest-asyncio>=0.23.8

Notes

  • No source code changes required
  • Compatible with langchain 0.2.x
  • Uses existing test fixtures from tests/conftest.py

Contribution by Gittensor, learn more at https://gittensor.io/

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. backend Pertains to the Python backend. labels Nov 19, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Copy link
Contributor

@hayescode hayescode left a comment

Choose a reason for hiding this comment

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

@codomposer can you remove the readme?

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 19, 2025
@codomposer
Copy link
Contributor Author

@hayescode Done, I've removed

@hayescode hayescode enabled auto-merge November 19, 2025 23:32
@hayescode hayescode added this pull request to the merge queue Nov 19, 2025
Merged via the queue into Chainlit:main with commit 27b9075 Nov 20, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pertains to the Python backend. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants