Skip to content

Commit f84f5b6

Browse files
committed
docs: added missing docstrings
1 parent b5c8ded commit f84f5b6

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/rai_bench/rai_bench/tool_calling_agent/interfaces.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,30 @@ def _check_tool_call(
121121
def _check_nested_fields(
122122
self, field_path: str, args: Dict[str, Any], expected_value: Any
123123
) -> bool:
124+
"""Check if a nested field in the arguments matches the expected value.
125+
126+
Parameters
127+
----------
128+
field_path : str
129+
Dot-separated path to the field (e.g., "header.frame_id").
130+
Including indexes for lists possible (e.g., "data[0].value").
131+
args : Dict[str, Any]
132+
The arguments dictionary to check.
133+
expected_value : Any
134+
The expected value for the field.
135+
136+
Returns
137+
-------
138+
bool
139+
True if the field matches the expected value, False otherwise.
140+
141+
142+
Raises
143+
------
144+
SubTaskValidationError
145+
If the field is not found or does not match the expected value.
146+
"""
147+
124148
keys = field_path.split(".")
125149
value: Any = args
126150
for key in keys:

src/rai_bench/rai_bench/tool_calling_agent/mocked_tools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ def _run(self, msg_type: str) -> str:
270270

271271
class ServiceValidator:
272272
"""
273-
Hybrid validator that uses ROS 2 native types when available,
274-
falls back to Pydantic models of custom interfaces
273+
Validator that is responsible for checking if gicen service type exists
274+
and if it is used correctly.
275+
Validator uses ROS 2 native types when available,
276+
falls back to Pydantic models of custom interfaces when not.
275277
"""
276278

277279
def __init__(self, custom_models: Dict[str, Type[BaseModel]]):

0 commit comments

Comments
 (0)