Commit 5a9f1b4
committed
Add LangChain 1.x support and comprehensive integration tests
## Breaking Changes
- Python 3.10+ required (dropped Python 3.9 support)
- Requires langchain-core>=1.0.0,<2.0.0
- Requires langchain>=1.0.0,<2.0.0
- Requires langchain-openai>=1.0.0,<2.0.0
## Test Summary
| Test Suite | Passed | Total |
|------------|--------|-------|
| Unit Tests | 35 | 35 |
| Integration Tests | 66 | 67 |
| **Total** | **101** | **102** |
## Compatibility Testing
### LangChain 1.1.0 (Target Version)
```
langchain==1.1.0
langchain-core==1.1.0
langchain-openai==1.1.0
```
- Unit tests: 35/35 passed (100%)
- Integration tests: 66/67 passed (98.5%)
### LangChain 0.3.x (Backwards Compatibility Verified)
```
langchain==0.3.27
langchain-core==0.3.80
langchain-openai==0.3.35
```
- Unit tests: 35/35 passed (100%)
- Verified backwards compatibility works
## New Integration Test Files
1. **test_langchain_compatibility.py** (17 tests)
- Basic invoke, streaming, async
- Tool calling (single, multiple)
- Structured output (function calling, JSON mode)
- Response format tests
- LangChain 1.x specific API tests
2. **test_chat_features.py** (16 tests)
- LCEL chain tests (simple, with history, batch)
- Async chain invocation
- Streaming through chains
- Tool calling in chain context
- Structured output extraction
- Model configuration tests
- Conversation pattern tests
3. **test_multi_model.py** (33 tests)
- Meta Llama models (4-scout, 4-maverick, 3.3-70b, 3.1-70b)
- xAI Grok models (grok-3-70b, grok-3-mini-8b, grok-4-fast)
- OpenAI models (gpt-oss-20b, gpt-oss-120b)
- Cross-model consistency tests
- Streaming tests across vendors
## Models Tested (Real OCI Inference - Chicago Region)
### Meta Llama
| Model | Basic | Streaming | Tool Calling | Structured Output |
|-------|-------|-----------|--------------|-------------------|
| meta.llama-4-scout-17b-16e-instruct | ✅ | ✅ | ✅ | ✅ |
| meta.llama-4-maverick-17b-128e-instruct-fp8 | ✅ | ✅ | ✅ | ✅ |
| meta.llama-3.3-70b-instruct | ✅ | ✅ | ✅ | ✅ |
| meta.llama-3.1-70b-instruct | ✅ | ✅ | ✅ | ✅ |
### xAI Grok
| Model | Basic | Streaming | Tool Calling | Structured Output |
|-------|-------|-----------|--------------|-------------------|
| xai.grok-3-70b | ✅ | ✅ | ✅ | ✅ |
| xai.grok-3-mini-8b | ✅ | ✅ | ✅ | ✅ |
| xai.grok-4-fast-non-reasoning | ✅ | ✅ | ✅ | ✅ |
### OpenAI
| Model | Basic | Streaming | Tool Calling | Structured Output |
|-------|-------|-----------|--------------|-------------------|
| openai.gpt-oss-20b | ✅ | ✅ | ✅ | ✅ |
| openai.gpt-oss-120b | ✅ | ✅ | ✅ | ✅ |
## Code Changes
- pyproject.toml: Updated dependencies to LangChain 1.x
- test_tool_calling.py: Fixed import (langchain.tools -> langchain_core.tools)
- test_oci_data_science.py: Updated stream chunk count assertion for LangChain 1.x1 parent 28bf80c commit 5a9f1b4
File tree
6 files changed
+1370
-10
lines changed- libs/oci
- tests
- integration_tests/chat_models
- unit_tests/chat_models
6 files changed
+1370
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments