Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ Ruff uses `--fix` by default through pre-commit, so it auto-fixes import orderin

### Testing

**Important**: Before running the full test suite, install all dependency groups:

```bash
uv sync --all-groups
```

This ensures all optional dependencies (docs, s2s, semap, etc.) are installed, which is required for collecting and running all tests.

Then run the test suite:

```bash
python -m pytest tests/ --timeout=60 -m "not billable and not ci_only and not manual" --ignore=src
```
Expand All @@ -54,6 +64,35 @@ The `pyproject.toml` already sets these default markers and `--ignore=src`.

**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.

### Commit conventions

This project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification. Commit messages should be structured as:

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

**Common types:**

- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `style`: Changes that don't affect code meaning (formatting, etc.)
- `refactor`: Code change that neither fixes a bug nor adds a feature
- `perf`: Performance improvements
- `test`: Adding or correcting tests
- `chore`: Changes to build process or auxiliary tools

**Examples:**

- `feat(agents): add support for custom tool schemas`
- `fix(ros2): handle service call timeouts correctly`
- `docs: update testing instructions in AGENTS.md`

### Key gotchas

- 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.
Expand Down
2 changes: 1 addition & 1 deletion src/rai_bench/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rai-bench"
version = "0.2.0"
version = "0.3.0"
description = "Package for running and creating benchmarks."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from langchain_core.callbacks.base import BaseCallbackHandler
from langchain_core.tracers.langchain import LangChainTracer
from langfuse.callback import CallbackHandler
from langfuse.langchain import CallbackHandler
from rai.initialization import get_tracing_callbacks


Expand Down
2 changes: 1 addition & 1 deletion src/rai_bench/rai_bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pathlib import Path
from typing import Any

from langchain.chat_models.base import BaseChatModel
from langchain_core.language_models.chat_models import BaseChatModel
from rai.initialization import get_llm_model_direct


Expand Down
12 changes: 6 additions & 6 deletions src/rai_core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rai_core"
version = "2.11.2"
version = "2.12.0"
description = "Core functionality for RAI framework"
readme = "README.md"
requires-python = ">=3.10,<3.13"
Expand All @@ -15,13 +15,13 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
]
dependencies = [
"langchain-core>=0.3,<0.4",
"langgraph",
"langchain-core>=1.2.10,<2.0.0",
"langgraph>=1.1.5,<2.0.0",
"langgraph-prebuilt",
"langchain",
"langchain>=1.0.0,<2.0.0",
"langchain-aws",
"langchain-openai",
"langchain-ollama>=0.3.4,<0.4.0",
"langchain-ollama",
"langchain-google-genai",
"langchain-community",
"requests>=2.32.2,<3.0.0",
Expand All @@ -35,7 +35,7 @@ dependencies = [
"lark>=1.1.9,<2.0.0",
"transforms3d>=0.4.1,<0.5.0",
"pillow>=11.0.0,<12.0.0",
"langfuse>=2.60.2,<3.0.0",
"langfuse>=3.8.0,<4.0.0",
"pydub>=0.25.1,<0.26.0",
"streamlit>=1.44,<2.0.0",
"numpy<2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import List, Optional, TypedDict

from deprecated import deprecated
from langchain.chat_models.base import BaseChatModel
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import (
BaseMessage,
SystemMessage,
Expand Down
2 changes: 1 addition & 1 deletion src/rai_core/rai/agents/langchain/core/megamind.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Optional,
)

from langchain.chat_models.base import BaseChatModel
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import (
BaseMessage,
HumanMessage,
Expand Down
2 changes: 1 addition & 1 deletion src/rai_core/rai/agents/langchain/core/plan_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
from typing import Any, Dict, List, Optional, Tuple, Union

from langchain.chat_models.base import BaseChatModel
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import BaseMessage, SystemMessage
from langchain_core.tools import BaseTool
from langgraph.graph import END, START, StateGraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from functools import partial
from typing import Optional

from langchain.chat_models.base import BaseChatModel
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import (
SystemMessage,
)
Expand Down
2 changes: 1 addition & 1 deletion src/rai_core/rai/aggregators/ros2/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from typing import Any, List, cast

from langchain.chat_models.base import BaseChatModel
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import HumanMessage, SystemMessage
from pydantic import BaseModel, Field
from rcl_interfaces.msg import Log
Expand Down
10 changes: 8 additions & 2 deletions src/rai_core/rai/initialization/model_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,18 +367,24 @@ def get_tracing_callbacks(

callbacks: List[BaseCallbackHandler] = []
if config.tracing.langfuse.use_langfuse:
from langfuse.callback import CallbackHandler # type: ignore
from langfuse import Langfuse
from langfuse.langchain import CallbackHandler # type: ignore

public_key = os.getenv("LANGFUSE_PUBLIC_KEY", None)
secret_key = os.getenv("LANGFUSE_SECRET_KEY", None)
if public_key is None or secret_key is None:
raise ValueError("LANGFUSE_PUBLIC_KEY or LANGFUSE_SECRET_KEY is not set")

callback = CallbackHandler(
# Initialize Langfuse singleton client with credentials
# This configures the global client that CallbackHandler will use
Langfuse(
public_key=public_key,
secret_key=secret_key,
host=config.tracing.langfuse.host,
)

# Create callback handler (uses the configured singleton client)
callback = CallbackHandler()
callbacks.append(callback)

if config.tracing.langsmith.use_langsmith:
Expand Down
5 changes: 3 additions & 2 deletions src/rai_whoami/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rai_whoami"
version = "0.0.5"
version = "0.1.0"
description = "Package to extract embodiment information from robot documentation"
readme = "README.md"
requires-python = ">=3.10,<3.13"
Expand All @@ -12,7 +12,8 @@ classifiers = [
]
dependencies = [
"PyYAML",
"langchain",
"langchain>=1.0.0,<2.0.0",
"langchain-community",
"PyPDF2",
"Pillow",
"faiss-cpu",
Expand Down
1 change: 1 addition & 0 deletions src/src/rai_interfaces
Submodule rai_interfaces added at f03dc0
Loading
Loading