Skip to content

Commit 212832a

Browse files
cursor[bot]cursoragentmaciejmajek
authored
feat: langchain 1.x (#787)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Maciej Majek <maciejmajek@users.noreply.github.com> Co-authored-by: Maciej Majek <46171033+maciejmajek@users.noreply.github.com>
1 parent 5a67cb3 commit 212832a

14 files changed

Lines changed: 135 additions & 72 deletions

File tree

AGENTS.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ Ruff uses `--fix` by default through pre-commit, so it auto-fixes import orderin
4646

4747
### Testing
4848

49+
**Important**: Before running the full test suite, install all dependency groups:
50+
51+
```bash
52+
uv sync --all-groups
53+
```
54+
55+
This ensures all optional dependencies (docs, s2s, semap, etc.) are installed, which is required for collecting and running all tests.
56+
57+
Then run the test suite:
58+
4959
```bash
5060
python -m pytest tests/ --timeout=60 -m "not billable and not ci_only and not manual" --ignore=src
5161
```
@@ -54,6 +64,35 @@ The `pyproject.toml` already sets these default markers and `--ignore=src`.
5464

5565
**Sound device tests**: Tests under `tests/communication/sounds_device/` require virtual audio input/output devices. In headless environments without audio hardware, these tests will error during collection. Either skip them (`--ignore=tests/communication/sounds_device`) or create virtual PulseAudio/ALSA devices before running.
5666

67+
### Commit conventions
68+
69+
This project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification. Commit messages should be structured as:
70+
71+
```
72+
<type>[optional scope]: <description>
73+
74+
[optional body]
75+
76+
[optional footer(s)]
77+
```
78+
79+
**Common types:**
80+
81+
- `feat`: A new feature
82+
- `fix`: A bug fix
83+
- `docs`: Documentation only changes
84+
- `style`: Changes that don't affect code meaning (formatting, etc.)
85+
- `refactor`: Code change that neither fixes a bug nor adds a feature
86+
- `perf`: Performance improvements
87+
- `test`: Adding or correcting tests
88+
- `chore`: Changes to build process or auxiliary tools
89+
90+
**Examples:**
91+
92+
- `feat(agents): add support for custom tool schemas`
93+
- `fix(ros2): handle service call timeouts correctly`
94+
- `docs: update testing instructions in AGENTS.md`
95+
5796
### Key gotchas
5897

5998
- The `config.toml` in the repo root is the working config file; `rai-config-init` is only for pip-installed users, not developers using the repo.

src/rai_bench/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rai-bench"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
description = "Package for running and creating benchmarks."
55
readme = "README.md"
66
requires-python = ">=3.10"

src/rai_bench/rai_bench/results_processing/langfuse_scores_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from langchain_core.callbacks.base import BaseCallbackHandler
1919
from langchain_core.tracers.langchain import LangChainTracer
20-
from langfuse.callback import CallbackHandler
20+
from langfuse.langchain import CallbackHandler
2121
from rai.initialization import get_tracing_callbacks
2222

2323

src/rai_bench/rai_bench/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from pathlib import Path
1919
from typing import Any
2020

21-
from langchain.chat_models.base import BaseChatModel
21+
from langchain_core.language_models.chat_models import BaseChatModel
2222
from rai.initialization import get_llm_model_direct
2323

2424

src/rai_core/pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rai_core"
3-
version = "2.11.2"
3+
version = "2.12.0"
44
description = "Core functionality for RAI framework"
55
readme = "README.md"
66
requires-python = ">=3.10,<3.13"
@@ -15,13 +15,13 @@ classifiers = [
1515
"License :: OSI Approved :: Apache Software License",
1616
]
1717
dependencies = [
18-
"langchain-core>=0.3,<0.4",
19-
"langgraph",
18+
"langchain-core>=1.2.10,<2.0.0",
19+
"langgraph>=1.1.5,<2.0.0",
2020
"langgraph-prebuilt",
21-
"langchain",
21+
"langchain>=1.0.0,<2.0.0",
2222
"langchain-aws",
2323
"langchain-openai",
24-
"langchain-ollama>=0.3.4,<0.4.0",
24+
"langchain-ollama",
2525
"langchain-google-genai",
2626
"langchain-community",
2727
"requests>=2.32.2,<3.0.0",
@@ -35,7 +35,7 @@ dependencies = [
3535
"lark>=1.1.9,<2.0.0",
3636
"transforms3d>=0.4.1,<0.5.0",
3737
"pillow>=11.0.0,<12.0.0",
38-
"langfuse>=2.60.2,<3.0.0",
38+
"langfuse>=3.8.0,<4.0.0",
3939
"pydub>=0.25.1,<0.26.0",
4040
"streamlit>=1.44,<2.0.0",
4141
"numpy<2.0",

src/rai_core/rai/agents/langchain/core/conversational_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from typing import List, Optional, TypedDict
1919

2020
from deprecated import deprecated
21-
from langchain.chat_models.base import BaseChatModel
21+
from langchain_core.language_models.chat_models import BaseChatModel
2222
from langchain_core.messages import (
2323
BaseMessage,
2424
SystemMessage,

src/rai_core/rai/agents/langchain/core/megamind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Optional,
2323
)
2424

25-
from langchain.chat_models.base import BaseChatModel
25+
from langchain_core.language_models.chat_models import BaseChatModel
2626
from langchain_core.messages import (
2727
BaseMessage,
2828
HumanMessage,

src/rai_core/rai/agents/langchain/core/plan_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
from typing import Any, Dict, List, Optional, Tuple, Union
1515

16-
from langchain.chat_models.base import BaseChatModel
16+
from langchain_core.language_models.chat_models import BaseChatModel
1717
from langchain_core.messages import BaseMessage, SystemMessage
1818
from langchain_core.tools import BaseTool
1919
from langgraph.graph import END, START, StateGraph

src/rai_core/rai/agents/langchain/core/structured_output_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from functools import partial
1818
from typing import Optional
1919

20-
from langchain.chat_models.base import BaseChatModel
20+
from langchain_core.language_models.chat_models import BaseChatModel
2121
from langchain_core.messages import (
2222
SystemMessage,
2323
)

src/rai_core/rai/aggregators/ros2/aggregators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from typing import Any, List, cast
1616

17-
from langchain.chat_models.base import BaseChatModel
17+
from langchain_core.language_models.chat_models import BaseChatModel
1818
from langchain_core.messages import HumanMessage, SystemMessage
1919
from pydantic import BaseModel, Field
2020
from rcl_interfaces.msg import Log

0 commit comments

Comments
 (0)