@@ -80,39 +80,9 @@ def example_utility_tools_with_execution():
8080 print ()
8181
8282
83- def example_utility_tools_semantic ():
84- """Semantic search variant of utility tools.
85-
86- By passing semantic_client to utility_tools(), tool_search switches from
87- local BM25+TF-IDF to cloud-based semantic search for better natural language
88- understanding. See examples/semantic_search_example.py for more patterns.
89- """
90- print ("Example 3: Utility tools with semantic search\n " )
91-
92- toolset = StackOneToolSet ()
93-
94- # Fetch tools — these define the available tool catalog
95- all_tools = toolset .fetch_tools (actions = ["bamboohr_*" ])
96- print (f"Total BambooHR tools available: { len (all_tools )} " )
97-
98- # Pass semantic_client to switch from local BM25 to cloud semantic search
99- utility_tools = all_tools .utility_tools (semantic_client = toolset .semantic_client )
100-
101- filter_tool = utility_tools .get_tool ("tool_search" )
102- if filter_tool :
103- # Semantic search understands intent — "onboard new hire" finds onboarding tools
104- result = filter_tool .call (query = "onboard a new team member" , limit = 5 , minScore = 0.0 )
105-
106- print ("Found relevant tools (semantic search):" )
107- for tool in result .get ("tools" , []):
108- print (f" - { tool ['name' ]} (score: { tool ['score' ]:.2f} ): { tool ['description' ]} " )
109-
110- print ()
111-
112-
11383def example_with_openai ():
11484 """Example of using utility tools with OpenAI"""
115- print ("Example 4 : Using utility tools with OpenAI\n " )
85+ print ("Example 3 : Using utility tools with OpenAI\n " )
11686
11787 try :
11888 from openai import OpenAI
@@ -161,7 +131,7 @@ def example_with_openai():
161131
162132def example_with_langchain ():
163133 """Example of using tools with LangChain"""
164- print ("Example 5 : Using tools with LangChain\n " )
134+ print ("Example 4 : Using tools with LangChain\n " )
165135
166136 try :
167137 from langchain .agents import AgentExecutor , create_tool_calling_agent
@@ -227,7 +197,6 @@ def main():
227197 # Basic examples that work without external APIs
228198 example_utility_tools_basic ()
229199 example_utility_tools_with_execution ()
230- example_utility_tools_semantic ()
231200
232201 # Examples that require OpenAI API
233202 if os .getenv ("OPENAI_API_KEY" ):
0 commit comments