Skip to content

Commit e3c4372

Browse files
committed
refactor: rename meta_tools method to meta_search_tools
- Updates method name from meta_tools() to meta_search_tools() in Tools class - Updates all references in documentation, examples, and tests - Maintains backward compatibility for individual tool names - All tests pass with the new naming convention
1 parent 7371e00 commit e3c4372

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Meta tools enable dynamic tool discovery and execution without hardcoding tool n
3737
```python
3838
# Get meta tools for dynamic discovery
3939
tools = toolset.get_tools("hris_*")
40-
meta_tools = tools.meta_tools()
40+
meta_tools = tools.meta_search_tools()
4141

4242
# Search for relevant tools using natural language
4343
filter_tool = meta_tools.get_tool("meta_filter_relevant_tools")

examples/meta_tools_example.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def example_meta_tools_basic():
2828
print(f"Total HRIS tools available: {len(all_tools)}")
2929

3030
# Get meta tools for dynamic discovery
31-
meta_tools = all_tools.meta_tools()
31+
meta_tools = all_tools.meta_search_tools()
3232

3333
# Get the filter tool to search for relevant tools
3434
filter_tool = meta_tools.get_tool("meta_filter_relevant_tools")
@@ -52,7 +52,7 @@ def example_meta_tools_with_execution():
5252

5353
# Get all tools
5454
all_tools = toolset.get_tools()
55-
meta_tools = all_tools.meta_tools()
55+
meta_tools = all_tools.meta_search_tools()
5656

5757
# Step 1: Search for relevant tools
5858
filter_tool = meta_tools.get_tool("meta_filter_relevant_tools")
@@ -127,7 +127,7 @@ def example_with_openai():
127127

128128
# Get HRIS tools and their meta tools
129129
hris_tools = toolset.get_tools("hris_*")
130-
meta_tools = hris_tools.meta_tools()
130+
meta_tools = hris_tools.meta_search_tools()
131131

132132
# Convert to OpenAI format
133133
openai_tools = meta_tools.to_openai()
@@ -178,7 +178,7 @@ def example_with_langchain():
178178
langchain_tools = tools.to_langchain()
179179

180180
# Get meta tools as well
181-
meta_tools = tools.meta_tools()
181+
meta_tools = tools.meta_search_tools()
182182
langchain_meta_tools = meta_tools.to_langchain()
183183

184184
# Combine all tools

stackone_ai/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def to_langchain(self) -> Sequence[BaseTool]:
480480
"""
481481
return [tool.to_langchain() for tool in self.tools]
482482

483-
def meta_tools(self) -> "Tools":
483+
def meta_search_tools(self) -> "Tools":
484484
"""Return meta tools for tool discovery and execution
485485
486486
Meta tools enable dynamic tool discovery and execution based on natural language queries.

tests/test_meta_tools.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ def test_execute_tool_call(self, tools_collection):
225225
assert "success" in result or "employees" in result
226226

227227

228-
class TestToolsMetaTools:
229-
"""Test the meta_tools method on Tools collection"""
228+
class TestToolsMetaSearchTools:
229+
"""Test the meta_search_tools method on Tools collection"""
230230

231-
def test_meta_tools_creation(self, tools_collection):
232-
"""Test creating meta tools from a Tools collection"""
233-
meta_tools = tools_collection.meta_tools()
231+
def test_meta_search_tools_creation(self, tools_collection):
232+
"""Test creating meta search tools from a Tools collection"""
233+
meta_tools = tools_collection.meta_search_tools()
234234

235235
assert isinstance(meta_tools, Tools)
236236
assert len(meta_tools) == 2
@@ -240,9 +240,9 @@ def test_meta_tools_creation(self, tools_collection):
240240
assert "meta_filter_relevant_tools" in tool_names
241241
assert "meta_execute_tool" in tool_names
242242

243-
def test_meta_tools_functionality(self, tools_collection):
244-
"""Test that meta tools work correctly"""
245-
meta_tools = tools_collection.meta_tools()
243+
def test_meta_search_tools_functionality(self, tools_collection):
244+
"""Test that meta search tools work correctly"""
245+
meta_tools = tools_collection.meta_search_tools()
246246

247247
# Get the filter tool
248248
filter_tool = meta_tools.get_tool("meta_filter_relevant_tools")

0 commit comments

Comments
 (0)