8181from llama_stack_client import APIConnectionError , APIStatusError , AsyncLlamaStackClient
8282
8383import constants
84- from client import AsyncLlamaStackClientHolder
8584from configuration import configuration
8685from constants import DEFAULT_RAG_TOOL
8786from log import get_logger
@@ -219,8 +218,7 @@ async def maybe_get_topic_summary(
219218 return await get_topic_summary (input_text , client , model_id )
220219
221220
222- async def prepare_tools ( # pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument
223- client : AsyncLlamaStackClient ,
221+ async def prepare_tools ( # pylint: disable=too-many-arguments,too-many-positional-arguments
224222 vector_store_ids : Optional [list [str ]],
225223 no_tools : Optional [bool ],
226224 token : str ,
@@ -230,7 +228,6 @@ async def prepare_tools( # pylint: disable=too-many-arguments,too-many-position
230228 """Prepare tools for Responses API including RAG and MCP tools.
231229
232230 Args:
233- client: The Llama Stack client instance
234231 vector_store_ids: The list of vector store IDs to use for RAG tools
235232 or None to fall back to rag.tool configuration
236233 no_tools: Whether to skip tool preparation
@@ -360,7 +357,6 @@ async def prepare_responses_params( # pylint: disable=too-many-arguments,too-ma
360357
361358 # Prepare tools for responses API
362359 tools = await prepare_tools (
363- client ,
364360 query_request .vector_store_ids ,
365361 query_request .no_tools ,
366362 token ,
@@ -1739,9 +1735,7 @@ async def _resolve_client_tools(
17391735
17401736 # Optionally merge server-configured tools (RAG, MCP) with client tools
17411737 if merge_server_tools :
1742- client = AsyncLlamaStackClientHolder ().get_client ()
17431738 server_tools = await prepare_tools (
1744- client = client ,
17451739 vector_store_ids = vector_store_ids ,
17461740 no_tools = False ,
17471741 token = token ,
@@ -1769,9 +1763,7 @@ async def _resolve_server_tools(
17691763 Returns:
17701764 List of server-configured tools, or None if none are configured.
17711765 """
1772- client = AsyncLlamaStackClientHolder ().get_client ()
17731766 return await prepare_tools (
1774- client = client ,
17751767 vector_store_ids = None , # allow all vector stores configured
17761768 no_tools = False ,
17771769 token = token ,
@@ -1815,9 +1807,7 @@ async def resolve_tool_choice(
18151807
18161808 if tools is None :
18171809 # Register all tools configured in LCORE configuration
1818- client = AsyncLlamaStackClientHolder ().get_client ()
18191810 prepared_tools = await prepare_tools (
1820- client = client ,
18211811 vector_store_ids = None , # allow all vector stores configured
18221812 no_tools = False ,
18231813 token = token ,
0 commit comments