Skip to content

Commit 5a9f1b4

Browse files
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.x
1 parent 28bf80c commit 5a9f1b4

File tree

6 files changed

+1370
-10
lines changed

6 files changed

+1370
-10
lines changed

libs/oci/pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ version = "0.2.0"
44
description = "An integration package connecting OCI and LangChain"
55
readme = "README.md"
66
license = "UPL-1.0"
7-
requires-python = ">=3.9,<4.0"
7+
requires-python = ">=3.10,<4.0"
88
dependencies = [
9-
"langchain-core>=0.3.78,<1.0.0",
10-
"langchain>=0.3.20,<1.0.0",
9+
"langchain-core>=1.0.0,<2.0.0",
10+
"langchain>=1.0.0,<2.0.0",
1111
"oci>=2.161.0",
1212
"pydantic>=2,<3",
1313
"aiohttp>=3.12.14",
1414
"openai>=2.6.1",
1515
"oci-openai>=1.0.0",
16-
"langchain-openai>=0.3.35",
16+
"langchain-openai>=1.0.0,<2.0.0",
1717
]
1818

1919
[project.urls]
@@ -32,13 +32,13 @@ pytest-cov = "^4.1.0"
3232
syrupy = "^4.0.2"
3333
pytest-asyncio = "^0.23.2"
3434
pytest-watcher = "^0.3.4"
35-
langchain-tests = "^0.3.12"
35+
langchain-tests = "^1.0.0"
3636
pytest-socket = "^0.7.0"
3737
pytest-mock = "^3.15.0"
3838
pytest-httpx = "^0.28.0"
3939
responses = "^0.25.8"
40-
langgraph = "^0.2.0"
41-
langchain-openai = "^0.3.35"
40+
langgraph = "^0.4.0"
41+
langchain-openai = "^1.0.0"
4242

4343

4444
[tool.poetry.group.codespell]
@@ -51,7 +51,7 @@ codespell = "^2.2.6"
5151
optional = true
5252

5353
[tool.poetry.group.test_integration.dependencies]
54-
langgraph = "^0.2.0"
54+
langgraph = "^0.4.0"
5555

5656
[tool.poetry.group.lint]
5757
optional = true

0 commit comments

Comments
 (0)